@expo/build-tools 1.0.91 → 1.0.92
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/android/expoUpdates.d.ts +3 -3
- package/dist/android/expoUpdates.js.map +1 -1
- package/dist/buildErrors/detectError.js +2 -2
- package/dist/buildErrors/detectError.js.map +1 -1
- package/dist/buildErrors/errors.types.d.ts +2 -2
- package/dist/buildErrors/errors.types.js.map +1 -1
- package/dist/buildErrors/userErrorHandlers.js +2 -2
- package/dist/buildErrors/userErrorHandlers.js.map +1 -1
- package/dist/builders/common.d.ts +2 -2
- package/dist/builders/common.js.map +1 -1
- package/dist/builders/custom.js +10 -6
- package/dist/builders/custom.js.map +1 -1
- package/dist/common/easBuildInternal.d.ts +3 -3
- package/dist/common/easBuildInternal.js +1 -1
- package/dist/common/easBuildInternal.js.map +1 -1
- package/dist/common/prebuild.d.ts +2 -2
- package/dist/common/prebuild.js.map +1 -1
- package/dist/common/setup.d.ts +2 -2
- package/dist/common/setup.js.map +1 -1
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -1
- package/dist/customBuildContext.d.ts +6 -5
- package/dist/customBuildContext.js +12 -0
- package/dist/customBuildContext.js.map +1 -1
- package/dist/ios/expoUpdates.d.ts +3 -3
- package/dist/ios/expoUpdates.js.map +1 -1
- package/dist/steps/easFunctionGroups.js +5 -1
- package/dist/steps/easFunctionGroups.js.map +1 -1
- package/dist/steps/easFunctions.js +10 -5
- package/dist/steps/easFunctions.js.map +1 -1
- package/dist/steps/functionGroups/build.d.ts +2 -1
- package/dist/steps/functionGroups/build.js +6 -5
- package/dist/steps/functionGroups/build.js.map +1 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.d.ts +2 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +11 -3
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +1 -1
- package/dist/steps/functions/configureEASUpdateIfInstalled.js +1 -0
- package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +1 -1
- package/dist/steps/functions/findAndUploadBuildArtifacts.d.ts +2 -1
- package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +1 -1
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.d.ts +2 -1
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js.map +1 -1
- package/dist/steps/functions/prebuild.js +1 -0
- package/dist/steps/functions/prebuild.js.map +1 -1
- package/dist/steps/functions/resolveBuildConfig.d.ts +3 -2
- package/dist/steps/functions/resolveBuildConfig.js.map +1 -1
- package/dist/steps/utils/expoUpdates.d.ts +2 -2
- package/dist/steps/utils/expoUpdates.js.map +1 -1
- package/dist/utils/artifacts.d.ts +2 -2
- package/dist/utils/artifacts.js.map +1 -1
- package/dist/utils/expoUpdates.d.ts +6 -6
- package/dist/utils/expoUpdates.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Job } from '@expo/eas-build-job';
|
|
1
|
+
import { BuildJob, Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildContext } from '../context';
|
|
3
3
|
export declare enum AndroidMetadataName {
|
|
4
4
|
UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = "expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY",
|
|
@@ -6,8 +6,8 @@ export declare enum AndroidMetadataName {
|
|
|
6
6
|
RUNTIME_VERSION = "expo.modules.updates.EXPO_RUNTIME_VERSION"
|
|
7
7
|
}
|
|
8
8
|
export declare function androidSetRuntimeVersionNativelyAsync(ctx: BuildContext<Job>, runtimeVersion: string): Promise<void>;
|
|
9
|
-
export declare function androidSetChannelNativelyAsync(ctx: BuildContext<
|
|
9
|
+
export declare function androidSetChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void>;
|
|
10
10
|
export declare function androidGetNativelyDefinedChannelAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
11
|
-
export declare function androidSetClassicReleaseChannelNativelyAsync(ctx: BuildContext<
|
|
11
|
+
export declare function androidSetClassicReleaseChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void>;
|
|
12
12
|
export declare function androidGetNativelyDefinedClassicReleaseChannelAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
13
13
|
export declare function androidGetNativelyDefinedRuntimeVersionAsync(ctx: BuildContext<Job>): Promise<string | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/android/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,wDAA0B;AAC1B,yDAA0D;AAK1D,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,mIAA4G,CAAA;IAC5G,oFAA6D,CAAA;IAC7D,oFAA6D,CAAA;AAC/D,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAEM,KAAK,UAAU,qCAAqC,CACzD,GAAsB,EACtB,cAAsB;IAEtB,MAAM,YAAY,GAAG,MAAM,8BAAa,CAAC,KAAK,CAAC,uBAAuB,CACpE,GAAG,CAAC,8BAA8B,EAAE,CACrC,CAAC;IAEF,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,qCAAqC,YAAY,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,8BAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;IAC5F,MAAM,OAAO,GAAG,8BAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,eAAe,CAAC,CAAC;IAClF,8BAAa,CAAC,QAAQ,CAAC,gCAAgC,CACrD,OAAO,EACP,mBAAmB,CAAC,eAAe,EACnC,cAAc,EACd,OAAO,CACR,CAAC;IACF,MAAM,8BAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC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A8B,EAAE,CACrC,CAAC;IACF,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,8BAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;IAC5F,OAAO,8BAAa,CAAC,QAAQ,CAAC,+BAA+B,CAC3D,eAAe,EACf,mBAAmB,CAAC,eAAe,CACpC,CAAC;AACJ,CAAC;AAfD,kHAeC;AAEM,KAAK,UAAU,4CAA4C,CAChE,GAAsB;IAEtB,MAAM,YAAY,GAAG,MAAM,8BAAa,CAAC,KAAK,CAAC,uBAAuB,CACpE,GAAG,CAAC,8BAA8B,EAAE,CACrC,CAAC;IACF,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,8BAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC;IAC5F,OAAO,8BAAa,CAAC,QAAQ,CAAC,+BAA+B,CAC3D,eAAe,EACf,mBAAmB,CAAC,eAAe,CACpC,CAAC;AACJ,CAAC;AAfD,oGAeC","sourcesContent":["import assert from 'assert';\n\nimport fs from 'fs-extra';\nimport { AndroidConfig, XML } from '@expo/config-plugins';\nimport { Job } from '@expo/eas-build-job';\n\nimport { BuildContext } from '../context';\n\nexport enum AndroidMetadataName {\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY',\n RELEASE_CHANNEL = 'expo.modules.updates.EXPO_RELEASE_CHANNEL',\n RUNTIME_VERSION = 'expo.modules.updates.EXPO_RUNTIME_VERSION',\n}\n\nexport async function androidSetRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(`Couldn't find Android manifest at ${manifestPath}`);\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const mainApp = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);\n AndroidConfig.Manifest.addMetaDataItemToMainApplication(\n mainApp,\n AndroidMetadataName.RUNTIME_VERSION,\n runtimeVersion,\n 'value'\n );\n await AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);\n}\n\nexport async function androidSetChannelNativelyAsync(ctx: BuildContext<Job>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(`Couldn't find Android manifest at ${manifestPath}`);\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const mainApp = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);\n const stringifiedUpdatesRequestHeaders = AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY\n );\n AndroidConfig.Manifest.addMetaDataItemToMainApplication(\n mainApp,\n AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY,\n JSON.stringify({\n ...JSON.parse(stringifiedUpdatesRequestHeaders ?? '{}'),\n 'expo-channel-name': ctx.job.updates.channel,\n }),\n 'value'\n );\n await AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);\n}\n\nexport async function androidGetNativelyDefinedChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n\n if (!(await fs.pathExists(manifestPath))) {\n return null;\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const stringifiedUpdatesRequestHeaders = AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY\n );\n try {\n const updatesRequestHeaders = JSON.parse(stringifiedUpdatesRequestHeaders ?? '{}');\n return updatesRequestHeaders['expo-channel-name'] ?? null;\n } catch (err: any) {\n throw new Error(\n `Failed to parse ${AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY} from AndroidManifest.xml: ${err.message}`\n );\n }\n}\n\nexport async function androidSetClassicReleaseChannelNativelyAsync(\n ctx: BuildContext<Job>\n): Promise<void> {\n const { releaseChannel } = ctx.job;\n assert(releaseChannel, 'releaseChannel must be defined');\n const escapedReleaseChannel = XML.escapeAndroidString(releaseChannel);\n\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(`Couldn't find Android manifest at ${manifestPath}`);\n }\n\n // Store the release channel in a string resource to ensure it is interpreted as a string\n const stringResourcePath = await AndroidConfig.Strings.getProjectStringsXMLPathAsync(\n ctx.getReactNativeProjectDirectory()\n );\n const stringResourceObject = await AndroidConfig.Resources.readResourcesXMLAsync({\n path: stringResourcePath,\n });\n\n const resourceName = 'release_channel';\n const releaseChannelResourceItem = AndroidConfig.Resources.buildResourceItem({\n name: resourceName,\n value: escapedReleaseChannel,\n });\n const newStringResourceObject = AndroidConfig.Strings.setStringItem(\n [releaseChannelResourceItem],\n stringResourceObject\n );\n await XML.writeXMLAsync({ path: stringResourcePath, xml: newStringResourceObject });\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const mainApp = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);\n AndroidConfig.Manifest.addMetaDataItemToMainApplication(\n mainApp,\n AndroidMetadataName.RELEASE_CHANNEL,\n `@string/${resourceName}`,\n 'value'\n );\n await AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);\n}\n\nexport async function androidGetNativelyDefinedClassicReleaseChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (!(await fs.pathExists(manifestPath))) {\n return null;\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n return AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.RELEASE_CHANNEL\n );\n}\n\nexport async function androidGetNativelyDefinedRuntimeVersionAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (!(await fs.pathExists(manifestPath))) {\n return null;\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n return AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.RUNTIME_VERSION\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/android/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,wDAA0B;AAC1B,yDAA0D;AAK1D,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,mIAA4G,CAAA;IAC5G,oFAA6D,CAAA;IAC7D,oFAA6D,CAAA;AAC/D,CAAC,EAJW,mBAAmB,mCAAnB,mBAAmB,QAI9B;AAEM,KAAK,UAAU,qCAAqC,CACzD,GAAsB,EACtB,cAAsB;IAEtB,MAAM,YAAY,GAAG,MAAM,8BAAa,CAAC,KAAK,CAAC,uBAAuB,CACpE,GAAG,CAAC,8BAA8B,EAAE,CACrC,CAAC;IAE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Q,CAAC,+BAA+B,CAC3D,eAAe,EACf,mBAAmB,CAAC,eAAe,CACpC,CAAC;AACJ,CAAC;AAfD,oGAeC","sourcesContent":["import assert from 'assert';\n\nimport fs from 'fs-extra';\nimport { AndroidConfig, XML } from '@expo/config-plugins';\nimport { BuildJob, Job } from '@expo/eas-build-job';\n\nimport { BuildContext } from '../context';\n\nexport enum AndroidMetadataName {\n UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY = 'expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY',\n RELEASE_CHANNEL = 'expo.modules.updates.EXPO_RELEASE_CHANNEL',\n RUNTIME_VERSION = 'expo.modules.updates.EXPO_RUNTIME_VERSION',\n}\n\nexport async function androidSetRuntimeVersionNativelyAsync(\n ctx: BuildContext<Job>,\n runtimeVersion: string\n): Promise<void> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(`Couldn't find Android manifest at ${manifestPath}`);\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const mainApp = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);\n AndroidConfig.Manifest.addMetaDataItemToMainApplication(\n mainApp,\n AndroidMetadataName.RUNTIME_VERSION,\n runtimeVersion,\n 'value'\n );\n await AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);\n}\n\nexport async function androidSetChannelNativelyAsync(ctx: BuildContext<BuildJob>): Promise<void> {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(`Couldn't find Android manifest at ${manifestPath}`);\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const mainApp = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);\n const stringifiedUpdatesRequestHeaders = AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY\n );\n AndroidConfig.Manifest.addMetaDataItemToMainApplication(\n mainApp,\n AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY,\n JSON.stringify({\n ...JSON.parse(stringifiedUpdatesRequestHeaders ?? '{}'),\n 'expo-channel-name': ctx.job.updates.channel,\n }),\n 'value'\n );\n await AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);\n}\n\nexport async function androidGetNativelyDefinedChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n\n if (!(await fs.pathExists(manifestPath))) {\n return null;\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const stringifiedUpdatesRequestHeaders = AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY\n );\n try {\n const updatesRequestHeaders = JSON.parse(stringifiedUpdatesRequestHeaders ?? '{}');\n return updatesRequestHeaders['expo-channel-name'] ?? null;\n } catch (err: any) {\n throw new Error(\n `Failed to parse ${AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY} from AndroidManifest.xml: ${err.message}`\n );\n }\n}\n\nexport async function androidSetClassicReleaseChannelNativelyAsync(\n ctx: BuildContext<BuildJob>\n): Promise<void> {\n const { releaseChannel } = ctx.job;\n assert(releaseChannel, 'releaseChannel must be defined');\n const escapedReleaseChannel = XML.escapeAndroidString(releaseChannel);\n\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (!(await fs.pathExists(manifestPath))) {\n throw new Error(`Couldn't find Android manifest at ${manifestPath}`);\n }\n\n // Store the release channel in a string resource to ensure it is interpreted as a string\n const stringResourcePath = await AndroidConfig.Strings.getProjectStringsXMLPathAsync(\n ctx.getReactNativeProjectDirectory()\n );\n const stringResourceObject = await AndroidConfig.Resources.readResourcesXMLAsync({\n path: stringResourcePath,\n });\n\n const resourceName = 'release_channel';\n const releaseChannelResourceItem = AndroidConfig.Resources.buildResourceItem({\n name: resourceName,\n value: escapedReleaseChannel,\n });\n const newStringResourceObject = AndroidConfig.Strings.setStringItem(\n [releaseChannelResourceItem],\n stringResourceObject\n );\n await XML.writeXMLAsync({ path: stringResourcePath, xml: newStringResourceObject });\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n const mainApp = AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);\n AndroidConfig.Manifest.addMetaDataItemToMainApplication(\n mainApp,\n AndroidMetadataName.RELEASE_CHANNEL,\n `@string/${resourceName}`,\n 'value'\n );\n await AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);\n}\n\nexport async function androidGetNativelyDefinedClassicReleaseChannelAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (!(await fs.pathExists(manifestPath))) {\n return null;\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n return AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.RELEASE_CHANNEL\n );\n}\n\nexport async function androidGetNativelyDefinedRuntimeVersionAsync(\n ctx: BuildContext<Job>\n): Promise<string | null> {\n const manifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(\n ctx.getReactNativeProjectDirectory()\n );\n if (!(await fs.pathExists(manifestPath))) {\n return null;\n }\n\n const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);\n return AndroidConfig.Manifest.getMainApplicationMetaDataValue(\n androidManifest,\n AndroidMetadataName.RUNTIME_VERSION\n );\n}\n"]}
|
|
@@ -27,14 +27,14 @@ async function maybeReadXcodeBuildLogs(phase, buildLogsDirectory) {
|
|
|
27
27
|
}
|
|
28
28
|
function resolveError(errorHandlers, logLines, errorContext, xcodeBuildLogs) {
|
|
29
29
|
const { job, phase } = errorContext;
|
|
30
|
-
const { platform
|
|
30
|
+
const { platform } = job;
|
|
31
31
|
const logs = logLines.join('\n');
|
|
32
32
|
const handlers = errorHandlers
|
|
33
33
|
.filter((handler) => handler.platform === platform || !handler.platform)
|
|
34
34
|
.filter((handler) => (handler.phase === errors_types_1.XCODE_BUILD_PHASE && phase === eas_build_job_1.BuildPhase.RUN_FASTLANE) ||
|
|
35
35
|
handler.phase === phase ||
|
|
36
36
|
!handler.phase)
|
|
37
|
-
.filter((handler) => handler.mode === mode || !handler.mode);
|
|
37
|
+
.filter((handler) => ('mode' in job && handler.mode === job.mode) || !handler.mode);
|
|
38
38
|
for (const handler of handlers) {
|
|
39
39
|
const regexp = typeof handler.regexp === 'function' ? handler.regexp(errorContext) : handler.regexp;
|
|
40
40
|
if (!regexp) {
|
|
@@ -1 +1 @@
|
|
|
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,CAAC;QACtC,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,kBAAkB,GAAG,MAAM,IAAA,4CAA2B,EAAC,kBAAkB,CAAC,CAAC;QAEjF,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QAED,OAAO,MAAM,kBAAE,CAAC,QAAQ,CAAC,k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KAAK;KAClB,CAAC,CAAC;AACL,CAAC;AAzCD,kEAyCC","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 {\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 .filter((handler) => ('mode' in job && handler.mode === job.mode) || !handler.mode);\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(errorContext.phase);\n const buildError = resolveError(buildErrorHandlers, logLines, errorContext, xcodeBuildLogs);\n\n const isUnknownUserError =\n !userFacingError ||\n (\n [\n errors.ErrorCode.UNKNOWN_ERROR,\n errors.ErrorCode.UNKNOWN_GRADLE_ERROR,\n errors.ErrorCode.UNKNOWN_FASTLANE_ERROR,\n ] as string[]\n ).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,7 +1,7 @@
|
|
|
1
1
|
import { BuildMode, BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';
|
|
2
|
-
export interface ErrorContext {
|
|
2
|
+
export interface ErrorContext<TJob extends Job = Job> {
|
|
3
3
|
phase: BuildPhase;
|
|
4
|
-
job:
|
|
4
|
+
job: TJob;
|
|
5
5
|
env: Env;
|
|
6
6
|
}
|
|
7
7
|
export declare const XCODE_BUILD_PHASE = "XCODE_BUILD";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.types.js","sourceRoot":"","sources":["../../src/buildErrors/errors.types.ts"],"names":[],"mappings":";;;AAQa,QAAA,iBAAiB,GAAG,aAAa,CAAC","sourcesContent":["import { BuildMode, BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\n\nexport interface ErrorContext {\n phase: BuildPhase;\n job:
|
|
1
|
+
{"version":3,"file":"errors.types.js","sourceRoot":"","sources":["../../src/buildErrors/errors.types.ts"],"names":[],"mappings":";;;AAQa,QAAA,iBAAiB,GAAG,aAAa,CAAC","sourcesContent":["import { BuildMode, BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\n\nexport interface ErrorContext<TJob extends Job = Job> {\n phase: BuildPhase;\n job: TJob;\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 mode?: BuildMode;\n createError: (matchResult: RegExpMatchArray, errCtx: ErrorContext) => T | undefined;\n}\n"]}
|
|
@@ -79,7 +79,7 @@ exports.userErrorHandlers = [
|
|
|
79
79
|
regexp: /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,
|
|
80
80
|
createError: (_, { job }) => {
|
|
81
81
|
return new UserFacingError('EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR', `Some pods require a higher minimum deployment target.
|
|
82
|
-
${job.type === eas_build_job_1.Workflow.MANAGED
|
|
82
|
+
${'type' in job && job.type === eas_build_job_1.Workflow.MANAGED
|
|
83
83
|
? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'
|
|
84
84
|
: 'You need to manually update the minimum deployment target in your project to resolve this issue.'}
|
|
85
85
|
`);
|
|
@@ -174,7 +174,7 @@ You are seeing this error because either:
|
|
|
174
174
|
// 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')
|
|
175
175
|
// /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')
|
|
176
176
|
regexp: /error: Signing for "[a-zA-Z-0-9_]+" requires a development team/,
|
|
177
|
-
createError: (_, { job }) => job.type === eas_build_job_1.Workflow.MANAGED
|
|
177
|
+
createError: (_, { job }) => 'type' in job && job.type === eas_build_job_1.Workflow.MANAGED
|
|
178
178
|
? new UserFacingError('XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR', `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.
|
|
179
179
|
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')
|
|
180
180
|
: new UserFacingError('XCODE_RESOURCE_BUNDLE_CODE_SIGNING_ERROR', `Starting from Xcode 14, resource bundles are signed by default, which requires setting the development team for each resource bundle target.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorHandlers.ts"],"names":[],"mappings":";;;AAAA,uDAAwF;AAExF,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;QAC9B,MAAM,EAAE,gDAAgD;QACxD,eAAe;QACf,mPAAmP;QACnP,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,6CAA6C,EAC7C,iRA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6L,EAC7L,uFAAuF,CACxF;KACR;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,OAAO;QAC1B,KAAK,EAAE,0BAAU,CAAC,WAAW;QAC7B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,oBAAoB,EACrC,oGAAoG,CACrG;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,IAAI,EAAE,yBAAS,CAAC,MAAM;QACtB,MAAM,EAAE,+EAA+E;QACvF,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sDAAsD,EACtD,oLAAoL,CACrL;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,IAAI,EAAE,yBAAS,CAAC,MAAM;QACtB,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,6BAA6B,EAC9C,uDAAuD,CACxD;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,sBAAsB,EACvC,uHAAuH,CACxH;KACJ;CACF,CAAC","sourcesContent":["import { BuildMode, 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 the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\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:\n /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 the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\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 the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"react-native-google-maps\"\n // In Podfile:\n // react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)\n // Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.\n // Error: Compatible versions of some pods could not be resolved.\n regexp:\n /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,\n createError: (_, { job }) => {\n return new UserFacingError(\n 'EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR',\n `Some pods require a higher minimum deployment target.\n${\n job.type === Workflow.MANAGED\n ? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'\n : 'You need to manually update the minimum deployment target in your project to resolve this issue.'\n}\n`\n );\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: () => {\n return new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n - If you are caching Podfile.lock using \"cache\" field in eas.json, then versions there might not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with \"--clear-cache\" option, or select \"Clear cache and retry build\" on the build page.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] npm ERR! Fix the upstream dependency conflict, or retry\n // [stderr] npm ERR! this command with --force, or --legacy-peer-deps\n // [stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.\n regexp:\n /Fix the upstream dependency conflict, or retry.*\\s.*this command with --force, or --legacy-peer-deps/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_NPM_CONFLICTING_PEER_DEPENDENCIES',\n `Some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by \"npm install\". As a temporary workaround you can:\n- Add \".npmrc\" file with \"legacy-peer-deps=true\" and commit that to your repo.\n- Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.\n- Downgrade to older version of npm on EAS Build, by adding \"npm install -g npm@version\" in \"eas-build-pre-install\" script in package.json.`\n );\n }\n return undefined;\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:\n /\\[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_RESOURCE_BUNDLE_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_RESOURCE_BUNDLE_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 mode: BuildMode.RESIGN,\n regexp: /No provisioning profile for application: '(.+)' with bundle identifier '(.+)'/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_RESIGN_PROVISIONING_PROFILE_MISMATCH_ERROR',\n `The bundle identifier in provisioning profile used to resign the app does not match the bundle identifier of the app selected to be resigned. See logs above for more information.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n mode: BuildMode.RESIGN,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_RESIGN_ERROR,\n `The \"Run fastlane\" step failed with an unknown error.`\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 `The \"Run fastlane\" step failed with an unknown error. Refer to \"Xcode Logs\" below for additional, more detailed logs.`\n ),\n },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"userErrorHandlers.js","sourceRoot":"","sources":["../../src/buildErrors/userErrorHandlers.ts"],"names":[],"mappings":";;;AAAA,uDAAwF;AAExF,iDAAiE;AAEj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AChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,6BAA6B,EAC9C,uDAAuD,CACxD;KACJ;IACD;QACE,QAAQ,EAAE,wBAAQ,CAAC,GAAG;QACtB,KAAK,EAAE,0BAAU,CAAC,YAAY;QAC9B,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,GAAG,EAAE,CAChB,IAAI,eAAe,CACjB,sBAAM,CAAC,SAAS,CAAC,sBAAsB,EACvC,uHAAuH,CACxH;KACJ;CACF,CAAC","sourcesContent":["import { BuildMode, 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 the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\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:\n /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 the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\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 the file exists. Remember that EAS Build only uploads the files tracked by git. Use EAS secrets to provide EAS Build with the file.',\n 'https://docs.expo.dev/build-reference/variables/#how-to-upload-a-secret-file-and'\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.INSTALL_PODS,\n // example log:\n // [!] CocoaPods could not find compatible versions for pod \"react-native-google-maps\"\n // In Podfile:\n // react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)\n // Specs satisfying the `react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`)` dependency were found, but they required a higher minimum deployment target.\n // Error: Compatible versions of some pods could not be resolved.\n regexp:\n /Specs satisfying the `(.*)` dependency were found, but they required a higher minimum deployment target/,\n createError: (_, { job }) => {\n return new UserFacingError(\n 'EAS_BUILD_HIGHER_MINIMUM_DEPLOYMENT_TARGET_ERROR',\n `Some pods require a higher minimum deployment target.\n${\n 'type' in job && job.type === Workflow.MANAGED\n ? 'You can use the expo-build-properties config plugin (https://docs.expo.dev/versions/latest/sdk/build-properties/) to override the default native build properties and set a different minimum deployment target.'\n : 'You need to manually update the minimum deployment target in your project to resolve this issue.'\n}\n`\n );\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: () => {\n return new UserFacingError(\n 'EAS_BUILD_INCOMPATIBLE_PODS_ERROR',\n `Compatible versions of some pods could not be resolved.\nYou are seeing this error because either:\n - Some of the pods used in your project depend on different versions of the same pod. See logs for more information.\n - If you are caching Podfile.lock using \"cache\" field in eas.json, then versions there might not match required values in Podspecs of some installed libraries. To fix this, you can re-run build command with \"--clear-cache\" option, or select \"Clear cache and retry build\" on the build page.\n`\n );\n },\n },\n {\n phase: BuildPhase.INSTALL_DEPENDENCIES,\n // example log:\n // [stderr] npm ERR! Fix the upstream dependency conflict, or retry\n // [stderr] npm ERR! this command with --force, or --legacy-peer-deps\n // [stderr] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.\n regexp:\n /Fix the upstream dependency conflict, or retry.*\\s.*this command with --force, or --legacy-peer-deps/,\n createError: (matchResult: RegExpMatchArray) => {\n if (matchResult.length >= 2) {\n return new UserFacingError(\n 'EAS_BUILD_NPM_CONFLICTING_PEER_DEPENDENCIES',\n `Some of your peer dependencies are not compatible. The recommended approach is to fix your dependencies by resolving any conflicts listed by \"npm install\". As a temporary workaround you can:\n- Add \".npmrc\" file with \"legacy-peer-deps=true\" and commit that to your repo.\n- Delete package-lock.json and use yarn instead. It does not enforce peer dependencies.\n- Downgrade to older version of npm on EAS Build, by adding \"npm install -g npm@version\" in \"eas-build-pre-install\" script in package.json.`\n );\n }\n return undefined;\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:\n /\\[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 'type' in job && job.type === Workflow.MANAGED\n ? new UserFacingError(\n 'XCODE_RESOURCE_BUNDLE_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_RESOURCE_BUNDLE_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 mode: BuildMode.RESIGN,\n regexp: /No provisioning profile for application: '(.+)' with bundle identifier '(.+)'/,\n createError: () =>\n new UserFacingError(\n 'EAS_BUILD_RESIGN_PROVISIONING_PROFILE_MISMATCH_ERROR',\n `The bundle identifier in provisioning profile used to resign the app does not match the bundle identifier of the app selected to be resigned. See logs above for more information.`\n ),\n },\n {\n platform: Platform.IOS,\n phase: BuildPhase.RUN_FASTLANE,\n mode: BuildMode.RESIGN,\n regexp: /.*/,\n createError: () =>\n new UserFacingError(\n errors.ErrorCode.UNKNOWN_FASTLANE_RESIGN_ERROR,\n `The \"Run fastlane\" step failed with an unknown error.`\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 `The \"Run fastlane\" step failed with an unknown error. Refer to \"Xcode Logs\" below for additional, more detailed logs.`\n ),\n },\n];\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuildJob } from '@expo/eas-build-job';
|
|
2
2
|
import { Artifacts, BuildContext } from '../context';
|
|
3
|
-
export declare function runBuilderWithHooksAsync<T extends
|
|
3
|
+
export declare function runBuilderWithHooksAsync<T extends BuildJob>(ctx: BuildContext<T>, builderAsync: (ctx: BuildContext<T>) => Promise<void>): Promise<Artifacts>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/builders/common.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/builders/common.ts"],"names":[],"mappings":";;;AAAA,uDAA0E;AAG1E,0DAAyE;AACzE,kDAAsE;AACtE,0CAAwD;AAEjD,KAAK,UAAU,wBAAwB,CAC5C,GAAoB,EACpB,YAAqD;IAErD,IAAI,CAAC;QACH,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;YACxB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;gBACnE,MAAM,IAAA,w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AAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AAhDD,4DAgDC","sourcesContent":["import { BuildJob, BuildPhase, Ios, Platform } from '@expo/eas-build-job';\n\nimport { Artifacts, BuildContext } from '../context';\nimport { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';\nimport { maybeFindAndUploadBuildArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\n\nexport async function runBuilderWithHooksAsync<T extends BuildJob>(\n ctx: BuildContext<T>,\n builderAsync: (ctx: BuildContext<T>) => Promise<void>\n): Promise<Artifacts> {\n try {\n let buildSuccess = true;\n try {\n await builderAsync(ctx);\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_SUCCESS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_SUCCESS);\n });\n } catch (err: any) {\n buildSuccess = false;\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_ERROR_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_ERROR);\n });\n throw err;\n } finally {\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_COMPLETE_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_COMPLETE, {\n extraEnvs: {\n EAS_BUILD_STATUS: buildSuccess ? 'finished' : 'errored',\n },\n });\n });\n\n if (ctx.job.platform === Platform.IOS) {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>, {\n logger: ctx.logger,\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {\n await maybeFindAndUploadBuildArtifacts(ctx, {\n logger: ctx.logger,\n });\n });\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n\n return ctx.artifacts;\n}\n"]}
|
package/dist/builders/custom.js
CHANGED
|
@@ -19,12 +19,16 @@ async function runCustomBuildAsync(ctx) {
|
|
|
19
19
|
const customBuildCtx = new customBuildContext_1.CustomBuildContext(ctx);
|
|
20
20
|
await (0, projectSources_1.prepareProjectSourcesAsync)(ctx, customBuildCtx.projectSourceDirectory);
|
|
21
21
|
if (ctx.job.triggeredBy === eas_build_job_1.BuildTrigger.GIT_BASED_INTEGRATION) {
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
// TODO: Add support for resolving env from job profile.
|
|
23
|
+
// If platform is present, the job must be BuildJob
|
|
24
|
+
if (ctx.job.platform) {
|
|
25
|
+
// We need to setup envs from eas.json
|
|
26
|
+
const env = await (0, easBuildInternal_1.resolveEnvFromBuildProfileAsync)(ctx, {
|
|
27
|
+
cwd: customBuildCtx.projectSourceDirectory,
|
|
28
|
+
});
|
|
29
|
+
ctx.updateEnv(env);
|
|
30
|
+
customBuildCtx.updateEnv(ctx.env);
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
const relativeConfigPath = (0, nullthrows_1.default)((_a = ctx.job.customBuildConfig) === null || _a === void 0 ? void 0 : _a.path, 'Custom build config must be defined for custom builds');
|
|
30
34
|
const configPath = path_1.default.join(ctx.getReactNativeProjectDirectory(customBuildCtx.projectSourceDirectory), relativeConfigPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/builders/custom.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../src/builders/custom.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6F;AAC7F,uCAAgF;AAChF,4DAAoC;AAGpC,6DAAsE;AACtE,wDAAwD;AACxD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port { BuildJob, BuildPhase, BuildTrigger, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildConfigParser, BuildStepGlobalContext, errors } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, BuildContext } from '../context';\nimport { prepareProjectSourcesAsync } from '../common/projectSources';\nimport { getEasFunctions } from '../steps/easFunctions';\nimport { CustomBuildContext } from '../customBuildContext';\nimport { resolveEnvFromBuildProfileAsync } from '../common/easBuildInternal';\nimport { getEasFunctionGroups } from '../steps/easFunctionGroups';\nimport { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';\n\nexport async function runCustomBuildAsync<T extends Job>(ctx: BuildContext<T>): Promise<Artifacts> {\n const customBuildCtx = new CustomBuildContext(ctx);\n await prepareProjectSourcesAsync(ctx, customBuildCtx.projectSourceDirectory);\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n // TODO: Add support for resolving env from job profile.\n\n // If platform is present, the job must be BuildJob\n if (ctx.job.platform) {\n // We need to setup envs from eas.json\n const env = await resolveEnvFromBuildProfileAsync(ctx as BuildContext<BuildJob>, {\n cwd: customBuildCtx.projectSourceDirectory,\n });\n ctx.updateEnv(env);\n customBuildCtx.updateEnv(ctx.env);\n }\n }\n const relativeConfigPath = nullthrows(\n ctx.job.customBuildConfig?.path,\n 'Custom build config must be defined for custom builds'\n );\n const configPath = path.join(\n ctx.getReactNativeProjectDirectory(customBuildCtx.projectSourceDirectory),\n relativeConfigPath\n );\n\n const globalContext = new BuildStepGlobalContext(customBuildCtx, false);\n const easFunctions = getEasFunctions(customBuildCtx);\n const easFunctionGroups = getEasFunctionGroups(customBuildCtx);\n const parser = new BuildConfigParser(globalContext, {\n externalFunctions: easFunctions,\n externalFunctionGroups: easFunctionGroups,\n configPath,\n });\n const workflow = await ctx.runBuildPhase(BuildPhase.PARSE_CUSTOM_WORKFLOW_CONFIG, async () => {\n try {\n return await parser.parseAsync();\n } catch (parseError: any) {\n ctx.logger.error('Failed to parse the custom build config file.');\n if (parseError instanceof errors.BuildWorkflowError) {\n for (const err of parseError.errors) {\n ctx.logger.error({ err });\n }\n }\n throw parseError;\n }\n });\n try {\n try {\n await workflow.executeAsync();\n } finally {\n if (!ctx.artifacts.XCODE_BUILD_LOGS && ctx.job.platform === Platform.IOS) {\n try {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>, {\n logger: ctx.logger,\n });\n } catch {\n // do nothing, it's a non-breaking error.\n }\n }\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n return ctx.artifacts;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="bunyan" />
|
|
2
|
-
import {
|
|
2
|
+
import { BuildJob, Env, Metadata } from '@expo/eas-build-job';
|
|
3
3
|
import { bunyan } from '@expo/logger';
|
|
4
4
|
import { BuildStepEnv } from '@expo/steps';
|
|
5
5
|
import { BuildContext } from '../context';
|
|
6
|
-
export declare function runEasBuildInternalAsync<TJob extends
|
|
6
|
+
export declare function runEasBuildInternalAsync<TJob extends BuildJob>({ job, logger, env, cwd, }: {
|
|
7
7
|
job: TJob;
|
|
8
8
|
logger: bunyan;
|
|
9
9
|
env: BuildStepEnv;
|
|
@@ -12,6 +12,6 @@ export declare function runEasBuildInternalAsync<TJob extends Job>({ job, logger
|
|
|
12
12
|
newJob: TJob;
|
|
13
13
|
newMetadata: Metadata;
|
|
14
14
|
}>;
|
|
15
|
-
export declare function resolveEnvFromBuildProfileAsync<TJob extends
|
|
15
|
+
export declare function resolveEnvFromBuildProfileAsync<TJob extends BuildJob>(ctx: BuildContext<TJob>, { cwd }: {
|
|
16
16
|
cwd: string;
|
|
17
17
|
}): Promise<Env>;
|
|
@@ -123,7 +123,7 @@ function validateEasBuildInternalResult({ oldJob, result, }) {
|
|
|
123
123
|
if (error) {
|
|
124
124
|
throw error;
|
|
125
125
|
}
|
|
126
|
-
const newJob = (0, eas_build_job_1.
|
|
126
|
+
const newJob = (0, eas_build_job_1.sanitizeBuildJob)(value.job);
|
|
127
127
|
(0, assert_1.default)(newJob.platform === oldJob.platform, 'eas-cli returned a job for a wrong platform');
|
|
128
128
|
const newMetadata = (0, eas_build_job_1.sanitizeMetadata)(value.metadata);
|
|
129
129
|
return { newJob, newMetadata };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easBuildInternal.js","sourceRoot":"","sources":["../../src/common/easBuildInternal.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"easBuildInternal.js","sourceRoot":"","sources":["../../src/common/easBuildInternal.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAkG;AAClG,yCAAgD;AAChD,sEAAuC;AACvC,8CAAsB;AACtB,4DAAoC;AAIpC,4DAA6D;AAE7D,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAC3D,MAAM,0BAA0B,GAAG,kBAAkB,CAAC;AAEtD,MAAM,4BAA4B,GAAG,aAAG,CAAC,MAAM,CAAoC;IACjF,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC3B,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;CACjC,CAAC,CAAC;AAEI,KAAK,UAAU,wBAAwB,CAAwB,EACpE,GAAG,EACH,MAAM,EACN,GAAG,EACH,GAAG,GAMJ;IAIC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,kCAAkC,EAAE,CAAC;IAC3E,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,GAAG,CAAC;IACnD,IAAA,gBAAM,EAAC,YAAY,EAAE,iEAAiE,CAAC,CAAC;IAExF,MAAM,cAAc,GAAG,EAAE,CAAC;IAC1B,IAAI,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,aAAa,EAAE,CAAC;QACxC,cAAc,CAAC,I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AC;KACtD,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;QAClB,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,KAAK;KAClB,CAAC,CAAC;IACH,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC;AACpB,CAAC","sourcesContent":["import assert from 'assert';\n\nimport { BuildJob, Env, Metadata, sanitizeBuildJob, sanitizeMetadata } from '@expo/eas-build-job';\nimport { PipeMode, bunyan } from '@expo/logger';\nimport spawn from '@expo/turtle-spawn';\nimport Joi from 'joi';\nimport nullthrows from 'nullthrows';\nimport { BuildStepEnv } from '@expo/steps';\n\nimport { BuildContext } from '../context';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\n\nconst EAS_CLI_STAGING_NPM_TAG = 'latest-eas-build-staging';\nconst EAS_CLI_PRODUCTION_NPM_TAG = 'latest-eas-build';\n\nconst EasBuildInternalResultSchema = Joi.object<{ job: object; metadata: object }>({\n job: Joi.object().unknown(),\n metadata: Joi.object().unknown(),\n});\n\nexport async function runEasBuildInternalAsync<TJob extends BuildJob>({\n job,\n logger,\n env,\n cwd,\n}: {\n job: TJob;\n logger: bunyan;\n env: BuildStepEnv;\n cwd: string;\n}): Promise<{\n newJob: TJob;\n newMetadata: Metadata;\n}> {\n const { cmd, args, extraEnv } = await resolveEasCommandPrefixAndEnvAsync();\n const { buildProfile, githubTriggerOptions } = job;\n assert(buildProfile, 'build profile is missing in a build from git-based integration.');\n\n const autoSubmitArgs = [];\n if (githubTriggerOptions?.submitProfile) {\n autoSubmitArgs.push('--auto-submit-with-profile');\n autoSubmitArgs.push(githubTriggerOptions.submitProfile);\n } else if (githubTriggerOptions?.autoSubmit) {\n autoSubmitArgs.push('--auto-submit');\n }\n\n const result = await spawn(\n cmd,\n [\n ...args,\n 'build:internal',\n '--platform',\n job.platform,\n '--profile',\n buildProfile,\n ...autoSubmitArgs,\n ],\n {\n cwd,\n env: {\n ...env,\n EXPO_TOKEN: nullthrows(job.secrets, 'Secrets must be defined for non-custom builds')\n .robotAccessToken,\n ...extraEnv,\n },\n logger,\n mode: PipeMode.STDERR_ONLY_AS_STDOUT,\n }\n );\n const stdout = result.stdout.toString();\n const parsed = JSON.parse(stdout);\n return validateEasBuildInternalResult({\n result: parsed,\n oldJob: job,\n });\n}\n\nexport async function resolveEnvFromBuildProfileAsync<TJob extends BuildJob>(\n ctx: BuildContext<TJob>,\n { cwd }: { cwd: string }\n): Promise<Env> {\n const { cmd, args, extraEnv } = await resolveEasCommandPrefixAndEnvAsync();\n const { buildProfile } = ctx.job;\n assert(buildProfile, 'build profile is missing in a build from git-based integration.');\n let spawnResult;\n try {\n spawnResult = await spawn(\n cmd,\n [\n ...args,\n 'config',\n '--platform',\n ctx.job.platform,\n '--profile',\n buildProfile,\n '--non-interactive',\n '--json',\n '--eas-json-only',\n ],\n {\n cwd,\n env: { ...ctx.env, ...extraEnv },\n }\n );\n } catch (err: any) {\n ctx.logger.error(`Failed to the read build profile ${buildProfile} from eas.json.`);\n ctx.logger.error(err.stderr?.toString());\n throw Error(`Failed to read the build profile ${buildProfile} from eas.json.`);\n }\n const stdout = spawnResult.stdout.toString();\n const parsed = JSON.parse(stdout);\n const env = validateEnvs(parsed.buildProfile);\n return env;\n}\n\nasync function resolveEasCommandPrefixAndEnvAsync(): Promise<{\n cmd: string;\n args: string[];\n extraEnv: Env;\n}> {\n const npxArgsPrefix = (await isAtLeastNpm7Async()) ? ['-y'] : [];\n if (process.env.ENVIRONMENT === 'development') {\n return {\n cmd: process.env.EAS_BUILD_INTERNAL_EXECUTABLE ?? `eas`,\n args: [],\n extraEnv: { EXPO_LOCAL: '1' },\n };\n } else if (process.env.ENVIRONMENT === 'staging') {\n return {\n cmd: 'npx',\n args: [...npxArgsPrefix, `eas-cli@${EAS_CLI_STAGING_NPM_TAG}`],\n extraEnv: { EXPO_STAGING: '1' },\n };\n } else {\n return {\n cmd: 'npx',\n args: [...npxArgsPrefix, `eas-cli@${EAS_CLI_PRODUCTION_NPM_TAG}`],\n extraEnv: {},\n };\n }\n}\n\nfunction validateEasBuildInternalResult<TJob extends BuildJob>({\n oldJob,\n result,\n}: {\n oldJob: TJob;\n result: any;\n}): { newJob: TJob; newMetadata: Metadata } {\n const { value, error } = EasBuildInternalResultSchema.validate(result, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n if (error) {\n throw error;\n }\n const newJob = sanitizeBuildJob(value.job) as TJob;\n assert(newJob.platform === oldJob.platform, 'eas-cli returned a job for a wrong platform');\n const newMetadata = sanitizeMetadata(value.metadata);\n return { newJob, newMetadata };\n}\n\nfunction validateEnvs(result: any): Env {\n const { value, error } = Joi.object({\n env: Joi.object().pattern(Joi.string(), Joi.string()),\n }).validate(result, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n if (error) {\n throw error;\n }\n return value?.env;\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="bunyan" />
|
|
2
|
-
import {
|
|
2
|
+
import { BuildJob } from '@expo/eas-build-job';
|
|
3
3
|
import { bunyan } from '@expo/logger';
|
|
4
4
|
import { BuildContext } from '../context';
|
|
5
5
|
export interface PrebuildOptions {
|
|
6
6
|
extraEnvs?: Record<string, string>;
|
|
7
7
|
}
|
|
8
|
-
export declare function prebuildAsync<TJob extends
|
|
8
|
+
export declare function prebuildAsync<TJob extends BuildJob>(ctx: BuildContext<TJob>, { logger, workingDir, options }: {
|
|
9
9
|
logger: bunyan;
|
|
10
10
|
workingDir: string;
|
|
11
11
|
options?: PrebuildOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../src/common/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAI5B,4DAA6D;AAC7D,8CAA6E;AAE7E,+DAAqF;AAM9E,KAAK,UAAU,aA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AG,MAAM,CAAC;IAChC,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAClC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IACzC,IAAI,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACjD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9E,CAAC;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAClD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/E,CAAC;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACrD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAClF,CAAC;IACD,IAAI,CAAC,IAAA,gCAAsB,EAAC,GAAG,CAAC,EAAE,CAAC;QACjC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { BuildJob } from '@expo/eas-build-job';\nimport { SpawnOptions } from '@expo/turtle-spawn';\nimport semver from 'semver';\nimport { bunyan } from '@expo/logger';\n\nimport { BuildContext } from '../context';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { runExpoCliCommand, shouldUseGlobalExpoCli } from '../utils/project';\n\nimport { installDependenciesAsync, resolvePackagerDir } from './installDependencies';\n\nexport interface PrebuildOptions {\n extraEnvs?: Record<string, string>;\n}\n\nexport async function prebuildAsync<TJob extends BuildJob>(\n ctx: BuildContext<TJob>,\n { logger, workingDir, options }: { logger: bunyan; workingDir: string; options?: PrebuildOptions }\n): Promise<void> {\n const customExpoCliVersion = ctx.job.builderEnvironment?.expoCli;\n const shouldDisableSharp =\n !customExpoCliVersion || semver.satisfies(customExpoCliVersion, '>=5.4.4');\n\n const spawnOptions: SpawnOptions = {\n cwd: workingDir,\n logger,\n env: {\n ...(shouldDisableSharp ? { EXPO_IMAGE_UTILS_NO_SHARP: '1' } : {}),\n ...options?.extraEnvs,\n ...ctx.env,\n },\n };\n\n const prebuildCommandArgs = getPrebuildCommandArgs(ctx);\n await runExpoCliCommand(ctx, prebuildCommandArgs, spawnOptions, {\n npmVersionAtLeast7: await isAtLeastNpm7Async(),\n });\n const installDependenciesSpawnPromise = (\n await installDependenciesAsync(ctx, {\n logger,\n cwd: resolvePackagerDir(ctx),\n })\n ).spawnPromise;\n await installDependenciesSpawnPromise;\n}\n\nfunction getPrebuildCommandArgs<TJob extends BuildJob>(ctx: BuildContext<TJob>): string[] {\n let prebuildCommand =\n ctx.job.experimental?.prebuildCommand ??\n `prebuild --non-interactive --no-install --platform ${ctx.job.platform}`;\n if (!prebuildCommand.match(/(?:--platform| -p)/)) {\n prebuildCommand = `${prebuildCommand} --platform ${ctx.job.platform}`;\n }\n const npxCommandPrefix = 'npx ';\n const expoCommandPrefix = 'expo ';\n const expoCliCommandPrefix = 'expo-cli ';\n if (prebuildCommand.startsWith(npxCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(npxCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCliCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCliCommandPrefix.length).trim();\n }\n if (!shouldUseGlobalExpoCli(ctx)) {\n prebuildCommand = prebuildCommand.replace(' --non-interactive', '');\n }\n return prebuildCommand.split(' ');\n}\n"]}
|
package/dist/common/setup.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BuildJob } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildContext } from '../context';
|
|
3
|
-
export declare function setupAsync<TJob extends
|
|
3
|
+
export declare function setupAsync<TJob extends BuildJob>(ctx: BuildContext<TJob>): Promise<void>;
|
package/dist/common/setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/common/setup.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,sEAAsE;AACtE,wDAA0B;AAC1B,uDAAqE;AACrE,4DAA+D;AAC/D,4DAAoC;AAEpC,4DAAkE;AAGlE,8CAAmE;AACnE,0CAAwD;AACxD,0CAAiD;AACjD,4DAA6D;AAC7D,8CAA2E;AAC3E,kDAA4E;AAE5E,qDAA8D;AAC9D,+DAAqF;AACrF,yDAA+F;AAE/F,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,CAAC;AAC7C,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE5D,MAAM,kBAAmB,SAAQ,KAAK;CAAG;AACzC,MAAM,+BAAgC,SAAQ,KAAK;CAAG;AAE/C,KAAK,UAAU,UAAU,CAAmB,GAAuB;;IACxE,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,IAAA,2CAA0B,EAAC,GAAG,CAAC,CAAC;QACtC,MAAM,IAAA,uBAAe,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,gBAAgB,KAAK,WAAW,EAAE,CAAC;YAClF,MAAM,IAAA,2CAAgC,EAAC,GAA4B,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,GAAG,CAAC,GAAG,CAAC,WAAW,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AT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,GAAG,0CAAE,SAAS,CAAA,EAAE,CAAC;QAC7E,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,GAAG,CAAC,yBAAyB,EAAE,CAAC;IAClC,CAAC;AACH,CAAC","sourcesContent":["import path from 'path';\n\nimport spawn, { SpawnPromise, SpawnResult } from '@expo/turtle-spawn';\nimport fs from 'fs-extra';\nimport { BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildTrigger } from '@expo/eas-build-job/dist/common';\nimport nullthrows from 'nullthrows';\nimport { ExpoConfig } from '@expo/config';\nimport { UserFacingError } from '@expo/eas-build-job/dist/errors';\n\nimport { BuildContext } from '../context';\nimport { deleteXcodeEnvLocalIfExistsAsync } from '../ios/xcodeEnv';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { setUpNpmrcAsync } from '../utils/npmrc';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { readPackageJson, shouldUseGlobalExpoCli } from '../utils/project';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nimport { prepareProjectSourcesAsync } from './projectSources';\nimport { installDependenciesAsync, resolvePackagerDir } from './installDependencies';\nimport { resolveEnvFromBuildProfileAsync, runEasBuildInternalAsync } from './easBuildInternal';\n\nconst MAX_EXPO_DOCTOR_TIMEOUT_MS = 30 * 1000;\nconst INSTALL_DEPENDENCIES_WARN_TIMEOUT_MS = 15 * 60 * 1000;\nconst INSTALL_DEPENDENCIES_KILL_TIMEOUT_MS = 30 * 60 * 1000;\n\nclass DoctorTimeoutError extends Error {}\nclass InstallDependenciesTimeoutError extends Error {}\n\nexport async function setupAsync<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void> {\n await ctx.runBuildPhase(BuildPhase.PREPARE_PROJECT, async () => {\n await prepareProjectSourcesAsync(ctx);\n await setUpNpmrcAsync(ctx, ctx.logger);\n if (ctx.job.platform === Platform.IOS && ctx.env.EAS_BUILD_RUNNER === 'eas-build') {\n await deleteXcodeEnvLocalIfExistsAsync(ctx as BuildContext<Ios.Job>);\n }\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n // We need to setup envs from eas.json before\n // eas-build-pre-install hook is called.\n const env = await resolveEnvFromBuildProfileAsync(ctx, {\n cwd: ctx.getReactNativeProjectDirectory(),\n });\n ctx.updateEnv(env);\n }\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_INSTALL);\n });\n\n const packageJson = await ctx.runBuildPhase(BuildPhase.READ_PACKAGE_JSON, async () => {\n ctx.logger.info('Using package.json:');\n const packageJson = readPackageJson(ctx.getReactNativeProjectDirectory());\n ctx.logger.info(JSON.stringify(packageJson, null, 2));\n return packageJson;\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_DEPENDENCIES, async () => {\n await runInstallDependenciesAsync(ctx);\n });\n\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n await ctx.runBuildPhase(BuildPhase.EAS_BUILD_INTERNAL, async () => {\n const { newJob, newMetadata } = await runEasBuildInternalAsync({\n job: ctx.job,\n env: ctx.env,\n logger: ctx.logger,\n cwd: ctx.getReactNativeProjectDirectory(),\n });\n ctx.updateJobInformation(newJob, newMetadata);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.READ_APP_CONFIG, async () => {\n const appConfig = ctx.appConfig;\n ctx.logger.info('Using app configuration:');\n ctx.logger.info(JSON.stringify(appConfig, null, 2));\n await validateAppConfigAsync(ctx, appConfig);\n });\n\n const hasExpoPackage = !!packageJson.dependencies?.expo;\n if (hasExpoPackage) {\n await ctx.runBuildPhase(BuildPhase.RUN_EXPO_DOCTOR, async () => {\n try {\n const { stdout } = await runExpoDoctor(ctx);\n if (!stdout.match(/Didn't find any issues with the project/)) {\n ctx.markBuildPhaseHasWarnings();\n }\n } catch (err) {\n if (err instanceof DoctorTimeoutError) {\n ctx.logger.error(err.message);\n } else {\n ctx.logger.error({ err }, 'Command \"expo doctor\" failed.');\n }\n ctx.markBuildPhaseHasWarnings();\n }\n });\n }\n}\n\nasync function runExpoDoctor<TJob extends Job>(ctx: BuildContext<TJob>): Promise<SpawnResult> {\n ctx.logger.info('Running \"expo doctor\"');\n let timeout: NodeJS.Timeout | undefined;\n let timedOut = false;\n const isAtLeastNpm7 = await isAtLeastNpm7Async();\n try {\n let promise: SpawnPromise<SpawnResult>;\n if (!shouldUseGlobalExpoCli(ctx)) {\n const argsPrefix = isAtLeastNpm7 ? ['-y'] : [];\n promise = spawn('npx', [...argsPrefix, 'expo-doctor'], {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n });\n } else {\n promise = ctx.runGlobalExpoCliCommand(\n ['doctor'],\n {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n },\n isAtLeastNpm7\n );\n }\n timeout = setTimeout(async () => {\n timedOut = true;\n const ppid = nullthrows(promise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.(`\"expo doctor\" timed out`, undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, MAX_EXPO_DOCTOR_TIMEOUT_MS);\n return await promise;\n } catch (err: any) {\n if (timedOut) {\n throw new DoctorTimeoutError('\"expo doctor\" timed out, skipping...');\n }\n throw err;\n } finally {\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n}\n\nasync function runInstallDependenciesAsync<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n let warnTimeout: NodeJS.Timeout | undefined;\n let killTimeout: NodeJS.Timeout | undefined;\n let killTimedOut: boolean = false;\n try {\n const installDependenciesSpawnPromise = (\n await installDependenciesAsync(ctx, {\n logger: ctx.logger,\n infoCallbackFn: () => {\n if (warnTimeout) {\n warnTimeout.refresh();\n }\n if (killTimeout) {\n killTimeout.refresh();\n }\n },\n cwd: resolvePackagerDir(ctx),\n })\n ).spawnPromise;\n\n warnTimeout = setTimeout(() => {\n ctx.logger.warn(\n '\"Install dependencies\" phase takes longer then expected and it did not produce any logs in the past 15 minutes. Consider evaluating your package.json file for possible issues with dependencies'\n );\n }, INSTALL_DEPENDENCIES_WARN_TIMEOUT_MS);\n\n killTimeout = setTimeout(async () => {\n killTimedOut = true;\n ctx.logger.error(\n '\"Install dependencies\" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened with your dependencies which caused the process to hang and it will be terminated'\n );\n const ppid = nullthrows(installDependenciesSpawnPromise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.('\"Install dependencies\" phase takes a very long time', undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, INSTALL_DEPENDENCIES_KILL_TIMEOUT_MS);\n\n await installDependenciesSpawnPromise;\n } catch (err: any) {\n if (killTimedOut) {\n throw new InstallDependenciesTimeoutError(\n '\"Install dependencies\" phase was inactive for over 30 minutes. Please evaluate your package.json file'\n );\n }\n throw err;\n } finally {\n if (warnTimeout) {\n clearTimeout(warnTimeout);\n }\n if (killTimeout) {\n clearTimeout(killTimeout);\n }\n }\n}\n\nasync function validateAppConfigAsync(\n ctx: BuildContext<Job>,\n appConfig: ExpoConfig\n): Promise<void> {\n if (\n appConfig?.extra?.eas?.projectId &&\n ctx.env.EAS_BUILD_PROJECT_ID &&\n appConfig.extra.eas.projectId !== ctx.env.EAS_BUILD_PROJECT_ID\n ) {\n const isUsingDynamicConfig =\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.ts'))) ||\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.js')));\n const isGitHubBuild = ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION;\n let extraMessage = '';\n if (isGitHubBuild && isUsingDynamicConfig) {\n extraMessage =\n 'Make sure you connected your GitHub repository to the correct Expo project and if you are using environment variables to switch between projects in app.config.js/app.config.ts remember to set those variables in eas.json too. ';\n } else if (isGitHubBuild) {\n extraMessage = 'Make sure you connected your GitHub repository to the correct Expo project. ';\n } else if (isUsingDynamicConfig) {\n extraMessage =\n 'If you are using environment variables to switch between projects in app.config.js/app.config.ts, make sure those variables are also set inside EAS Build. You can do that using \"env\" field in eas.json or EAS Secrets. ';\n }\n throw new UserFacingError(\n 'EAS_BUILD_PROJECT_ID_MISMATCH',\n `The value of the \"extra.eas.projectId\" field (${appConfig.extra.eas.projectId}) in the app config does not match the current project id (${ctx.env.EAS_BUILD_PROJECT_ID}). ${extraMessage}Learn more: https://expo.fyi/eas-config-mismatch.`\n );\n } else if (ctx.env.EAS_BUILD_PROJECT_ID && !appConfig?.extra?.eas?.projectId) {\n ctx.logger.error(`The \"extra.eas.projectId\" field is missing from your app config.`);\n ctx.markBuildPhaseHasWarnings();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/common/setup.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,sEAAsE;AACtE,wDAA0B;AAC1B,uDAA+E;AAC/E,4DAA+D;AAC/D,4DAAoC;AAEpC,4DAAkE;AAGlE,8CAAmE;AACnE,0CAAwD;AACxD,0CAAiD;AACjD,4DAA6D;AAC7D,8CAA2E;AAC3E,kDAA4E;AAE5E,qDAA8D;AAC9D,+DAAqF;AACrF,yDAA+F;AAE/F,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,CAAC;AAC7C,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,oCAAoC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE5D,MAAM,kBAAmB,SAAQ,KAAK;CAAG;AACzC,MAAM,+BAAgC,SAAQ,KAAK;CAAG;A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BAAoB,EAAE,CAAC;YAC1C,YAAY;gBACV,mOAAmO,CAAC;QACxO,CAAC;aAAM,IAAI,aAAa,EAAE,CAAC;YACzB,YAAY,GAAG,8EAA8E,CAAC;QAChG,CAAC;aAAM,IAAI,oBAAoB,EAAE,CAAC;YAChC,YAAY;gBACV,2NAA2N,CAAC;QAChO,CAAC;QACD,MAAM,IAAI,wBAAe,CACvB,+BAA+B,EAC/B,iDAAiD,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,8DAA8D,GAAG,CAAC,GAAG,CAAC,oBAAoB,MAAM,YAAY,mDAAmD,CAC9O,CAAC;IACJ,CAAC;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,CAAA,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,KAAK,0CAAE,GAAG,0CAAE,SAAS,CAAA,EAAE,CAAC;QAC7E,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACrF,GAAG,CAAC,yBAAyB,EAAE,CAAC;IAClC,CAAC;AACH,CAAC","sourcesContent":["import path from 'path';\n\nimport spawn, { SpawnPromise, SpawnResult } from '@expo/turtle-spawn';\nimport fs from 'fs-extra';\nimport { BuildJob, BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildTrigger } from '@expo/eas-build-job/dist/common';\nimport nullthrows from 'nullthrows';\nimport { ExpoConfig } from '@expo/config';\nimport { UserFacingError } from '@expo/eas-build-job/dist/errors';\n\nimport { BuildContext } from '../context';\nimport { deleteXcodeEnvLocalIfExistsAsync } from '../ios/xcodeEnv';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { setUpNpmrcAsync } from '../utils/npmrc';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { readPackageJson, shouldUseGlobalExpoCli } from '../utils/project';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nimport { prepareProjectSourcesAsync } from './projectSources';\nimport { installDependenciesAsync, resolvePackagerDir } from './installDependencies';\nimport { resolveEnvFromBuildProfileAsync, runEasBuildInternalAsync } from './easBuildInternal';\n\nconst MAX_EXPO_DOCTOR_TIMEOUT_MS = 30 * 1000;\nconst INSTALL_DEPENDENCIES_WARN_TIMEOUT_MS = 15 * 60 * 1000;\nconst INSTALL_DEPENDENCIES_KILL_TIMEOUT_MS = 30 * 60 * 1000;\n\nclass DoctorTimeoutError extends Error {}\nclass InstallDependenciesTimeoutError extends Error {}\n\nexport async function setupAsync<TJob extends BuildJob>(ctx: BuildContext<TJob>): Promise<void> {\n await ctx.runBuildPhase(BuildPhase.PREPARE_PROJECT, async () => {\n await prepareProjectSourcesAsync(ctx);\n await setUpNpmrcAsync(ctx, ctx.logger);\n if (ctx.job.platform === Platform.IOS && ctx.env.EAS_BUILD_RUNNER === 'eas-build') {\n await deleteXcodeEnvLocalIfExistsAsync(ctx as BuildContext<Ios.Job>);\n }\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n // We need to setup envs from eas.json before\n // eas-build-pre-install hook is called.\n const env = await resolveEnvFromBuildProfileAsync(ctx, {\n cwd: ctx.getReactNativeProjectDirectory(),\n });\n ctx.updateEnv(env);\n }\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_INSTALL);\n });\n\n const packageJson = await ctx.runBuildPhase(BuildPhase.READ_PACKAGE_JSON, async () => {\n ctx.logger.info('Using package.json:');\n const packageJson = readPackageJson(ctx.getReactNativeProjectDirectory());\n ctx.logger.info(JSON.stringify(packageJson, null, 2));\n return packageJson;\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_DEPENDENCIES, async () => {\n await runInstallDependenciesAsync(ctx);\n });\n\n if (ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION) {\n await ctx.runBuildPhase(BuildPhase.EAS_BUILD_INTERNAL, async () => {\n const { newJob, newMetadata } = await runEasBuildInternalAsync({\n job: ctx.job,\n env: ctx.env,\n logger: ctx.logger,\n cwd: ctx.getReactNativeProjectDirectory(),\n });\n ctx.updateJobInformation(newJob, newMetadata);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.READ_APP_CONFIG, async () => {\n const appConfig = ctx.appConfig;\n ctx.logger.info('Using app configuration:');\n ctx.logger.info(JSON.stringify(appConfig, null, 2));\n await validateAppConfigAsync(ctx, appConfig);\n });\n\n const hasExpoPackage = !!packageJson.dependencies?.expo;\n if (hasExpoPackage) {\n await ctx.runBuildPhase(BuildPhase.RUN_EXPO_DOCTOR, async () => {\n try {\n const { stdout } = await runExpoDoctor(ctx);\n if (!stdout.match(/Didn't find any issues with the project/)) {\n ctx.markBuildPhaseHasWarnings();\n }\n } catch (err) {\n if (err instanceof DoctorTimeoutError) {\n ctx.logger.error(err.message);\n } else {\n ctx.logger.error({ err }, 'Command \"expo doctor\" failed.');\n }\n ctx.markBuildPhaseHasWarnings();\n }\n });\n }\n}\n\nasync function runExpoDoctor<TJob extends Job>(ctx: BuildContext<TJob>): Promise<SpawnResult> {\n ctx.logger.info('Running \"expo doctor\"');\n let timeout: NodeJS.Timeout | undefined;\n let timedOut = false;\n const isAtLeastNpm7 = await isAtLeastNpm7Async();\n try {\n let promise: SpawnPromise<SpawnResult>;\n if (!shouldUseGlobalExpoCli(ctx)) {\n const argsPrefix = isAtLeastNpm7 ? ['-y'] : [];\n promise = spawn('npx', [...argsPrefix, 'expo-doctor'], {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n });\n } else {\n promise = ctx.runGlobalExpoCliCommand(\n ['doctor'],\n {\n cwd: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n env: ctx.env,\n },\n isAtLeastNpm7\n );\n }\n timeout = setTimeout(async () => {\n timedOut = true;\n const ppid = nullthrows(promise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.(`\"expo doctor\" timed out`, undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, MAX_EXPO_DOCTOR_TIMEOUT_MS);\n return await promise;\n } catch (err: any) {\n if (timedOut) {\n throw new DoctorTimeoutError('\"expo doctor\" timed out, skipping...');\n }\n throw err;\n } finally {\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n}\n\nasync function runInstallDependenciesAsync<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n let warnTimeout: NodeJS.Timeout | undefined;\n let killTimeout: NodeJS.Timeout | undefined;\n let killTimedOut: boolean = false;\n try {\n const installDependenciesSpawnPromise = (\n await installDependenciesAsync(ctx, {\n logger: ctx.logger,\n infoCallbackFn: () => {\n if (warnTimeout) {\n warnTimeout.refresh();\n }\n if (killTimeout) {\n killTimeout.refresh();\n }\n },\n cwd: resolvePackagerDir(ctx),\n })\n ).spawnPromise;\n\n warnTimeout = setTimeout(() => {\n ctx.logger.warn(\n '\"Install dependencies\" phase takes longer then expected and it did not produce any logs in the past 15 minutes. Consider evaluating your package.json file for possible issues with dependencies'\n );\n }, INSTALL_DEPENDENCIES_WARN_TIMEOUT_MS);\n\n killTimeout = setTimeout(async () => {\n killTimedOut = true;\n ctx.logger.error(\n '\"Install dependencies\" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened with your dependencies which caused the process to hang and it will be terminated'\n );\n const ppid = nullthrows(installDependenciesSpawnPromise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(ppid);\n pids.forEach((pid) => {\n process.kill(pid);\n });\n ctx.reportError?.('\"Install dependencies\" phase takes a very long time', undefined, {\n extras: { buildId: ctx.env.EAS_BUILD_ID },\n });\n }, INSTALL_DEPENDENCIES_KILL_TIMEOUT_MS);\n\n await installDependenciesSpawnPromise;\n } catch (err: any) {\n if (killTimedOut) {\n throw new InstallDependenciesTimeoutError(\n '\"Install dependencies\" phase was inactive for over 30 minutes. Please evaluate your package.json file'\n );\n }\n throw err;\n } finally {\n if (warnTimeout) {\n clearTimeout(warnTimeout);\n }\n if (killTimeout) {\n clearTimeout(killTimeout);\n }\n }\n}\n\nasync function validateAppConfigAsync(\n ctx: BuildContext<Job>,\n appConfig: ExpoConfig\n): Promise<void> {\n if (\n appConfig?.extra?.eas?.projectId &&\n ctx.env.EAS_BUILD_PROJECT_ID &&\n appConfig.extra.eas.projectId !== ctx.env.EAS_BUILD_PROJECT_ID\n ) {\n const isUsingDynamicConfig =\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.ts'))) ||\n (await fs.pathExists(path.join(ctx.getReactNativeProjectDirectory(), 'app.config.js')));\n const isGitHubBuild = ctx.job.triggeredBy === BuildTrigger.GIT_BASED_INTEGRATION;\n let extraMessage = '';\n if (isGitHubBuild && isUsingDynamicConfig) {\n extraMessage =\n 'Make sure you connected your GitHub repository to the correct Expo project and if you are using environment variables to switch between projects in app.config.js/app.config.ts remember to set those variables in eas.json too. ';\n } else if (isGitHubBuild) {\n extraMessage = 'Make sure you connected your GitHub repository to the correct Expo project. ';\n } else if (isUsingDynamicConfig) {\n extraMessage =\n 'If you are using environment variables to switch between projects in app.config.js/app.config.ts, make sure those variables are also set inside EAS Build. You can do that using \"env\" field in eas.json or EAS Secrets. ';\n }\n throw new UserFacingError(\n 'EAS_BUILD_PROJECT_ID_MISMATCH',\n `The value of the \"extra.eas.projectId\" field (${appConfig.extra.eas.projectId}) in the app config does not match the current project id (${ctx.env.EAS_BUILD_PROJECT_ID}). ${extraMessage}Learn more: https://expo.fyi/eas-config-mismatch.`\n );\n } else if (ctx.env.EAS_BUILD_PROJECT_ID && !appConfig?.extra?.eas?.projectId) {\n ctx.logger.error(`The \"extra.eas.projectId\" field is missing from your app config.`);\n ctx.markBuildPhaseHasWarnings();\n }\n}\n"]}
|