@expo/build-tools 0.1.152 → 0.1.154

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.
@@ -1,3 +1,3 @@
1
1
  import { errors } from '@expo/eas-build-job';
2
2
  import { ErrorContext } from './errors.types';
3
- export declare function resolveBuildPhaseError(error: any, logLines: string[], errorContext: ErrorContext): errors.BuildError;
3
+ export declare function resolveBuildPhaseErrorAsync(error: any, logLines: string[], errorContext: ErrorContext, buildLogsDirectory: string): Promise<errors.BuildError>;
@@ -1,38 +1,62 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveBuildPhaseError = void 0;
6
+ exports.resolveBuildPhaseErrorAsync = void 0;
4
7
  const eas_build_job_1 = require("@expo/eas-build-job");
8
+ const fs_extra_1 = __importDefault(require("fs-extra"));
9
+ const xcodeBuildLogs_1 = require("../ios/xcodeBuildLogs");
10
+ const errors_types_1 = require("./errors.types");
5
11
  const userErrorHandlers_1 = require("./userErrorHandlers");
6
12
  const buildErrorHandlers_1 = require("./buildErrorHandlers");
7
- function resolveError(errorHandlers, logLines, errorContext) {
13
+ async function maybeReadXcodeBuildLogs(phase, buildLogsDirectory) {
14
+ if (phase !== eas_build_job_1.BuildPhase.RUN_FASTLANE) {
15
+ return;
16
+ }
17
+ try {
18
+ const xcodeBuildLogsPath = await (0, xcodeBuildLogs_1.findXcodeBuildLogsPathAsync)(buildLogsDirectory);
19
+ if (!xcodeBuildLogsPath) {
20
+ return;
21
+ }
22
+ return await fs_extra_1.default.readFile(xcodeBuildLogsPath, 'utf-8');
23
+ }
24
+ catch (err) {
25
+ return undefined;
26
+ }
27
+ }
28
+ function resolveError(errorHandlers, logLines, errorContext, xcodeBuildLogs) {
8
29
  const { job, phase } = errorContext;
9
30
  const { platform } = job;
10
31
  const logs = logLines.join('\n');
11
32
  const handlers = errorHandlers
12
33
  .filter((handler) => handler.platform === platform || !handler.platform)
13
- .filter((handler) => handler.phase === phase || !handler.phase);
34
+ .filter((handler) => (handler.phase === errors_types_1.XCODE_BUILD_PHASE && phase === eas_build_job_1.BuildPhase.RUN_FASTLANE) ||
35
+ handler.phase === phase ||
36
+ !handler.phase);
14
37
  for (const handler of handlers) {
15
38
  const regexp = typeof handler.regexp === 'function' ? handler.regexp(errorContext) : handler.regexp;
16
39
  if (!regexp) {
17
40
  continue;
18
41
  }
19
- const match = logs.match(regexp);
42
+ const match = handler.phase === errors_types_1.XCODE_BUILD_PHASE ? xcodeBuildLogs === null || xcodeBuildLogs === void 0 ? void 0 : xcodeBuildLogs.match(regexp) : logs.match(regexp);
20
43
  if (match) {
21
44
  return handler.createError(match, errorContext);
22
45
  }
23
46
  }
24
47
  return undefined;
25
48
  }
26
- function resolveBuildPhaseError(error, logLines, errorContext) {
49
+ async function resolveBuildPhaseErrorAsync(error, logLines, errorContext, buildLogsDirectory) {
27
50
  var _a, _b, _c;
28
51
  const { phase } = errorContext;
29
52
  if (error instanceof eas_build_job_1.errors.BuildError) {
30
53
  return error;
31
54
  }
55
+ const xcodeBuildLogs = await maybeReadXcodeBuildLogs(phase, buildLogsDirectory);
32
56
  const userFacingError = error instanceof eas_build_job_1.errors.UserFacingError
33
57
  ? error
34
- : (_a = resolveError(userErrorHandlers_1.userErrorHandlers, logLines, errorContext)) !== null && _a !== void 0 ? _a : new eas_build_job_1.errors.UnknownError();
35
- const buildError = resolveError(buildErrorHandlers_1.buildErrorHandlers, logLines, errorContext);
58
+ : (_a = resolveError(userErrorHandlers_1.userErrorHandlers, logLines, errorContext, xcodeBuildLogs)) !== null && _a !== void 0 ? _a : new eas_build_job_1.errors.UnknownError();
59
+ const buildError = resolveError(buildErrorHandlers_1.buildErrorHandlers, logLines, errorContext, xcodeBuildLogs);
36
60
  const isUnknownUserError = !userFacingError ||
37
61
  [
38
62
  eas_build_job_1.errors.ErrorCode.UNKNOWN_ERROR,
@@ -50,5 +74,5 @@ function resolveBuildPhaseError(error, logLines, errorContext) {
50
74
  buildPhase: phase,
51
75
  });
52
76
  }
53
- exports.resolveBuildPhaseError = resolveBuildPhaseError;
77
+ exports.resolveBuildPhaseErrorAsync = resolveBuildPhaseErrorAsync;
54
78
  //# sourceMappingURL=detectError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"detectError.js","sourceRoot":"","sources":["../../src/buildErrors/detectError.ts"],"names":[],"mappings":";;;AAAA,uDAA6C;AAG7C,2DAAwD;AACxD,6DAA0D;AAE1D,SAAS,YAAY,CACnB,aAAgC,EAChC,QAAkB,EAClB,YAA0B;IAE1B,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC;IACpC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,aAAa;SAC3B,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;SACvE,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClE,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,MAAM,MAAM,GACV,OAAO,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvF,IAAI,CAAC,MAAM,EAAE;YACX,SAAS;SACV;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,KAAK,EAAE;YACT,OAAO,OAAO,CAAC,WAAW,C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9C,iBAAiB,EAAE,eAAe,CAAC,OAAO;QAC1C,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;AACL,CAAC;AApCD,wDAoCC","sourcesContent":["import { errors } from '@expo/eas-build-job';\n\nimport { ErrorContext, ErrorHandler } from './errors.types';\nimport { userErrorHandlers } from './userErrorHandlers';\nimport { buildErrorHandlers } from './buildErrorHandlers';\n\nfunction resolveError<T extends Error>(\n errorHandlers: ErrorHandler<T>[],\n logLines: string[],\n errorContext: ErrorContext\n): T | undefined {\n const { job, phase } = errorContext;\n const { platform } = job;\n const logs = logLines.join('\\n');\n const handlers = errorHandlers\n .filter((handler) => handler.platform === platform || !handler.platform)\n .filter((handler) => handler.phase === phase || !handler.phase);\n for (const handler of handlers) {\n const regexp =\n typeof handler.regexp === 'function' ? handler.regexp(errorContext) : handler.regexp;\n if (!regexp) {\n continue;\n }\n const match = logs.match(regexp);\n if (match) {\n return handler.createError(match, errorContext);\n }\n }\n return undefined;\n}\n\nexport function resolveBuildPhaseError(\n error: any,\n logLines: string[],\n errorContext: ErrorContext\n): errors.BuildError {\n const { phase } = errorContext;\n if (error instanceof errors.BuildError) {\n return error;\n }\n const userFacingError =\n error instanceof errors.UserFacingError\n ? error\n : resolveError(userErrorHandlers, logLines, errorContext) ?? new errors.UnknownError();\n const buildError = resolveError(buildErrorHandlers, logLines, errorContext);\n\n const isUnknownUserError =\n !userFacingError ||\n ([\n errors.ErrorCode.UNKNOWN_ERROR,\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n ] as string[]).includes(userFacingError.errorCode);\n const message =\n (isUnknownUserError ? buildError?.message : userFacingError.message) ?? userFacingError.message;\n const errorCode =\n (isUnknownUserError ? buildError?.errorCode : userFacingError.errorCode) ??\n userFacingError.errorCode;\n\n return new errors.BuildError(message, {\n errorCode,\n userFacingErrorCode: userFacingError.errorCode,\n userFacingMessage: userFacingError.message,\n docsUrl: userFacingError.docsUrl,\n innerError: error,\n buildPhase: phase,\n });\n}\n"]}
1
+ {"version":3,"file":"detectError.js","sourceRoot":"","sources":["../../src/buildErrors/detectError.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAyD;AACzD,wDAA0B;AAE1B,0DAAoE;AAEpE,iDAA+E;AAC/E,2DAAwD;AACxD,6DAA0D;AAE1D,KAAK,UAAU,uBAAuB,CACpC,KAAiB,EACjB,kBAA0B;IAE1B,IAAI,KAAK,KAAK,0BAAU,CAAC,YAAY,EAAE;QACrC,OAAO;KACR;IAED,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,IAAA,4CAA2B,EAAC,kBAAkB,CAAC,CAAC;QAEjF,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO;SACR;QAED,OAAO,MAAM,kBAAE,CAAC,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;KACvD;IAAC,OAAO,GAAQ,EAAE;QACjB,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAED,SAAS,YAAY,CACnB,aAAqC,EACrC,QAAkB,EAClB,YAA0B,EAC1B,cAAuB;IAEvB,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC;IACpC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,aAAa;SAC3B,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;SACvE,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CACV,CAAC,OAAO,CAAC,KAAK,KAAK,gCAAiB,IAAI,KAAK,KAAK,0BAAU,CAAC,YAAY,CAAC;QAC1E,OAAO,CAAC,KAAK,KAAK,KAA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,GACtB,CAAC,eAAe;QACf;YACC,sBAAM,CAAC,SAAS,CAAC,aAAa;YAC9B,sBAAM,CAAC,SAAS,CAAC,oBAAoB;YACrC,sBAAM,CAAC,SAAS,CAAC,sBAAsB;SAC3B,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IACrD,MAAM,OAAO,GACX,MAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,mCAAI,eAAe,CAAC,OAAO,CAAC;IAClG,MAAM,SAAS,GACb,MAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS,CAAC,mCACxE,eAAe,CAAC,SAAS,CAAC;IAE5B,OAAO,IAAI,sBAAM,CAAC,UAAU,CAAC,OAAO,EAAE;QACpC,SAAS;QACT,mBAAmB,EAAE,eAAe,CAAC,SAAS;QAC9C,iBAAiB,EAAE,eAAe,CAAC,OAAO;QAC1C,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;AACL,CAAC;AAvCD,kEAuCC","sourcesContent":["import { BuildPhase, errors } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\n\nimport { findXcodeBuildLogsPathAsync } from '../ios/xcodeBuildLogs';\n\nimport { ErrorContext, ErrorHandler, XCODE_BUILD_PHASE } from './errors.types';\nimport { userErrorHandlers } from './userErrorHandlers';\nimport { buildErrorHandlers } from './buildErrorHandlers';\n\nasync function maybeReadXcodeBuildLogs(\n phase: BuildPhase,\n buildLogsDirectory: string\n): Promise<string | undefined> {\n if (phase !== BuildPhase.RUN_FASTLANE) {\n return;\n }\n\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(buildLogsDirectory);\n\n if (!xcodeBuildLogsPath) {\n return;\n }\n\n return await fs.readFile(xcodeBuildLogsPath, 'utf-8');\n } catch (err: any) {\n return undefined;\n }\n}\n\nfunction resolveError<TError extends Error>(\n errorHandlers: ErrorHandler<TError>[],\n logLines: string[],\n errorContext: ErrorContext,\n xcodeBuildLogs?: string\n): TError | undefined {\n const { job, phase } = errorContext;\n const { platform } = job;\n const logs = logLines.join('\\n');\n const handlers = errorHandlers\n .filter((handler) => handler.platform === platform || !handler.platform)\n .filter(\n (handler) =>\n (handler.phase === XCODE_BUILD_PHASE && phase === BuildPhase.RUN_FASTLANE) ||\n handler.phase === phase ||\n !handler.phase\n );\n\n for (const handler of handlers) {\n const regexp =\n typeof handler.regexp === 'function' ? handler.regexp(errorContext) : handler.regexp;\n if (!regexp) {\n continue;\n }\n const match =\n handler.phase === XCODE_BUILD_PHASE ? xcodeBuildLogs?.match(regexp) : logs.match(regexp);\n\n if (match) {\n return handler.createError(match, errorContext);\n }\n }\n return undefined;\n}\n\nexport async function resolveBuildPhaseErrorAsync(\n error: any,\n logLines: string[],\n errorContext: ErrorContext,\n buildLogsDirectory: string\n): Promise<errors.BuildError> {\n const { phase } = errorContext;\n if (error instanceof errors.BuildError) {\n return error;\n }\n const xcodeBuildLogs = await maybeReadXcodeBuildLogs(phase, buildLogsDirectory);\n const userFacingError =\n error instanceof errors.UserFacingError\n ? error\n : resolveError(userErrorHandlers, logLines, errorContext, xcodeBuildLogs) ??\n new errors.UnknownError();\n const buildError = resolveError(buildErrorHandlers, logLines, errorContext, xcodeBuildLogs);\n\n const isUnknownUserError =\n !userFacingError ||\n ([\n errors.ErrorCode.UNKNOWN_ERROR,\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n ] as string[]).includes(userFacingError.errorCode);\n const message =\n (isUnknownUserError ? buildError?.message : userFacingError.message) ?? userFacingError.message;\n const errorCode =\n (isUnknownUserError ? buildError?.errorCode : userFacingError.errorCode) ??\n userFacingError.errorCode;\n\n return new errors.BuildError(message, {\n errorCode,\n userFacingErrorCode: userFacingError.errorCode,\n userFacingMessage: userFacingError.message,\n docsUrl: userFacingError.docsUrl,\n innerError: error,\n buildPhase: phase,\n });\n}\n"]}
@@ -4,9 +4,10 @@ export interface ErrorContext {
4
4
  job: Job;
5
5
  env: Env;
6
6
  }
7
+ export declare const XCODE_BUILD_PHASE = "XCODE_BUILD";
7
8
  export interface ErrorHandler<T extends Error> {
8
9
  regexp: RegExp | ((ctx: ErrorContext) => RegExp | undefined);
9
10
  platform?: Platform;
10
- phase?: BuildPhase;
11
+ phase?: BuildPhase | typeof XCODE_BUILD_PHASE;
11
12
  createError: (matchResult: RegExpMatchArray, errCtx: ErrorContext) => T | undefined;
12
13
  }
@@ -1,3 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.XCODE_BUILD_PHASE = void 0;
4
+ exports.XCODE_BUILD_PHASE = 'XCODE_BUILD';
3
5
  //# sourceMappingURL=errors.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.types.js","sourceRoot":"","sources":["../../src/buildErrors/errors.types.ts"],"names":[],"mappings":"","sourcesContent":["import { BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\n\nexport interface ErrorContext {\n phase: BuildPhase;\n job: Job;\n env: Env;\n}\n\nexport interface ErrorHandler<T extends Error> {\n regexp: RegExp | ((ctx: ErrorContext) => RegExp | undefined);\n platform?: Platform;\n phase?: BuildPhase;\n createError: (matchResult: RegExpMatchArray, errCtx: ErrorContext) => T | undefined;\n}\n"]}
1
+ {"version":3,"file":"errors.types.js","sourceRoot":"","sources":["../../src/buildErrors/errors.types.ts"],"names":[],"mappings":";;;AAQa,QAAA,iBAAiB,GAAG,aAAa,CAAC","sourcesContent":["import { BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\n\nexport interface ErrorContext {\n phase: BuildPhase;\n job: Job;\n env: Env;\n}\n\nexport const XCODE_BUILD_PHASE = 'XCODE_BUILD';\n\nexport interface ErrorHandler<T extends Error> {\n regexp: RegExp | ((ctx: ErrorContext) => RegExp | undefined);\n platform?: Platform;\n phase?: BuildPhase | typeof XCODE_BUILD_PHASE;\n createError: (matchResult: RegExpMatchArray, errCtx: ErrorContext) => T | undefined;\n}\n"]}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.userErrorHandlers = void 0;
4
4
  const eas_build_job_1 = require("@expo/eas-build-job");
5
+ const errors_types_1 = require("./errors.types");
5
6
  var UserFacingError = eas_build_job_1.errors.UserFacingError;
6
7
  exports.userErrorHandlers = [
7
8
  {
@@ -132,6 +133,29 @@ You are seeing this error because either:
132
133
  return undefined;
133
134
  },
134
135
  },
136
+ {
137
+ platform: eas_build_job_1.Platform.IOS,
138
+ phase: errors_types_1.XCODE_BUILD_PHASE,
139
+ // Prepare packages
140
+ // Computing target dependency graph and provisioning inputs
141
+ // Create build description
142
+ // Build description signature: 33a5c28977280822abe5e7bd7fe02529
143
+ // Build description path: /Users/expo/Library/Developer/Xcode/DerivedData/testapp-fazozgerxcvvfifkipojsjftgyih/Build/Intermediates.noindex/ArchiveIntermediates/testapp/IntermediateBuildFilesPath/XCBuildData/33a5c28977280822abe5e7bd7fe02529-desc.xcbuild
144
+ // note: Building targets in dependency order
145
+ // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for "EXConstants-EXConstants" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXConstants-EXConstants' from project 'Pods')
146
+ // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for "React-Core-AccessibilityResources" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'React-Core-AccessibilityResources' from project 'Pods')
147
+ // warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')
148
+ // warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'testapp' from project 'testapp')
149
+ // warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'testapp' from project 'testapp')
150
+ // warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
151
+ // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for "EXUpdates-EXUpdates" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXUpdates-EXUpdates' from project 'Pods')
152
+ regexp: /error: Signing for "[a-zA-Z-0-9_]+" requires a development team/,
153
+ createError: (_, { job }) => job.type === eas_build_job_1.Workflow.MANAGED
154
+ ? new UserFacingError('XCODE_CODE_SIGNING_ERROR', `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.
155
+ To resolve this issue, downgrade to an older Xcode version using the "image" field in eas.json, or upgrade to SDK 46 or higher.`, 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations')
156
+ : new UserFacingError('XCODE_CODE_SIGNING_ERROR', `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.
157
+ To resolve this issue, downgrade to an older Xcode version using the "image" field in eas.json, or turn off signing resource bundles in your Podfile: https://expo.fyi/r/disable-bundle-resource-signing`, 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'),
158
+ },
135
159
  {
136
160
  platform: eas_build_job_1.Platform.ANDROID,
137
161
  phase: eas_build_job_1.BuildPhase.RUN_GRADLEW,
@@ -1 +1 @@
1
- {"version":3,"file":"userErrorHand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,CAAC,SAAS,CAAC,sBAAsB,EACvC;kLAC0K,CAC3K;KACJ;CACF,CAAC","sourcesContent":["import { BuildPhase, errors, Platform, Workflow } from '@expo/eas-build-job';\n\nimport { ErrorHandler } from './errors.types';\n\nimport UserFacingError = errors.UserFacingError;\n\nexport const userErrorHandlers: ErrorHandler<UserFacingError>[] = [\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n regexp: /requires CocoaPods version/,\n // example log:\n // [!] `React` requires CocoaPods version `>= 1.10.1`, which is not satisfied by your current version, `1.10.0`.\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_COCOAPODS_VERSION_ERROR',\n `Your project requires a newer version of CocoaPods. You can update it in the build profile in eas.json by either:\n- changing the current version under key \"cocoapods\"\n- switching to an image that supports that version under key \"image\"`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /Could not find 'bundler' (.*) required by your/,\n // example log:\n // /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.3) required by your /Users/expo/project/build/ios/Gemfile.lock. (Gem::MissingSpecVersionError)\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_BUNDLER_VERSION_ERROR',\n `Your project requires a different version of the Ruby \"bundler\" program than the version installed in this EAS Build environment. You can specify which version of \"bundler\" to install by specifying the version under \"build\"→[buildProfileName]→\"ios\"→\"bundler\" in eas.json.`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-5787e6af-3002-4cb7-8a57-3e73d13313c2.jks\": Invalid keystore format\n regexp: /Invalid keystore format/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_FORMAT_ERROR',\n 'The keystore used in this build is malformed or it has an unsupported type. Make sure you provided the correct file.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-286069a8-4bb9-48a6-add9-acf6b58ea06d.jks\": null\n regexp: /Failed to read key[^\\n]+from store/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_ALIAS_ERROR',\n 'The alias specified for this keystore does not exist. Make sure you specified the correct value.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [15:42:05] Error: Cannot copy google-services.json from /build/workingdir/build/managed/abc to /build/workingdir/build/managed/android/app/google-services.json\n // or\n // [11:17:29] [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n // [11:17:29] Error: [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n regexp: /Cannot copy google-services\\.json/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that file exists. Remember that EAS Build only uploads the files tracked by git.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // Execution failed for task ':app:processReleaseGoogleServices'.\n // > File google-services.json is missing. The Google Services Plugin cannot function without it.\n // Searched Location:\n regexp: /File google-services\\.json is missing\\. The Google Services Plugin cannot function without it/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that file exists. Remember that EAS Build only uploads the files tracked by git.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [08:44:18] ENOENT: no such file or directory, copyfile '/Users/expo/workingdir/build/managed/abc' -> '/Users/expo/workingdir/build/managed/ios/testapp/GoogleService-Info.plist'\n regexp: /ENOENT: no such file or directory, copyfile .*GoogleService-Info.plist/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_PLIST_ERROR',\n '\"GoogleService-Info.plist\" is missing, make sure that file exists. Remember that EAS Build only uploads the files tracked by git.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"Firebase/Core\":\n // In snapshot (Podfile.lock):\n // Firebase/Core (= 6.14.0)\n // In Podfile:\n // EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on\n // Firebase/Core (= 7.7.0)\n // You have either:\n // * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.\n // * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.\n // You should run `pod update Firebase/Core` to apply changes you've made.\n regexp: /CocoaPods could not find compatible versions for pod /,\n createError: (_, { job }) => {\n const usingDefaultCacheConfig = job.cache.key === '' || !job.cache.key;\n return job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_MANAGED_WORKFLOW_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of some of the libraries. To fix that ${\n usingDefaultCacheConfig\n ? 'add the \"cache.key\" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.'\n : 'update value of the \"cache.key\" field in the build profile in eas.json to invalidate the cache.'\n }\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n`\n )\n : new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_GENERIC_WORKFLOW_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of some of the libraries. To fix that ${\n usingDefaultCacheConfig\n ? 'add the \"cache.key\" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.'\n : 'update value of the \"cache.key\" field in the build profile in eas.json to invalidate the cache.'\n }\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] error https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz: Integrity check failed for \"react-native\" (computed integrity doesn't match our records, got \"sha512-3jHI2YufrJi7eIABRf/DN/I2yOkmIZ0vAyezTz+PAUJiEs4v//5LLojWEU+W53AZsnuaEMcl/4fVy4bd+OuUbA== sha1-o9QuQTXIkc8VozXPaZIullB9a40=\")\n regexp: /Integrity check failed for \"(.*)\" \\(computed integrity doesn't match our records, got/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_LOCK_CHECKSUM_ERROR',\n `Checksum for package \"${matchResult[1]}\" does not match value in registry. To fix that:\n- run \"yarn cache clean\"\n- remove yarn.lock (or only the section for that package)\n- run \"yarn install --force\"`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // yarn install v1.22.17\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [stderr] error https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: \"ENOENT: no such file or directory, chmod '/Users/expo/Library/Caches/Yarn/v6/npm-jest-util-26.6.2-907535dbe4d5a6cb4c47ac9b926f6af29576cbc1-integrity/node_modules/jest-util/build/pluralize.d.ts'\"\n regexp: /\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages...\\s*\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages.../,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_MULTIPLE_INSTANCES_ERROR',\n `One of project dependencies is starting new install process while the main one is still in progress, which might result in corrupted packages. Most likely the reason for error is \"prepare\" script in git-referenced dependency of your project. Learn more: https://github.com/yarnpkg/yarn/issues/7212#issuecomment-493720324`\n );\n }\n return undefined;\n },\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n 'Gradle build failed with unknown error. See logs for the \"Run gradlew\" phase for more information.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n `Fastlane build failed with unknown error. See logs for the \"Run fastlane\" and \"Xcode Logs\" phases for more information.\nFastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.`\n ),\n },\n];\n"]}
1
+ {"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorHandlers.ts"],"names":[],"mappings":";;;AAAA,uDAA6E;AAE7E,iDAAiE;AAEjE,IAAO,eAAe,GAAG,sBAAM,CAAC,eAAe,CAAC;AAEnC,QAAA,iBAAiB,GAAoC;IAChE;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,4BAA4B;QACpC,eAAe;QACf,gHAAgH;QAChH,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,+CAA+C,EAC/C;;qEAE6D,EAC7D,iDAAiD,CAClD;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9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AAC,YAAY;QAC9B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,sBAAsB,EACvC;kLAC0K,CAC3K;KACJ;CACF,CAAC","sourcesContent":["import { BuildPhase, errors, Platform, Workflow } from '@expo/eas-build-job';\n\nimport { ErrorHandler, XCODE_BUILD_PHASE } from './errors.types';\n\nimport UserFacingError = errors.UserFacingError;\n\nexport const userErrorHandlers: ErrorHandler<UserFacingError>[] = [\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n regexp: /requires CocoaPods version/,\n // example log:\n // [!] `React` requires CocoaPods version `>= 1.10.1`, which is not satisfied by your current version, `1.10.0`.\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_COCOAPODS_VERSION_ERROR',\n `Your project requires a newer version of CocoaPods. You can update it in the build profile in eas.json by either:\n- changing the current version under key \"cocoapods\"\n- switching to an image that supports that version under key \"image\"`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /Could not find 'bundler' (.*) required by your/,\n // example log:\n // /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.2.3) required by your /Users/expo/project/build/ios/Gemfile.lock. (Gem::MissingSpecVersionError)\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_UNSUPPORTED_BUNDLER_VERSION_ERROR',\n `Your project requires a different version of the Ruby \"bundler\" program than the version installed in this EAS Build environment. You can specify which version of \"bundler\" to install by specifying the version under \"build\"→[buildProfileName]→\"ios\"→\"bundler\" in eas.json.`,\n 'https://docs.expo.dev/build-reference/eas-json/'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-5787e6af-3002-4cb7-8a57-3e73d13313c2.jks\": Invalid keystore format\n regexp: /Invalid keystore format/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_FORMAT_ERROR',\n 'The keystore used in this build is malformed or it has an unsupported type. Make sure you provided the correct file.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // example log:\n // > Failed to read key keyalias from store \"/build/workingdir/build/generic/keystore-286069a8-4bb9-48a6-add9-acf6b58ea06d.jks\": null\n regexp: /Failed to read key[^\\n]+from store/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_INVALID_KEYSTORE_ALIAS_ERROR',\n 'The alias specified for this keystore does not exist. Make sure you specified the correct value.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [15:42:05] Error: Cannot copy google-services.json from /build/workingdir/build/managed/abc to /build/workingdir/build/managed/android/app/google-services.json\n // or\n // [11:17:29] [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n // [11:17:29] Error: [android.dangerous]: withAndroidDangerousBaseMod: Cannot copy google-services.json from /home/expo/workingdir/build/test/test-google-services.json to /home/expo/workingdir/build/android/app/google-services.json. Please make sure the source and destination paths exist.\n regexp: /Cannot copy google-services\\.json/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that file exists. Remember that EAS Build only uploads the files tracked by git.'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n // Execution failed for task ':app:processReleaseGoogleServices'.\n // > File google-services.json is missing. The Google Services Plugin cannot function without it.\n // Searched Location:\n regexp: /File google-services\\.json is missing\\. The Google Services Plugin cannot function without it/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_JSON_ERROR',\n '\"google-services.json\" is missing, make sure that file exists. Remember that EAS Build only uploads the files tracked by git.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.PREBUILD,\n // example log:\n // [08:44:18] ENOENT: no such file or directory, copyfile '/Users/expo/workingdir/build/managed/abc' -> '/Users/expo/workingdir/build/managed/ios/testapp/GoogleService-Info.plist'\n regexp: /ENOENT: no such file or directory, copyfile .*GoogleService-Info.plist/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_MISSING_GOOGLE_SERVICES_PLIST_ERROR',\n '\"GoogleService-Info.plist\" is missing, make sure that file exists. Remember that EAS Build only uploads the files tracked by git.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"Firebase/Core\":\n // In snapshot (Podfile.lock):\n // Firebase/Core (= 6.14.0)\n // In Podfile:\n // EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 3.0.0, which depends on\n // Firebase/Core (= 7.7.0)\n // You have either:\n // * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.\n // * changed the constraints of dependency `Firebase/Core` inside your development pod `EXFirebaseCore`.\n // You should run `pod update Firebase/Core` to apply changes you've made.\n regexp: /CocoaPods could not find compatible versions for pod /,\n createError: (_, { job }) => {\n const usingDefaultCacheConfig = job.cache.key === '' || !job.cache.key;\n return job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_MANAGED_WORKFLOW_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of some of the libraries. To fix that ${\n usingDefaultCacheConfig\n ? 'add the \"cache.key\" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.'\n : 'update value of the \"cache.key\" field in the build profile in eas.json to invalidate the cache.'\n }\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n`\n )\n : new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_GENERIC_WORKFLOW_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of some of the libraries. To fix that ${\n usingDefaultCacheConfig\n ? 'add the \"cache.key\" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.'\n : 'update value of the \"cache.key\" field in the build profile in eas.json to invalidate the cache.'\n }\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] error https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz: Integrity check failed for \"react-native\" (computed integrity doesn't match our records, got \"sha512-3jHI2YufrJi7eIABRf/DN/I2yOkmIZ0vAyezTz+PAUJiEs4v//5LLojWEU+W53AZsnuaEMcl/4fVy4bd+OuUbA== sha1-o9QuQTXIkc8VozXPaZIullB9a40=\")\n regexp: /Integrity check failed for \"(.*)\" \\(computed integrity doesn't match our records, got/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_LOCK_CHECKSUM_ERROR',\n `Checksum for package \"${matchResult[1]}\" does not match value in registry. To fix that:\n- run \"yarn cache clean\"\n- remove yarn.lock (or only the section for that package)\n- run \"yarn install --force\"`\n );\n }\n return undefined;\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // yarn install v1.22.17\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [1/4] Resolving packages...\n // [2/4] Fetching packages...\n // [stderr] error https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: \"ENOENT: no such file or directory, chmod '/Users/expo/Library/Caches/Yarn/v6/npm-jest-util-26.6.2-907535dbe4d5a6cb4c47ac9b926f6af29576cbc1-integrity/node_modules/jest-util/build/pluralize.d.ts'\"\n regexp: /\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages...\\s*\\[1\\/4\\] Resolving packages...\\s*\\[2\\/4\\] Fetching packages.../,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult) {\n return new UserFacingError(\n 'EAS_BUILD_YARN_MULTIPLE_INSTANCES_ERROR',\n `One of project dependencies is starting new install process while the main one is still in progress, which might result in corrupted packages. Most likely the reason for error is \"prepare\" script in git-referenced dependency of your project. Learn more: https://github.com/yarnpkg/yarn/issues/7212#issuecomment-493720324`\n );\n }\n return undefined;\n },\n },\n {\n platform: Platform.IOS,\n phase: XCODE_BUILD_PHASE,\n // Prepare packages\n // Computing target dependency graph and provisioning inputs\n // Create build description\n // Build description signature: 33a5c28977280822abe5e7bd7fe02529\n // Build description path: /Users/expo/Library/Developer/Xcode/DerivedData/testapp-fazozgerxcvvfifkipojsjftgyih/Build/Intermediates.noindex/ArchiveIntermediates/testapp/IntermediateBuildFilesPath/XCBuildData/33a5c28977280822abe5e7bd7fe02529-desc.xcbuild\n // note: Building targets in dependency order\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXConstants-EXConstants\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXConstants-EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"React-Core-AccessibilityResources\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'React-Core-AccessibilityResources' from project 'Pods')\n // warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXUpdates' from project 'Pods')\n // warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'testapp' from project 'testapp')\n // warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking \"Based on dependency analysis\" in the script phase. (in target 'EXConstants' from project 'Pods')\n // /Users/expo/workingdir/build/managed/ios/Pods/Pods.xcodeproj: error: Signing for \"EXUpdates-EXUpdates\" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'EXUpdates-EXUpdates' from project 'Pods')\n regexp: /error: Signing for \"[a-zA-Z-0-9_]+\" requires a development team/,\n createError: (_, { job }) =>\n job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'XCODE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or upgrade to SDK 46 or higher.`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n )\n : new UserFacingError(\n 'XCODE_CODE_SIGNING_ERROR',\n `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.\nTo resolve this issue, downgrade to an older Xcode version using the \"image\" field in eas.json, or turn off signing resource bundles in your Podfile: https://expo.fyi/r/disable-bundle-resource-signing`,\n 'https://docs.expo.dev/build-reference/infrastructure/#ios-build-server-configurations'\n ),\n },\n {\n platform: Platform.ANDROID,\n phase: BuildPhase.RUN_GRADLEW,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n 'Gradle build failed with unknown error. See logs for the \"Run gradlew\" phase for more information.'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n `Fastlane build failed with unknown error. See logs for the \"Run fastlane\" and \"Xcode Logs\" phases for more information.\nFastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.`\n ),\n },\n];\n"]}
package/dist/context.d.ts CHANGED
@@ -78,7 +78,7 @@ export declare class BuildContext<TJob extends Job> {
78
78
  markBuildPhaseSkipped(): void;
79
79
  markBuildPhaseHasWarnings(): void;
80
80
  uploadArtifacts(type: ArtifactType, paths: string[], logger?: bunyan): Promise<void>;
81
- private handleBuildPhaseError;
81
+ private handleBuildPhaseErrorAsync;
82
82
  private setBuildPhase;
83
83
  private endCurrentBuildPhase;
84
84
  private getEnvironmentSecrets;
package/dist/context.js CHANGED
@@ -76,7 +76,7 @@ class BuildContext {
76
76
  return result;
77
77
  }
78
78
  catch (err) {
79
- const resolvedError = this.handleBuildPhaseError(err, buildPhase);
79
+ const resolvedError = await this.handleBuildPhaseErrorAsync(err, buildPhase);
80
80
  this.endCurrentBuildPhase({ result: eas_build_job_1.BuildPhaseResult.FAIL });
81
81
  throw resolvedError;
82
82
  }
@@ -93,12 +93,12 @@ class BuildContext {
93
93
  this.artifacts[type] = url;
94
94
  }
95
95
  }
96
- handleBuildPhaseError(err, buildPhase) {
97
- const buildError = (0, detectError_1.resolveBuildPhaseError)(err, this.logBuffer.getPhaseLogs(buildPhase), {
96
+ async handleBuildPhaseErrorAsync(err, buildPhase) {
97
+ const buildError = await (0, detectError_1.resolveBuildPhaseErrorAsync)(err, this.logBuffer.getPhaseLogs(buildPhase), {
98
98
  job: this.job,
99
99
  phase: buildPhase,
100
100
  env: this.env,
101
- });
101
+ }, this.buildLogsDirectory);
102
102
  if (buildError.errorCode === eas_build_job_1.errors.ErrorCode.UNKNOWN_ERROR) {
103
103
  // leaving message empty, website will display err.stack which already includes err.message
104
104
  this.logger.error({ err }, '');
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"m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cAAc,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;SAC5F;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;IACrC,CAAC;IAEO,qBAAqB,CAAC,GAAS;;QACrC,IAAI,CAAC,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,kBAAkB,CAAA,EAAE;YACrC,OAAO,EAAE,CAAC;SACX;QAED,MAAM,kBAAkB,GAA2B,EAAE,CAAC;QACtD,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE;YAClE,IAAI,IAAI,KAAK,qCAAqB,CAAC,MAAM,EAAE;gBACzC,kBAAkB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;aAClC;iBAAM;gBACL,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAA,yDAAoC,EAC7D,IAAI,CAAC,4BAA4B,EACjC,KAAK,CACN,CAAC;aACH;SACF;QACD,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AAjMD,oCAiMC","sourcesContent":["import path from 'path';\n\nimport {\n BuildPhase,\n BuildPhaseResult,\n Job,\n LogMarker,\n Env,\n errors,\n Metadata,\n EnvironmentSecretType,\n} from '@expo/eas-build-job';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { SpawnPromise, SpawnOptions, SpawnResult } from '@expo/turtle-spawn';\n\nimport { PackageManager, resolvePackageManager } from './utils/packageManager';\nimport { resolveBuildPhaseError } from './buildErrors/detectError';\nimport { readAppConfig } from './utils/appConfig';\nimport { createTemporaryEnvironmentSecretFile } from './utils/environmentSecrets';\n\nexport enum ArtifactType {\n APPLICATION_ARCHIVE = 'APPLICATION_ARCHIVE',\n BUILD_ARTIFACTS = 'BUILD_ARTIFACTS',\n /**\n * @deprecated\n */\n XCODE_BUILD_LOGS = 'XCODE_BUILD_LOGS',\n}\n\nexport type Artifacts = Partial<Record<ArtifactType, string>>;\n\nexport interface CacheManager {\n saveCache(ctx: BuildContext<Job>): Promise<void>;\n restoreCache(ctx: BuildContext<Job>): Promise<void>;\n}\n\nexport interface LogBuffer {\n getLogs(): string[];\n getPhaseLogs(buildPhase: string): string[];\n}\n\nexport interface BuildContextOptions {\n workingdir: string;\n logger: bunyan;\n logBuffer: LogBuffer;\n env: Env;\n cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n runGlobalExpoCliCommand: (args: string, options: SpawnOptions) => SpawnPromise<SpawnResult>;\n uploadArtifacts: (type: ArtifactType, paths: string[], logger?: bunyan) => Promise<string | null>;\n reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n skipNativeBuild?: boolean;\n metadata?: Metadata;\n}\n\nexport class SkipNativeBuildError extends Error {}\n\nexport class BuildContext<TJob extends Job> {\n public readonly workingdir: string;\n public logger: bunyan;\n public readonly logBuffer: LogBuffer;\n public readonly env: Env;\n public readonly cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n public readonly runGlobalExpoCliCommand: (\n args: string,\n options: SpawnOptions\n ) => SpawnPromise<SpawnResult>;\n public readonly reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n public readonly metadata?: Metadata;\n public readonly skipNativeBuild?: boolean;\n public artifacts: Artifacts = {};\n\n private readonly defaultLogger: bunyan;\n private readonly _uploadArtifacts: (\n type: ArtifactType,\n paths: string[],\n logger?: bunyan\n ) => Promise<string | null>;\n private buildPhase?: BuildPhase;\n private buildPhaseSkipped = false;\n private buildPhaseHasWarnings = false;\n private _appConfig?: ExpoConfig;\n\n constructor(public readonly job: TJob, options: BuildContextOptions) {\n this.workingdir = options.workingdir;\n this.defaultLogger = options.logger;\n this.logger = this.defaultLogger;\n this.logBuffer = options.logBuffer;\n this.cacheManager = options.cacheManager;\n this.runGlobalExpoCliCommand = options.runGlobalExpoCliCommand;\n this._uploadArtifacts = options.uploadArtifacts;\n this.reportError = options.reportError;\n this.metadata = options.metadata;\n this.skipNativeBuild = options.skipNativeBuild;\n\n const environmentSecrets = this.getEnvironmentSecrets(job);\n this.env = {\n ...options.env,\n ...job?.builderEnvironment?.env,\n ...environmentSecrets,\n };\n }\n\n public get buildDirectory(): string {\n return path.join(this.workingdir, 'build');\n }\n public get buildLogsDirectory(): string {\n return path.join(this.workingdir, 'logs');\n }\n public get environmentSecrectsDirectory(): string {\n return path.join(this.workingdir, 'environment-secrets');\n }\n public get reactNativeProjectDirectory(): string {\n return path.join(this.buildDirectory, this.job.projectRootDirectory);\n }\n public get packageManager(): PackageManager {\n return resolvePackageManager(this.reactNativeProjectDirectory);\n }\n public get appConfig(): ExpoConfig {\n if (!this._appConfig) {\n this._appConfig = readAppConfig(this.reactNativeProjectDirectory, this.env, this.logger).exp;\n }\n return this._appConfig;\n }\n\n public async runBuildPhase<T>(\n buildPhase: BuildPhase,\n phase: () => Promise<T>,\n {\n doNotMarkStart = false,\n doNotMarkEnd = false,\n }: {\n doNotMarkStart?: boolean;\n doNotMarkEnd?: boolean;\n } = {}\n ): Promise<T> {\n try {\n this.setBuildPhase(buildPhase, { doNotMarkStart });\n const result = await phase();\n const buildPhaseResult: BuildPhaseResult = this.buildPhaseSkipped\n ? BuildPhaseResult.SKIPPED\n : this.buildPhaseHasWarnings\n ? BuildPhaseResult.WARNING\n : BuildPhaseResult.SUCCESS;\n this.endCurrentBuildPhase({ result: buildPhaseResult, doNotMarkEnd });\n return result;\n } catch (err: any) {\n const resolvedError = this.handleBuildPhaseError(err, buildPhase);\n this.endCurrentBuildPhase({ result: BuildPhaseResult.FAIL });\n throw resolvedError;\n }\n }\n\n public markBuildPhaseSkipped(): void {\n this.buildPhaseSkipped = true;\n }\n\n public markBuildPhaseHasWarnings(): void {\n this.buildPhaseHasWarnings = true;\n }\n\n public async uploadArtifacts(\n type: ArtifactType,\n paths: string[],\n logger?: bunyan\n ): Promise<void> {\n const url = await this._uploadArtifacts(type, paths, logger);\n if (url) {\n this.artifacts[type] = url;\n }\n }\n\n private handleBuildPhaseError(err: any, buildPhase: BuildPhase): errors.BuildError {\n const buildError = resolveBuildPhaseError(err, this.logBuffer.getPhaseLogs(buildPhase), {\n job: this.job,\n phase: buildPhase,\n env: this.env,\n });\n if (buildError.errorCode === errors.ErrorCode.UNKNOWN_ERROR) {\n // leaving message empty, website will display err.stack which already includes err.message\n this.logger.error({ err }, '');\n } else {\n this.logger.error(`Error: ${buildError.userFacingMessage}`);\n }\n return buildError;\n }\n\n private setBuildPhase(buildPhase: BuildPhase, { doNotMarkStart = false } = {}): void {\n if (this.buildPhase) {\n if (this.buildPhase === buildPhase) {\n return;\n } else {\n this.logger.info(\n { marker: LogMarker.END_PHASE, result: BuildPhaseResult.UNKNOWN },\n `End phase: ${this.buildPhase}`\n );\n this.logger = this.defaultLogger;\n }\n }\n this.buildPhase = buildPhase;\n this.logger = this.defaultLogger.child({ phase: buildPhase });\n if (!doNotMarkStart) {\n this.logger.info({ marker: LogMarker.START_PHASE }, `Start phase: ${this.buildPhase}`);\n }\n }\n\n private endCurrentBuildPhase({\n result,\n doNotMarkEnd = false,\n }: {\n result: BuildPhaseResult;\n doNotMarkEnd?: boolean;\n }): void {\n if (!this.buildPhase) {\n return;\n }\n if (!doNotMarkEnd) {\n this.logger.info({ marker: LogMarker.END_PHASE, result }, `End phase: ${this.buildPhase}`);\n }\n this.logger = this.defaultLogger;\n this.buildPhase = undefined;\n this.buildPhaseSkipped = false;\n this.buildPhaseHasWarnings = false;\n }\n\n private getEnvironmentSecrets(job: TJob): Record<string, string> {\n if (!job?.secrets?.environmentSecrets) {\n return {};\n }\n\n const environmentSecrets: Record<string, string> = {};\n for (const { name, type, value } of job.secrets.environmentSecrets) {\n if (type === EnvironmentSecretType.STRING) {\n environmentSecrets[name] = value;\n } else {\n environmentSecrets[name] = createTemporaryEnvironmentSecretFile(\n this.environmentSecrectsDirectory,\n value\n );\n }\n }\n return environmentSecrets;\n }\n}\n"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAS6B;AAK7B,2DAA+E;AAC/E,2DAAwE;AACxE,iDAAkD;AAClD,mEAAkF;AAElF,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,2DAA2C,CAAA;IAC3C,mDAAmC,CAAA;IACnC;;OAEG;IACH,qDAAqC,CAAA;AACvC,CAAC,EAPW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAOvB;AAkCD,MAAa,oBAAqB,SAAQ,KAAK;CAAG;AAAlD,oDAAkD;AAElD,MAAa,YAAY;IAiCvB,YAA4B,GAAS,EAAE,OAA4B;;QAAvC,QAAG,GAAH,GAAG,CAAM;QAb9B,cAAS,GAAc,EAAE,CAAC;QASzB,sBAAiB,GAAG,KAAK,CAAC;QAC1B,0BAAqB,GAAG,KAAK,CAAC;QAIpC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC;QAC/D,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;Q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xF;IACH,CAAC;IAEO,oBAAoB,CAAC,EAC3B,MAAM,EACN,YAAY,GAAG,KAAK,GAIrB;QACC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO;SACR;QACD,IAAI,CAAC,YAAY,EAAE;YACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,yBAAS,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;SAC5F;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;IACrC,CAAC;IAEO,qBAAqB,CAAC,GAAS;;QACrC,IAAI,CAAC,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,0CAAE,kBAAkB,CAAA,EAAE;YACrC,OAAO,EAAE,CAAC;SACX;QAED,MAAM,kBAAkB,GAA2B,EAAE,CAAC;QACtD,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE;YAClE,IAAI,IAAI,KAAK,qCAAqB,CAAC,MAAM,EAAE;gBACzC,kBAAkB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;aAClC;iBAAM;gBACL,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAA,yDAAoC,EAC7D,IAAI,CAAC,4BAA4B,EACjC,KAAK,CACN,CAAC;aACH;SACF;QACD,OAAO,kBAAkB,CAAC;IAC5B,CAAC;CACF;AAzMD,oCAyMC","sourcesContent":["import path from 'path';\n\nimport {\n BuildPhase,\n BuildPhaseResult,\n Job,\n LogMarker,\n Env,\n errors,\n Metadata,\n EnvironmentSecretType,\n} from '@expo/eas-build-job';\nimport { ExpoConfig } from '@expo/config';\nimport { bunyan } from '@expo/logger';\nimport { SpawnPromise, SpawnOptions, SpawnResult } from '@expo/turtle-spawn';\n\nimport { PackageManager, resolvePackageManager } from './utils/packageManager';\nimport { resolveBuildPhaseErrorAsync } from './buildErrors/detectError';\nimport { readAppConfig } from './utils/appConfig';\nimport { createTemporaryEnvironmentSecretFile } from './utils/environmentSecrets';\n\nexport enum ArtifactType {\n APPLICATION_ARCHIVE = 'APPLICATION_ARCHIVE',\n BUILD_ARTIFACTS = 'BUILD_ARTIFACTS',\n /**\n * @deprecated\n */\n XCODE_BUILD_LOGS = 'XCODE_BUILD_LOGS',\n}\n\nexport type Artifacts = Partial<Record<ArtifactType, string>>;\n\nexport interface CacheManager {\n saveCache(ctx: BuildContext<Job>): Promise<void>;\n restoreCache(ctx: BuildContext<Job>): Promise<void>;\n}\n\nexport interface LogBuffer {\n getLogs(): string[];\n getPhaseLogs(buildPhase: string): string[];\n}\n\nexport interface BuildContextOptions {\n workingdir: string;\n logger: bunyan;\n logBuffer: LogBuffer;\n env: Env;\n cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n runGlobalExpoCliCommand: (args: string, options: SpawnOptions) => SpawnPromise<SpawnResult>;\n uploadArtifacts: (type: ArtifactType, paths: string[], logger?: bunyan) => Promise<string | null>;\n reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n skipNativeBuild?: boolean;\n metadata?: Metadata;\n}\n\nexport class SkipNativeBuildError extends Error {}\n\nexport class BuildContext<TJob extends Job> {\n public readonly workingdir: string;\n public logger: bunyan;\n public readonly logBuffer: LogBuffer;\n public readonly env: Env;\n public readonly cacheManager?: CacheManager;\n /**\n * @deprecated\n */\n public readonly runGlobalExpoCliCommand: (\n args: string,\n options: SpawnOptions\n ) => SpawnPromise<SpawnResult>;\n public readonly reportError?: (\n msg: string,\n err?: Error,\n options?: { tags?: Record<string, string>; extras?: Record<string, string> }\n ) => void;\n public readonly metadata?: Metadata;\n public readonly skipNativeBuild?: boolean;\n public artifacts: Artifacts = {};\n\n private readonly defaultLogger: bunyan;\n private readonly _uploadArtifacts: (\n type: ArtifactType,\n paths: string[],\n logger?: bunyan\n ) => Promise<string | null>;\n private buildPhase?: BuildPhase;\n private buildPhaseSkipped = false;\n private buildPhaseHasWarnings = false;\n private _appConfig?: ExpoConfig;\n\n constructor(public readonly job: TJob, options: BuildContextOptions) {\n this.workingdir = options.workingdir;\n this.defaultLogger = options.logger;\n this.logger = this.defaultLogger;\n this.logBuffer = options.logBuffer;\n this.cacheManager = options.cacheManager;\n this.runGlobalExpoCliCommand = options.runGlobalExpoCliCommand;\n this._uploadArtifacts = options.uploadArtifacts;\n this.reportError = options.reportError;\n this.metadata = options.metadata;\n this.skipNativeBuild = options.skipNativeBuild;\n\n const environmentSecrets = this.getEnvironmentSecrets(job);\n this.env = {\n ...options.env,\n ...job?.builderEnvironment?.env,\n ...environmentSecrets,\n };\n }\n\n public get buildDirectory(): string {\n return path.join(this.workingdir, 'build');\n }\n public get buildLogsDirectory(): string {\n return path.join(this.workingdir, 'logs');\n }\n public get environmentSecrectsDirectory(): string {\n return path.join(this.workingdir, 'environment-secrets');\n }\n public get reactNativeProjectDirectory(): string {\n return path.join(this.buildDirectory, this.job.projectRootDirectory);\n }\n public get packageManager(): PackageManager {\n return resolvePackageManager(this.reactNativeProjectDirectory);\n }\n public get appConfig(): ExpoConfig {\n if (!this._appConfig) {\n this._appConfig = readAppConfig(this.reactNativeProjectDirectory, this.env, this.logger).exp;\n }\n return this._appConfig;\n }\n\n public async runBuildPhase<T>(\n buildPhase: BuildPhase,\n phase: () => Promise<T>,\n {\n doNotMarkStart = false,\n doNotMarkEnd = false,\n }: {\n doNotMarkStart?: boolean;\n doNotMarkEnd?: boolean;\n } = {}\n ): Promise<T> {\n try {\n this.setBuildPhase(buildPhase, { doNotMarkStart });\n const result = await phase();\n const buildPhaseResult: BuildPhaseResult = this.buildPhaseSkipped\n ? BuildPhaseResult.SKIPPED\n : this.buildPhaseHasWarnings\n ? BuildPhaseResult.WARNING\n : BuildPhaseResult.SUCCESS;\n this.endCurrentBuildPhase({ result: buildPhaseResult, doNotMarkEnd });\n return result;\n } catch (err: any) {\n const resolvedError = await this.handleBuildPhaseErrorAsync(err, buildPhase);\n this.endCurrentBuildPhase({ result: BuildPhaseResult.FAIL });\n throw resolvedError;\n }\n }\n\n public markBuildPhaseSkipped(): void {\n this.buildPhaseSkipped = true;\n }\n\n public markBuildPhaseHasWarnings(): void {\n this.buildPhaseHasWarnings = true;\n }\n\n public async uploadArtifacts(\n type: ArtifactType,\n paths: string[],\n logger?: bunyan\n ): Promise<void> {\n const url = await this._uploadArtifacts(type, paths, logger);\n if (url) {\n this.artifacts[type] = url;\n }\n }\n\n private async handleBuildPhaseErrorAsync(\n err: any,\n buildPhase: BuildPhase\n ): Promise<errors.BuildError> {\n const buildError = await resolveBuildPhaseErrorAsync(\n err,\n this.logBuffer.getPhaseLogs(buildPhase),\n {\n job: this.job,\n phase: buildPhase,\n env: this.env,\n },\n this.buildLogsDirectory\n );\n if (buildError.errorCode === errors.ErrorCode.UNKNOWN_ERROR) {\n // leaving message empty, website will display err.stack which already includes err.message\n this.logger.error({ err }, '');\n } else {\n this.logger.error(`Error: ${buildError.userFacingMessage}`);\n }\n return buildError;\n }\n\n private setBuildPhase(buildPhase: BuildPhase, { doNotMarkStart = false } = {}): void {\n if (this.buildPhase) {\n if (this.buildPhase === buildPhase) {\n return;\n } else {\n this.logger.info(\n { marker: LogMarker.END_PHASE, result: BuildPhaseResult.UNKNOWN },\n `End phase: ${this.buildPhase}`\n );\n this.logger = this.defaultLogger;\n }\n }\n this.buildPhase = buildPhase;\n this.logger = this.defaultLogger.child({ phase: buildPhase });\n if (!doNotMarkStart) {\n this.logger.info({ marker: LogMarker.START_PHASE }, `Start phase: ${this.buildPhase}`);\n }\n }\n\n private endCurrentBuildPhase({\n result,\n doNotMarkEnd = false,\n }: {\n result: BuildPhaseResult;\n doNotMarkEnd?: boolean;\n }): void {\n if (!this.buildPhase) {\n return;\n }\n if (!doNotMarkEnd) {\n this.logger.info({ marker: LogMarker.END_PHASE, result }, `End phase: ${this.buildPhase}`);\n }\n this.logger = this.defaultLogger;\n this.buildPhase = undefined;\n this.buildPhaseSkipped = false;\n this.buildPhaseHasWarnings = false;\n }\n\n private getEnvironmentSecrets(job: TJob): Record<string, string> {\n if (!job?.secrets?.environmentSecrets) {\n return {};\n }\n\n const environmentSecrets: Record<string, string> = {};\n for (const { name, type, value } of job.secrets.environmentSecrets) {\n if (type === EnvironmentSecretType.STRING) {\n environmentSecrets[name] = value;\n } else {\n environmentSecrets[name] = createTemporaryEnvironmentSecretFile(\n this.environmentSecrectsDirectory,\n value\n );\n }\n }\n return environmentSecrets;\n }\n}\n"]}
package/dist/ios/pod.js CHANGED
@@ -5,25 +5,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.installPods = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
- const fs_extra_1 = __importDefault(require("fs-extra"));
9
8
  const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
10
9
  async function installPods(ctx) {
11
10
  const iosDir = path_1.default.join(ctx.reactNativeProjectDirectory, 'ios');
12
- if (ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL) {
13
- const podfilePath = path_1.default.join(iosDir, 'Podfile');
14
- const originalPodfileContents = await fs_extra_1.default.readFile(podfilePath, 'utf-8');
15
- const cocoaPodsCdnSourceRegex = /\bsource\s*\(?['"]https:\/\/cdn\.cocoapods\.org\/?['"]\)?/g;
16
- if (originalPodfileContents.search(cocoaPodsCdnSourceRegex) !== -1) {
17
- await fs_extra_1.default.writeFile(podfilePath, originalPodfileContents.replace(cocoaPodsCdnSourceRegex, `source "${ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL}"`));
18
- }
19
- else {
20
- await fs_extra_1.default.writeFile(podfilePath, `source "${ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL}"\n${originalPodfileContents}`);
21
- }
22
- }
23
11
  await (0, turtle_spawn_1.default)('pod', ['install'], {
24
12
  cwd: iosDir,
25
13
  logger: ctx.logger,
26
- env: Object.assign(Object.assign({}, ctx.env), { LANG: 'en_US.UTF-8' }),
14
+ env: Object.assign(Object.assign(Object.assign({}, ctx.env), { LANG: 'en_US.UTF-8' }), (ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL
15
+ ? { NEXUS_COCOAPODS_REPO_URL: ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL }
16
+ : {})),
27
17
  lineTransformer: (line) => {
28
18
  if (!line ||
29
19
  /\[!\] '[\w-]+' uses the unencrypted 'http' protocol to transfer the Pod\./.exec(line)) {
@@ -1 +1 @@
1
- {"version":3,"file":"pod.js","sourceRoot":"","sources":["../../src/ios/pod.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAE1B,sEAAuC;AAIhC,KAAK,UAAU,WAAW,CAAuB,GAAuB;IAC7E,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAEjE,IAAI,GAAG,CAAC,GAAG,CAAC,6BAA6B,EAAE;QACzC,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QACjD,MAAM,uBAAuB,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAExE,MAAM,uBAAuB,GAAG,4DAA4D,CAAC;QAE7F,IAAI,uBAAuB,CAAC,MAAM,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,EAAE;YAClE,MAAM,kBAAE,CAAC,SAAS,CAChB,WAAW,EACX,uBAAuB,CAAC,OAAO,CAC7B,uBAAuB,EACvB,WAAW,GAAG,CAAC,GAAG,CAAC,6BAA6B,GAAG,CACpD,CACF,CAAC;SACH;aAAM;YACL,MAAM,kBAAE,CAAC,SAAS,CAChB,WAAW,EACX,WAAW,GAAG,CAAC,GAAG,CAAC,6BAA6B,MAAM,uBAAuB,EAAE,CAChF,CAAC;SACH;KACF;IAED,MAAM,IAAA,sBAAK,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;QAC9B,GAAG,EAAE,MAAM;QACX,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,kCAAO,GAAG,CAAC,GAAG,KAAE,IAAI,EAAE,aAAa,GAAE;QACxC,eAAe,EAAE,CAAC,IAAa,EAAE,EAAE;YACjC,IACE,CAAC,IAAI;gBACL,2EAA2E,CAAC,IAAI,CAAC,IAAI,CAAC,EACtF;gBACA,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,OAAO,IAAI,CAAC;aACb;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAxCD,kCAwCC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport { Ios } from '@expo/eas-build-job';\nimport spawn from '@expo/turtle-spawn';\n\nimport { BuildContext } from '../context';\n\nexport async function installPods<TJob extends Ios.Job>(ctx: BuildContext<TJob>): Promise<void> {\n const iosDir = path.join(ctx.reactNativeProjectDirectory, 'ios');\n\n if (ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL) {\n const podfilePath = path.join(iosDir, 'Podfile');\n const originalPodfileContents = await fs.readFile(podfilePath, 'utf-8');\n\n const cocoaPodsCdnSourceRegex = /\\bsource\\s*\\(?['\"]https:\\/\\/cdn\\.cocoapods\\.org\\/?['\"]\\)?/g;\n\n if (originalPodfileContents.search(cocoaPodsCdnSourceRegex) !== -1) {\n await fs.writeFile(\n podfilePath,\n originalPodfileContents.replace(\n cocoaPodsCdnSourceRegex,\n `source \"${ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL}\"`\n )\n );\n } else {\n await fs.writeFile(\n podfilePath,\n `source \"${ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL}\"\\n${originalPodfileContents}`\n );\n }\n }\n\n await spawn('pod', ['install'], {\n cwd: iosDir,\n logger: ctx.logger,\n env: { ...ctx.env, LANG: 'en_US.UTF-8' },\n lineTransformer: (line?: string) => {\n if (\n !line ||\n /\\[!\\] '[\\w-]+' uses the unencrypted 'http' protocol to transfer the Pod\\./.exec(line)\n ) {\n return null;\n } else {\n return line;\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"pod.js","sourceRoot":"","sources":["../../src/ios/pod.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,sEAAuC;AAIhC,KAAK,UAAU,WAAW,CAAuB,GAAuB;IAC7E,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAEjE,MAAM,IAAA,sBAAK,EAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE;QAC9B,GAAG,EAAE,MAAM;QACX,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,GAAG,gDACE,GAAG,CAAC,GAAG,KACV,IAAI,EAAE,aAAa,KAChB,CAAC,GAAG,CAAC,GAAG,CAAC,6BAA6B;YACvC,CAAC,CAAC,EAAE,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,6BAA6B,EAAE;YACrE,CAAC,CAAC,EAAE,CAAC,CACR;QACD,eAAe,EAAE,CAAC,IAAa,EAAE,EAAE;YACjC,IACE,CAAC,IAAI;gBACL,2EAA2E,CAAC,IAAI,CAAC,IAAI,CAAC,EACtF;gBACA,OAAO,IAAI,CAAC;aACb;iBAAM;gBACL,OAAO,IAAI,CAAC;aACb;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAxBD,kCAwBC","sourcesContent":["import path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport spawn from '@expo/turtle-spawn';\n\nimport { BuildContext } from '../context';\n\nexport async function installPods<TJob extends Ios.Job>(ctx: BuildContext<TJob>): Promise<void> {\n const iosDir = path.join(ctx.reactNativeProjectDirectory, 'ios');\n\n await spawn('pod', ['install'], {\n cwd: iosDir,\n logger: ctx.logger,\n env: {\n ...ctx.env,\n LANG: 'en_US.UTF-8',\n ...(ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL\n ? { NEXUS_COCOAPODS_REPO_URL: ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL }\n : {}),\n },\n lineTransformer: (line?: string) => {\n if (\n !line ||\n /\\[!\\] '[\\w-]+' uses the unencrypted 'http' protocol to transfer the Pod\\./.exec(line)\n ) {\n return null;\n } else {\n return line;\n }\n },\n });\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  import { Ios } from '@expo/eas-build-job';
2
2
  import { BuildContext } from '../context';
3
3
  export declare function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void>;
4
+ export declare function findXcodeBuildLogsPathAsync(buildLogsDirectory: string): Promise<string | undefined>;
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.findAndUploadXcodeBuildLogsAsync = void 0;
6
+ exports.findXcodeBuildLogsPathAsync = exports.findAndUploadXcodeBuildLogsAsync = void 0;
7
7
  const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const fast_glob_1 = __importDefault(require("fast-glob"));
10
10
  const context_1 = require("../context");
11
11
  async function findAndUploadXcodeBuildLogsAsync(ctx) {
12
12
  try {
13
- const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx);
13
+ const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);
14
14
  if (xcodeBuildLogsPath) {
15
15
  await ctx.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);
16
16
  }
@@ -20,13 +20,14 @@ async function findAndUploadXcodeBuildLogsAsync(ctx) {
20
20
  }
21
21
  }
22
22
  exports.findAndUploadXcodeBuildLogsAsync = findAndUploadXcodeBuildLogsAsync;
23
- async function findXcodeBuildLogsPathAsync(ctx) {
23
+ async function findXcodeBuildLogsPathAsync(buildLogsDirectory) {
24
24
  var _a, _b;
25
- const customLogPaths = (await (0, fast_glob_1.default)('*.log', { cwd: ctx.buildLogsDirectory })).map((filename) => path_1.default.join(ctx.buildLogsDirectory, filename));
25
+ const customLogPaths = (await (0, fast_glob_1.default)('*.log', { cwd: buildLogsDirectory })).map((filename) => path_1.default.join(buildLogsDirectory, filename));
26
26
  if (customLogPaths[0]) {
27
27
  return customLogPaths[0];
28
28
  }
29
29
  const fallbackLogPaths = (await (0, fast_glob_1.default)('Library/Logs/gym/*.log', { cwd: os_1.default.homedir() })).map((relativePath) => path_1.default.join(os_1.default.homedir(), relativePath));
30
30
  return (_b = (_a = customLogPaths[0]) !== null && _a !== void 0 ? _a : fallbackLogPaths[0]) !== null && _b !== void 0 ? _b : undefined;
31
31
  }
32
+ exports.findXcodeBuildLogsPathAsync = findXcodeBuildLogsPathAsync;
32
33
  //# sourceMappingURL=xcodeBuildLogs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xcodeBuildLogs.js","sourceRoot":"","sources":["../../src/ios/xcodeBuildLogs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,0DAA2B;AAE3B,wCAAwD;AAEjD,KAAK,UAAU,gCAAgC,CAAC,GAA0B;IAC/E,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,2BAA2B,CAAC,GAAG,CAAC,CAAC;QAClE,IAAI,kBAAkB,EAAE;YACtB,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;SAC5F;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,CAAC,CAAC;KAChE;AACH,CAAC;AATD,4EASC;AAED,KAAK,UAAU,2BAA2B,CACxC,GAA0B;;IAE1B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC3F,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAC5C,CAAC;IACF,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;KAC1B;IACD,MAAM,gBAAgB,GAAG,CACvB,MAAM,IAAA,mBAAE,EAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAC1D,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;IAE/D,OAAO,MAAA,MAAA,cAAc,CAAC,CAAC,CAAC,mCAAI,gBAAgB,CAAC,CAAC,CAAC,mCAAI,SAAS,CAAC;AAC/D,CAAC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fg from 'fast-glob';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx);\n if (xcodeBuildLogsPath) {\n await ctx.uploadArtifacts(ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);\n }\n } catch (err: any) {\n ctx.logger.debug({ err }, 'Failed to upload Xcode build logs');\n }\n}\n\nasync function findXcodeBuildLogsPathAsync(\n ctx: BuildContext<Ios.Job>\n): Promise<string | undefined> {\n const customLogPaths = (await fg('*.log', { cwd: ctx.buildLogsDirectory })).map((filename) =>\n path.join(ctx.buildLogsDirectory, filename)\n );\n if (customLogPaths[0]) {\n return customLogPaths[0];\n }\n const fallbackLogPaths = (\n await fg('Library/Logs/gym/*.log', { cwd: os.homedir() })\n ).map((relativePath) => path.join(os.homedir(), relativePath));\n\n return customLogPaths[0] ?? fallbackLogPaths[0] ?? undefined;\n}\n"]}
1
+ {"version":3,"file":"xcodeBuildLogs.js","sourceRoot":"","sources":["../../src/ios/xcodeBuildLogs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,0DAA2B;AAE3B,wCAAwD;AAEjD,KAAK,UAAU,gCAAgC,CAAC,GAA0B;IAC/E,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,2BAA2B,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACrF,IAAI,kBAAkB,EAAE;YACtB,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;SAC5F;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,CAAC,CAAC;KAChE;AACH,CAAC;AATD,4EASC;AAEM,KAAK,UAAU,2BAA2B,CAC/C,kBAA0B;;IAE1B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACvF,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;KAC1B;IACD,MAAM,gBAAgB,GAAG,CACvB,MAAM,IAAA,mBAAE,EAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAC1D,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;IAE/D,OAAO,MAAA,MAAA,cAAc,CAAC,CAAC,CAAC,mCAAI,gBAAgB,CAAC,CAAC,CAAC,mCAAI,SAAS,CAAC;AAC/D,CAAC;AAdD,kEAcC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fg from 'fast-glob';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);\n if (xcodeBuildLogsPath) {\n await ctx.uploadArtifacts(ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);\n }\n } catch (err: any) {\n ctx.logger.debug({ err }, 'Failed to upload Xcode build logs');\n }\n}\n\nexport async function findXcodeBuildLogsPathAsync(\n buildLogsDirectory: string\n): Promise<string | undefined> {\n const customLogPaths = (await fg('*.log', { cwd: buildLogsDirectory })).map((filename) =>\n path.join(buildLogsDirectory, filename)\n );\n if (customLogPaths[0]) {\n return customLogPaths[0];\n }\n const fallbackLogPaths = (\n await fg('Library/Logs/gym/*.log', { cwd: os.homedir() })\n ).map((relativePath) => path.join(os.homedir(), relativePath));\n\n return customLogPaths[0] ?? fallbackLogPaths[0] ?? undefined;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "0.1.152",
3
+ "version": "0.1.154",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  "@expo/config": "7.0.1",
23
23
  "@expo/config-plugins": "5.0.1",
24
24
  "@expo/downloader": "0.0.21",
25
- "@expo/eas-build-job": "0.2.93",
25
+ "@expo/eas-build-job": "0.2.94",
26
26
  "@expo/logger": "0.0.24",
27
27
  "@expo/package-manager": "0.0.54",
28
28
  "@expo/plist": "^0.0.11",