diff --git a/CHANGELOG.md b/CHANGELOG.md index b228bd264c..5171100cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ This is the log of notable changes to EAS CLI and related packages. - Add `requiredPackageManager` to metadata. ([#2067](https://github.com/expo/eas-cli/pull/2067) by [@kadikraman](https://github.com/kadikraman)) - Move `getVcsClient` into command context. ([#2086](https://github.com/expo/eas-cli/pull/2086) by [@Josh-McFarlin](https://github.com/Josh-McFarlin)) - Display Apple device creation date when listing devices. ([#2092](https://github.com/expo/eas-cli/pull/2092) by [@radoslawkrzemien](https://github.com/radoslawkrzemien)) +- Clean up Intel resource classes code after their deletion. ([#2093](https://github.com/expo/eas-cli/pull/2093) by [@szdziedzic](https://github.com/szdziedzic)) ## [5.4.0](https://github.com/expo/eas-cli/releases/tag/v5.4.0) - 2023-09-28 diff --git a/packages/eas-cli/src/build/build.ts b/packages/eas-cli/src/build/build.ts index a3453135fb..836c7ead5c 100644 --- a/packages/eas-cli/src/build/build.ts +++ b/packages/eas-cli/src/build/build.ts @@ -1,5 +1,5 @@ import { ArchiveSource, ArchiveSourceType, Job, Metadata, Platform } from '@expo/eas-build-job'; -import { CredentialsSource, EasJsonAccessor, EasJsonUtils, ResourceClass } from '@expo/eas-json'; +import { CredentialsSource } from '@expo/eas-json'; import assert from 'assert'; import chalk from 'chalk'; import cliProgress from 'cli-progress'; @@ -17,7 +17,6 @@ import { BuildFragment, BuildParamsInput, BuildPriority, - BuildResourceClass, BuildStatus, UploadSessionType, } from '../graphql/generated'; @@ -30,7 +29,6 @@ import { appPlatformEmojis, requestedPlatformDisplayNames, } from '../platform'; -import { confirmAsync } from '../prompts'; import { uploadFileAtPathToGCSAsync } from '../uploads'; import { formatBytes } from '../utils/files'; import { printJsonOnlyOutput } from '../utils/json'; @@ -335,12 +333,7 @@ export type MaybeBuildFragment = BuildFragment | null; export async function waitForBuildEndAsync( graphqlClient: ExpoGraphqlClient, - { - buildIds, - accountName, - projectDir, - nonInteractive, - }: { buildIds: string[]; accountName: string; projectDir: string; nonInteractive: boolean }, + { buildIds, accountName }: { buildIds: string[]; accountName: string }, { intervalSec = 10 } = {} ): Promise { let spinner; @@ -357,10 +350,7 @@ export async function waitForBuildEndAsync( const builds = await getBuildsSafelyAsync(graphqlClient, buildIds); const { refetch } = builds.length === 1 - ? await handleSingleBuildProgressAsync( - { build: builds[0], accountName, projectDir, nonInteractive }, - { spinner } - ) + ? await handleSingleBuildProgressAsync({ build: builds[0], accountName }, { spinner }) : await handleMultipleBuildsProgressAsync({ builds }, { spinner, originalSpinnerText }); if (!refetch) { return builds; @@ -398,13 +388,9 @@ async function handleSingleBuildProgressAsync( { build, accountName, - projectDir, - nonInteractive, }: { build: MaybeBuildFragment; accountName: string; - projectDir: string; - nonInteractive: boolean; }, { spinner }: { spinner: Ora } ): Promise { @@ -458,54 +444,6 @@ async function handleSingleBuildProgressAsync( ); } - if ( - build.platform === AppPlatform.Ios && - [BuildResourceClass.IosIntelLarge, BuildResourceClass.IosIntelMedium].includes( - build.resourceClass - ) - ) { - let askToSwitchToM1 = false; - if ( - build.priority === BuildPriority.High && - build.estimatedWaitTimeLeftSeconds >= /* 10 minutes */ 10 * 60 - ) { - Log.newLine(); - Log.warn( - `Warning: Priority queue wait time for legacy iOS Intel workers is longer than usual (more than 10 minutes).` - ); - Log.warn(`We recommend switching to the new, faster M1 workers for iOS builds.`); - Log.warn( - learnMore('https://blog.expo.dev/m1-workers-on-eas-build-dcaa2c1333ad', { - learnMoreMessage: 'Learn more on switching to M1 workers.', - }) - ); - askToSwitchToM1 = true; - } else if ( - build.priority !== BuildPriority.High && - build.estimatedWaitTimeLeftSeconds >= /* 120 minutes */ 120 * 60 - ) { - Log.newLine(); - Log.warn( - `Warning: Free tier queue wait time for legacy iOS Intel workers is longer than usual.` - ); - Log.warn(`We recommend switching to the new, faster M1 workers for iOS builds.`); - Log.warn( - learnMore('https://blog.expo.dev/m1-workers-on-eas-build-dcaa2c1333ad', { - learnMoreMessage: 'Learn more on switching to M1 workers.', - }) - ); - askToSwitchToM1 = true; - } - if (!nonInteractive && askToSwitchToM1) { - const shouldSwitchToM1 = await confirmAsync({ - message: `Switch iOS builds to M1 workers (modifies build profiles in eas.json)?`, - }); - if (shouldSwitchToM1) { - await updateIosBuildProfilesToUseM1WorkersAsync(projectDir); - } - } - } - Log.newLine(); Log.log(`Waiting in ${priorityToQueueDisplayName[build.priority]}`); queueProgressBar.start( @@ -654,21 +592,3 @@ function formatAccountSubscriptionsUrl(accountName: string): string { getExpoWebsiteBaseUrl() ).toString(); } - -async function updateIosBuildProfilesToUseM1WorkersAsync(projectDir: string): Promise { - const easJsonAccessor = EasJsonAccessor.fromProjectPath(projectDir); - await easJsonAccessor.readRawJsonAsync(); - - const profileNames = await EasJsonUtils.getBuildProfileNamesAsync(easJsonAccessor); - easJsonAccessor.patch(easJsonRawObject => { - for (const profileName of profileNames) { - easJsonRawObject.build[profileName].ios = { - ...easJsonRawObject.build[profileName].ios, - resourceClass: ResourceClass.M_MEDIUM, - }; - } - return easJsonRawObject; - }); - await easJsonAccessor.writeAsync(); - Log.withTick('Updated eas.json. Your next builds will run on M1 workers.'); -} diff --git a/packages/eas-cli/src/build/runBuildAndSubmit.ts b/packages/eas-cli/src/build/runBuildAndSubmit.ts index b96fac14a6..58b23213ed 100644 --- a/packages/eas-cli/src/build/runBuildAndSubmit.ts +++ b/packages/eas-cli/src/build/runBuildAndSubmit.ts @@ -231,8 +231,6 @@ export async function runBuildAndSubmitAsync( const builds = await waitForBuildEndAsync(graphqlClient, { buildIds: startedBuilds.map(({ build }) => build.id), accountName, - projectDir, - nonInteractive: flags.nonInteractive, }); if (!flags.json) { printBuildResults(builds); diff --git a/packages/eas-cli/src/build/utils/resourceClass.ts b/packages/eas-cli/src/build/utils/resourceClass.ts index 622621e234..7a305e6171 100644 --- a/packages/eas-cli/src/build/utils/resourceClass.ts +++ b/packages/eas-cli/src/build/utils/resourceClass.ts @@ -7,21 +7,13 @@ import Log, { link } from '../../log'; type AndroidResourceClass = Exclude< ResourceClass, - | ResourceClass.M1_EXPERIMENTAL - | ResourceClass.M1_MEDIUM - | ResourceClass.M1_LARGE - | ResourceClass.INTEL_MEDIUM - | ResourceClass.M_MEDIUM - | ResourceClass.M_LARGE + ResourceClass.M1_MEDIUM | ResourceClass.M_MEDIUM | ResourceClass.M_LARGE >; const iosResourceClassToBuildResourceClassMapping: Record = { [ResourceClass.DEFAULT]: BuildResourceClass.IosDefault, [ResourceClass.LARGE]: BuildResourceClass.IosLarge, - [ResourceClass.M1_EXPERIMENTAL]: BuildResourceClass.IosMMedium, [ResourceClass.M1_MEDIUM]: BuildResourceClass.IosMMedium, - [ResourceClass.M1_LARGE]: BuildResourceClass.IosMLarge, - [ResourceClass.INTEL_MEDIUM]: BuildResourceClass.IosIntelMedium, [ResourceClass.MEDIUM]: BuildResourceClass.IosMedium, [ResourceClass.M_MEDIUM]: BuildResourceClass.IosMMedium, [ResourceClass.M_LARGE]: BuildResourceClass.IosMLarge, @@ -57,15 +49,7 @@ export async function resolveBuildResourceClassAsync( } function resolveAndroidResourceClass(selectedResourceClass?: ResourceClass): BuildResourceClass { - if ( - selectedResourceClass && - [ - ResourceClass.M1_EXPERIMENTAL, - ResourceClass.M1_MEDIUM, - ResourceClass.M1_LARGE, - ResourceClass.INTEL_MEDIUM, - ].includes(selectedResourceClass) - ) { + if (selectedResourceClass && ResourceClass.M1_MEDIUM === selectedResourceClass) { throw new Error(`Resource class ${selectedResourceClass} is only available for iOS builds`); } @@ -88,7 +72,7 @@ function resolveIosResourceClass( ); } - if ([ResourceClass.M1_EXPERIMENTAL, ResourceClass.M1_MEDIUM].includes(resourceClass)) { + if (ResourceClass.M1_MEDIUM === resourceClass) { Log.warn( `Resource class ${chalk.bold(resourceClass)} is deprecated. Use ${chalk.bold( 'm-medium' @@ -96,7 +80,7 @@ function resolveIosResourceClass( ); } - if ([ResourceClass.M_LARGE, ResourceClass.M1_LARGE].includes(resourceClass)) { + if (ResourceClass.M_LARGE === resourceClass) { Log.warn( `Resource class ${chalk.bold(resourceClass)} is deprecated. Use ${chalk.bold( 'large' diff --git a/packages/eas-cli/src/commands/build/resign.ts b/packages/eas-cli/src/commands/build/resign.ts index ce649bd0fb..ee657aadf9 100644 --- a/packages/eas-cli/src/commands/build/resign.ts +++ b/packages/eas-cli/src/commands/build/resign.ts @@ -204,8 +204,6 @@ export default class BuildResign extends EasCommand { const buildResult = await waitForBuildEndAsync(graphqlClient, { buildIds: [newBuild.id], accountName: account.name, - nonInteractive, - projectDir, }); if (!flags.json) { printBuildResults(buildResult); diff --git a/packages/eas-json/src/build/schema.ts b/packages/eas-json/src/build/schema.ts index e7b2558dfe..56d507c9c6 100644 --- a/packages/eas-json/src/build/schema.ts +++ b/packages/eas-json/src/build/schema.ts @@ -14,7 +14,6 @@ const AllowedAndroidResourceClasses: ResourceClass[] = AllowedCommonResourceClas const AllowedIosResourceClasses: ResourceClass[] = [ ...AllowedCommonResourceClasses, ResourceClass.M1_MEDIUM, - ResourceClass.INTEL_MEDIUM, ResourceClass.M_MEDIUM, ResourceClass.M_LARGE, ]; diff --git a/packages/eas-json/src/build/types.ts b/packages/eas-json/src/build/types.ts index 60f503a3cf..3cc23cf0e0 100644 --- a/packages/eas-json/src/build/types.ts +++ b/packages/eas-json/src/build/types.ts @@ -8,19 +8,10 @@ export enum CredentialsSource { export enum ResourceClass { DEFAULT = 'default', LARGE = 'large', - /** - * @deprecated use M_MEDIUM instead - */ - M1_EXPERIMENTAL = 'm1-experimental', /** * @deprecated use M_MEDIUM instead */ M1_MEDIUM = 'm1-medium', - /** - * @deprecated use M_LARGE instead - */ - M1_LARGE = 'm1-large', - INTEL_MEDIUM = 'intel-medium', MEDIUM = 'medium', M_MEDIUM = 'm-medium', /**