fix(build): skip Codex schema check for Claude-only installs
Install and update always build every client package, so a Claude-only run warned that the Codex CLI was missing even though no Codex package is installed. Add -SkipCodexSchema / --skip-codex-schema to the builds and pass it from install and update when only Claude is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
adc4745d10
commit
3fcd7bcbfd
9 files changed
+34
-6
No files matched your search
@@ -1,5 +1,5 @@
|
||||
[CmdletBinding()]
|
||||
param([switch]$Summary)
|
||||
param([switch]$Summary, [switch]$SkipCodexSchema)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
|
||||
. (Join-Path $root 'shared/hooks/scripts/Resolve-Python.ps1')
|
||||
@@ -217,7 +217,8 @@ foreach ($shell in @('powershell','bash')) {
|
||||
$settingsPath = Join-Path $output "claude-$shell/settings.json"
|
||||
Invoke-Python (Join-Path $root 'scripts/checks/validate-config.py') $tomlPath $settingsPath
|
||||
if ($LASTEXITCODE -ne 0) { throw "Generated configuration validation failed for $shell." }
|
||||
Test-CodexSchema $tomlPath
|
||||
# Claude-only installs and updates never use the Codex packages, so their schema check is skipped.
|
||||
if (-not $SkipCodexSchema) { Test-CodexSchema $tomlPath }
|
||||
}
|
||||
|
||||
$leftoverPlaceholders = @(Get-ChildItem $output -File -Recurse | ForEach-Object {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
summary=false
|
||||
skip_codex_schema=false
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--summary) summary=true; shift ;;
|
||||
--skip-codex-schema) skip_codex_schema=true; shift ;;
|
||||
*) printf 'Unknown argument: %s\n' "$1" >&2; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
@@ -216,7 +218,10 @@ done
|
||||
toml_path="$output/codex-$shell/config.toml"
|
||||
settings_path="$output/claude-$shell/settings.json"
|
||||
run_python "$root/scripts/checks/validate-config.py" "$toml_path" "$settings_path"
|
||||
if command -v codex >/dev/null; then
|
||||
# Claude-only installs and updates never use the Codex packages, so their schema check is skipped.
|
||||
if [ "$skip_codex_schema" = true ]; then
|
||||
:
|
||||
elif command -v codex >/dev/null; then
|
||||
schema_home=$(mktemp -d)
|
||||
cp "$toml_path" "$schema_home/config.toml"
|
||||
CODEX_HOME="$schema_home" codex --strict-config --help >/dev/null
|
||||
|
||||
@@ -26,7 +26,7 @@ if (-not $DryRun -and (Test-AnyManifestPresent (Get-InstallDestinations -HomePat
|
||||
$options = Read-InstallOptions -HomePath $homePath -RepositoryRoot $root -Client $Client -DryRun:$DryRun
|
||||
|
||||
$buildScript = Join-Path $root 'scripts/commands/build.ps1'
|
||||
& $buildScript -Summary:$Summary
|
||||
& $buildScript -Summary:$Summary -SkipCodexSchema:($Client -eq 'Claude')
|
||||
if (-not $?) { throw 'Build failed. Installation was not started.' }
|
||||
$generated = Join-Path $root 'generated'
|
||||
if (-not (Test-Path $generated)) { throw 'Generated output is missing after a successful build.' }
|
||||
|
||||
@@ -39,6 +39,7 @@ read_install_options
|
||||
|
||||
build_args=()
|
||||
[ "$summary" = false ] || build_args+=(--summary)
|
||||
[ "$client" != claude ] || build_args+=(--skip-codex-schema)
|
||||
bash "$root/scripts/commands/build.sh" "${build_args[@]}"
|
||||
generated="$root/generated"
|
||||
[ -d "$generated" ] || { printf 'Generated output is missing after a successful build.\n' >&2; exit 1; }
|
||||
|
||||
@@ -33,7 +33,7 @@ if (-not $DryRun -and -not (Test-AllManifestsPresent (Get-InstallDestinations -H
|
||||
$options = if ($Quick) { $saved } else { Read-InstallOptions -HomePath $homePath -RepositoryRoot $root -Client $Client -DryRun:$DryRun }
|
||||
|
||||
$buildScript = Join-Path $root 'scripts/commands/build.ps1'
|
||||
& $buildScript -Summary:$Summary
|
||||
& $buildScript -Summary:$Summary -SkipCodexSchema:($Client -eq 'Claude')
|
||||
if (-not $?) { throw 'Build failed. Update was not started.' }
|
||||
$generated = Join-Path $root 'generated'
|
||||
if (-not (Test-Path $generated)) { throw 'Generated output is missing after a successful build.' }
|
||||
|
||||
@@ -45,6 +45,7 @@ if [ "$quick" = false ]; then read_install_options; fi
|
||||
|
||||
build_args=()
|
||||
[ "$summary" = false ] || build_args+=(--summary)
|
||||
[ "$client" != claude ] || build_args+=(--skip-codex-schema)
|
||||
bash "$root/scripts/commands/build.sh" "${build_args[@]}"
|
||||
generated="$root/generated"
|
||||
[ -d "$generated" ] || { printf 'Generated output is missing after a successful build.\n' >&2; exit 1; }
|
||||
|
||||
Reference in new issue
Block a user