@invarn/cibuild 2.9.2 → 2.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +97 -12
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts +42 -0
- package/dist/src/yaml/steps/cocoapods-deployment-floor.d.ts.map +1 -0
- package/dist/src/yaml/steps/cocoapods-deployment-floor.js +140 -0
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts +11 -0
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/cocoapods-deployment-floor.test.js +176 -0
- package/dist/src/yaml/steps/ios-deps.d.ts.map +1 -1
- package/dist/src/yaml/steps/ios-deps.js +2 -0
- package/dist/src/yaml/steps/xcode-derived-data.test.js +18 -1
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts +53 -0
- package/dist/src/yaml/steps/xcode-simulator-archs.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode-simulator-archs.js +98 -0
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts +21 -0
- package/dist/src/yaml/steps/xcode-simulator-archs.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode-simulator-archs.test.js +155 -0
- package/dist/src/yaml/steps/xcode.d.ts.map +1 -1
- package/dist/src/yaml/steps/xcode.js +31 -2
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A simulator build pinned to arm64, on a project whose effective settings
|
|
3
|
+
* exclude arm64 from the simulator, builds x86_64 instead — decided at run
|
|
4
|
+
* time, after `pod install`, from what Xcode itself reports.
|
|
5
|
+
*
|
|
6
|
+
* The witness (nightly-baseline issue 54): ExistOrLive/GithubClient @ 7969212a.
|
|
7
|
+
* Its pod WoodPeckeriOS 1.4.3 ships `user_target_xcconfig:
|
|
8
|
+
* { "EXCLUDED_ARCHS[sdk=iphonesimulator*]": "arm64" }`, which CocoaPods writes
|
|
9
|
+
* into the app's `Pods-…debug.xcconfig`. The pipeline pinned `ARCHS=arm64`, so
|
|
10
|
+
* nothing was left to build and `[CP] Embed Pods Frameworks` died on
|
|
11
|
+
* `ARCHS[@]: unbound variable` (bld_b91e230368d6505e97ec9b75). Nothing in the
|
|
12
|
+
* repository says so before `pod install` has run.
|
|
13
|
+
*
|
|
14
|
+
* Measured on a clone, Xcode 26.4, 2026-10-01: after `pod install`,
|
|
15
|
+
* `xcodebuild -showBuildSettings -json … -destination 'generic/platform=iOS
|
|
16
|
+
* Simulator'` reported, for target ZLGitHubClient
|
|
17
|
+
* (com.apple.product-type.application), `EXCLUDED_ARCHS = "arm64"`, in 3 s;
|
|
18
|
+
* and `ARCHS=x86_64` compiled the app's sources.
|
|
19
|
+
*/
|
|
20
|
+
import { describe, test, expect } from '@jest/globals';
|
|
21
|
+
import { execFileSync } from 'node:child_process';
|
|
22
|
+
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
23
|
+
import { tmpdir } from 'node:os';
|
|
24
|
+
import { join } from 'node:path';
|
|
25
|
+
import { ARM64_EXCLUSION_READER_SOURCE, pinsSimulatorArm64, withRuntimeSimulatorArchs, } from './xcode-simulator-archs.js';
|
|
26
|
+
import { XcodeBuildForSimulatorStepExecutor, XcodeBuildForTestStepExecutor, } from './xcode.js';
|
|
27
|
+
import { testConfig } from './test-config.js';
|
|
28
|
+
/** What `-showBuildSettings -json` printed for GithubClient, cut to the fields read. */
|
|
29
|
+
const githubClient = [
|
|
30
|
+
{
|
|
31
|
+
action: 'build',
|
|
32
|
+
target: 'ZLGitHubClient',
|
|
33
|
+
buildSettings: {
|
|
34
|
+
PRODUCT_TYPE: 'com.apple.product-type.application',
|
|
35
|
+
EXCLUDED_ARCHS: 'arm64',
|
|
36
|
+
ARCHS: 'x86_64',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
const read = (settings) => {
|
|
41
|
+
const dir = mkdtempSync(join(tmpdir(), 'sim-archs-'));
|
|
42
|
+
try {
|
|
43
|
+
const reader = join(dir, 'reader.cjs');
|
|
44
|
+
writeFileSync(reader, ARM64_EXCLUSION_READER_SOURCE);
|
|
45
|
+
return execFileSync('node', [reader], {
|
|
46
|
+
input: typeof settings === 'string' ? settings : JSON.stringify(settings),
|
|
47
|
+
encoding: 'utf8',
|
|
48
|
+
}).trim();
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
rmSync(dir, { recursive: true, force: true });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
describe('the arm64 exclusion reader', () => {
|
|
55
|
+
test('names the app target that excludes arm64, and its setting', () => {
|
|
56
|
+
expect(read(githubClient)).toBe('target ZLGitHubClient sets EXCLUDED_ARCHS = arm64');
|
|
57
|
+
});
|
|
58
|
+
test('says nothing when arm64 is not excluded', () => {
|
|
59
|
+
expect(read([{ ...githubClient[0], buildSettings: { PRODUCT_TYPE: 'com.apple.product-type.application', EXCLUDED_ARCHS: '' } }])).toBe('');
|
|
60
|
+
expect(read([{ ...githubClient[0], buildSettings: { PRODUCT_TYPE: 'com.apple.product-type.application' } }])).toBe('');
|
|
61
|
+
});
|
|
62
|
+
test('reads arm64 as a word, not a substring', () => {
|
|
63
|
+
const s = (v) => [{ ...githubClient[0], buildSettings: { PRODUCT_TYPE: 'com.apple.product-type.application', EXCLUDED_ARCHS: v } }];
|
|
64
|
+
expect(read(s('i386 arm64'))).toBe('target ZLGitHubClient sets EXCLUDED_ARCHS = i386 arm64');
|
|
65
|
+
expect(read(s('arm64e'))).toBe('');
|
|
66
|
+
});
|
|
67
|
+
test('judges the application target, not a library the scheme also lists', () => {
|
|
68
|
+
const settings = [
|
|
69
|
+
{ target: 'SomeKit', buildSettings: { PRODUCT_TYPE: 'com.apple.product-type.framework', EXCLUDED_ARCHS: 'arm64' } },
|
|
70
|
+
{ target: 'App', buildSettings: { PRODUCT_TYPE: 'com.apple.product-type.application', EXCLUDED_ARCHS: '' } },
|
|
71
|
+
];
|
|
72
|
+
expect(read(settings)).toBe('');
|
|
73
|
+
});
|
|
74
|
+
test('with no application target listed, any target that excludes arm64 counts', () => {
|
|
75
|
+
expect(read([{ target: 'Lib', buildSettings: { EXCLUDED_ARCHS: 'arm64' } }])).toBe('target Lib sets EXCLUDED_ARCHS = arm64');
|
|
76
|
+
});
|
|
77
|
+
test('unreadable output is no evidence: says nothing, exits 0', () => {
|
|
78
|
+
expect(read('')).toBe('');
|
|
79
|
+
expect(read('xcodebuild: error: not json')).toBe('');
|
|
80
|
+
expect(read({ not: 'an array' })).toBe('');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
describe('pinsSimulatorArm64 / withRuntimeSimulatorArchs', () => {
|
|
84
|
+
const template = "-skipMacroValidation -skipPackagePluginValidation 'OTHER_CFLAGS=$(inherited) -Wno-error=parentheses' ARCHS=arm64";
|
|
85
|
+
test('the template line pins arm64', () => {
|
|
86
|
+
expect(pinsSimulatorArm64(template)).toBe(true);
|
|
87
|
+
});
|
|
88
|
+
test('an x86_64 already chosen at creation (issue 10) is not touched', () => {
|
|
89
|
+
const chosen = template.replace('ARCHS=arm64', 'ARCHS=x86_64');
|
|
90
|
+
expect(pinsSimulatorArm64(chosen)).toBe(false);
|
|
91
|
+
expect(withRuntimeSimulatorArchs(chosen)).toBe(chosen);
|
|
92
|
+
});
|
|
93
|
+
test('only a whole ARCHS=arm64 token counts', () => {
|
|
94
|
+
expect(pinsSimulatorArm64('VALID_ARCHS=arm64')).toBe(false);
|
|
95
|
+
expect(pinsSimulatorArm64('ARCHS=arm64e')).toBe(false);
|
|
96
|
+
expect(pinsSimulatorArm64('ARCHS=arm64 -quiet')).toBe(true);
|
|
97
|
+
});
|
|
98
|
+
test('the pin becomes the run-time variable, the rest of the line unchanged', () => {
|
|
99
|
+
expect(withRuntimeSimulatorArchs(template)).toBe("-skipMacroValidation -skipPackagePluginValidation 'OTHER_CFLAGS=$(inherited) -Wno-error=parentheses' ARCHS=\"$CIBUILD_SIMULATOR_ARCHS\"");
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
const steps = [
|
|
103
|
+
['xcode-build-for-simulator', () => new XcodeBuildForSimulatorStepExecutor(), 'xcodebuild build "$PROJECT_TYPE"'],
|
|
104
|
+
['xcode-build-for-test', () => new XcodeBuildForTestStepExecutor(), 'xcodebuild build-for-testing'],
|
|
105
|
+
];
|
|
106
|
+
describe.each(steps)('%s reads the exclusion at run time', (_name, make, buildMarker) => {
|
|
107
|
+
const script = async (xcodebuild_options) => (await make().execute({
|
|
108
|
+
project_path: 'ZLGitHubClient/ZLGitHubClient.xcworkspace',
|
|
109
|
+
scheme: 'ZLGitHubClient',
|
|
110
|
+
configuration: 'Debug',
|
|
111
|
+
destination: 'generic/platform=iOS Simulator',
|
|
112
|
+
xcodebuild_options,
|
|
113
|
+
}, {}, testConfig)).script;
|
|
114
|
+
const pinned = "'OTHER_CFLAGS=$(inherited) -Wno-error=parentheses' ARCHS=arm64";
|
|
115
|
+
test('asks Xcode for the effective settings, after resolution and before the build', async () => {
|
|
116
|
+
const s = await script(pinned);
|
|
117
|
+
const ask = s.indexOf('xcodebuild -showBuildSettings -json');
|
|
118
|
+
expect(ask).toBeGreaterThan(s.indexOf('xcodebuild -resolvePackageDependencies'));
|
|
119
|
+
expect(ask).toBeLessThan(s.indexOf(buildMarker));
|
|
120
|
+
const line = s.split('\n').find((l) => l.includes('-showBuildSettings'));
|
|
121
|
+
expect(line).toContain("-scheme 'ZLGitHubClient'");
|
|
122
|
+
expect(line).toContain("-configuration 'Debug'");
|
|
123
|
+
expect(line).toContain("-destination 'generic/platform=iOS Simulator'");
|
|
124
|
+
});
|
|
125
|
+
test('builds with the run-time choice, arm64 unless the project excludes it', async () => {
|
|
126
|
+
const s = await script(pinned);
|
|
127
|
+
expect(s).toContain('CIBUILD_SIMULATOR_ARCHS=arm64');
|
|
128
|
+
expect(s).toContain('CIBUILD_SIMULATOR_ARCHS=x86_64');
|
|
129
|
+
const build = s.split('\n').find((l) => l.startsWith(buildMarker.split(' "')[0]) && !l.includes('-showBuildSettings') && !l.includes('-resolvePackageDependencies'));
|
|
130
|
+
expect(build).toContain('ARCHS="$CIBUILD_SIMULATOR_ARCHS"');
|
|
131
|
+
expect(build).not.toContain('ARCHS=arm64');
|
|
132
|
+
});
|
|
133
|
+
test('says so in the log, as the creation-time switch does', async () => {
|
|
134
|
+
expect(await script(pinned)).toContain('Building the simulator app as x86_64, not arm64: ');
|
|
135
|
+
});
|
|
136
|
+
test('without an arm64 pin there is nothing to check', async () => {
|
|
137
|
+
for (const opts of ['', pinned.replace('arm64', 'x86_64')]) {
|
|
138
|
+
const s = await script(opts);
|
|
139
|
+
expect(s).not.toContain('-showBuildSettings');
|
|
140
|
+
expect(s).not.toContain('CIBUILD_SIMULATOR_ARCHS');
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
test('the emitted script is valid bash', async () => {
|
|
144
|
+
const dir = mkdtempSync(join(tmpdir(), 'sim-archs-sh-'));
|
|
145
|
+
try {
|
|
146
|
+
const f = join(dir, 's.sh');
|
|
147
|
+
writeFileSync(f, await script(pinned));
|
|
148
|
+
expect(() => execFileSync('bash', ['-n', f])).not.toThrow();
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
rmSync(dir, { recursive: true, force: true });
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
//# sourceMappingURL=xcode-simulator-archs.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/xcode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/xcode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CA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CAAC;CAmNvH;AAMD,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,gBAAgB;IAC/D,yBAAyB,CACvB,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAM1B,UAAU,IAAI,UAAU,EAAE;IAOpB,OAAO,CAAC,MAAM,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAkHhH"}
|
|
@@ -5,6 +5,7 @@ import { existsSync } from 'node:fs';
|
|
|
5
5
|
import { BaseStepExecutor } from './base.js';
|
|
6
6
|
import { resolveDestinationInput } from './xcode-destination.js';
|
|
7
7
|
import { APP_PRODUCT_RESOLVER_SOURCE } from './xcode-app-product.js';
|
|
8
|
+
import { pinsSimulatorArm64, simulatorArchsLines, withRuntimeSimulatorArchs } from './xcode-simulator-archs.js';
|
|
8
9
|
import { refusedFetchHelpers, retryOnRefusedFetch } from './git-fetch-retry.js';
|
|
9
10
|
/**
|
|
10
11
|
* Where derived data goes: outside the source tree, keyed by the output dir.
|
|
@@ -23,12 +24,20 @@ import { refusedFetchHelpers, retryOnRefusedFetch } from './git-fetch-retry.js';
|
|
|
23
24
|
* name the same output_dir still share derived data (the iOS template relies
|
|
24
25
|
* on that to avoid compiling the app twice) and two that name different ones
|
|
25
26
|
* stay apart, as they did before.
|
|
27
|
+
*
|
|
28
|
+
* The path is resolved to its real one. On macOS /tmp and TMPDIR's /var are
|
|
29
|
+
* symlinks into /private, and analogcode/Swift-Radio-Pro's LNPopupController
|
|
30
|
+
* lists header directories with FileManager (real paths) but strips
|
|
31
|
+
* packageBase.path (the symlinked one) by text replacement: every header
|
|
32
|
+
* search path came out eight characters short.
|
|
26
33
|
*/
|
|
27
34
|
function derivedDataPathLines() {
|
|
28
35
|
return [
|
|
29
36
|
'# Derived data outside the source tree, keyed by the output dir',
|
|
30
37
|
'DERIVED_DATA_PATH="${CIBUILD_SCRATCH:-${TMPDIR:-/tmp}}/cibuild-derived-data/$(printf \'%s\' "$OUTPUT_DIR" | cksum | cut -d\' \' -f1)"',
|
|
31
38
|
'mkdir -p "$DERIVED_DATA_PATH"',
|
|
39
|
+
'# Its real path: /tmp and TMPDIR are symlinks on macOS, and a package that builds paths by text arithmetic breaks on them',
|
|
40
|
+
'DERIVED_DATA_PATH="$(cd "$DERIVED_DATA_PATH" && pwd -P)"',
|
|
32
41
|
'echo "Derived data: $DERIVED_DATA_PATH"',
|
|
33
42
|
];
|
|
34
43
|
}
|
|
@@ -863,6 +872,16 @@ export class XcodeBuildForTestStepExecutor extends BaseStepExecutor {
|
|
|
863
872
|
` -scheme '${escapedScheme}'` +
|
|
864
873
|
' -derivedDataPath "$DERIVED_DATA_PATH"',
|
|
865
874
|
}));
|
|
875
|
+
const pinsArm64 = pinsSimulatorArm64(xcodebuildOptions);
|
|
876
|
+
if (pinsArm64) {
|
|
877
|
+
commands.push(...simulatorArchsLines({
|
|
878
|
+
projectPath: escapedPath,
|
|
879
|
+
scheme: escapedScheme,
|
|
880
|
+
configuration: this.escapeBash(configuration),
|
|
881
|
+
destination: this.escapeBash(destination),
|
|
882
|
+
xcconfig: Boolean(xcconfigContent.trim()),
|
|
883
|
+
}));
|
|
884
|
+
}
|
|
866
885
|
// Build command
|
|
867
886
|
let cmd = 'xcodebuild build-for-testing';
|
|
868
887
|
cmd += ` "$PROJECT_TYPE" '${escapedPath}'`;
|
|
@@ -877,7 +896,7 @@ export class XcodeBuildForTestStepExecutor extends BaseStepExecutor {
|
|
|
877
896
|
cmd += ' -xcconfig "$XCCONFIG_FILE"';
|
|
878
897
|
}
|
|
879
898
|
if (xcodebuildOptions) {
|
|
880
|
-
cmd += ` ${xcodebuildOptions}`;
|
|
899
|
+
cmd += ` ${pinsArm64 ? withRuntimeSimulatorArchs(xcodebuildOptions) : xcodebuildOptions}`;
|
|
881
900
|
}
|
|
882
901
|
commands.push(cmd);
|
|
883
902
|
commands.push('');
|
|
@@ -1071,6 +1090,16 @@ export class XcodeBuildForSimulatorStepExecutor extends BaseStepExecutor {
|
|
|
1071
1090
|
` -scheme '${escapedScheme}'` +
|
|
1072
1091
|
' -derivedDataPath "$DERIVED_DATA_PATH"',
|
|
1073
1092
|
}));
|
|
1093
|
+
const pinsArm64 = pinsSimulatorArm64(xcodebuildOptions);
|
|
1094
|
+
if (pinsArm64) {
|
|
1095
|
+
commands.push(...simulatorArchsLines({
|
|
1096
|
+
projectPath: escapedPath,
|
|
1097
|
+
scheme: escapedScheme,
|
|
1098
|
+
configuration: configuration ? this.escapeBash(configuration) : '',
|
|
1099
|
+
destination: this.escapeBash(destination),
|
|
1100
|
+
xcconfig: true,
|
|
1101
|
+
}));
|
|
1102
|
+
}
|
|
1074
1103
|
// Build command
|
|
1075
1104
|
let cmd = 'xcodebuild';
|
|
1076
1105
|
if (performClean === 'yes') {
|
|
@@ -1119,7 +1148,7 @@ export class XcodeBuildForSimulatorStepExecutor extends BaseStepExecutor {
|
|
|
1119
1148
|
cmd += ` -derivedDataPath "$DERIVED_DATA_PATH"`;
|
|
1120
1149
|
cmd += ' -xcconfig "$XCCONFIG_FILE"';
|
|
1121
1150
|
if (xcodebuildOptions) {
|
|
1122
|
-
cmd += ` ${xcodebuildOptions}`;
|
|
1151
|
+
cmd += ` ${pinsArm64 ? withRuntimeSimulatorArchs(xcodebuildOptions) : xcodebuildOptions}`;
|
|
1123
1152
|
}
|
|
1124
1153
|
commands.push(cmd);
|
|
1125
1154
|
commands.push('');
|