Skip to content

Commit 8ecc2ec

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Remove version from the tarball (#35285)
Summary: Pull Request resolved: #35285 While doing the release 0f 0.71.0-RC0, we noticed that having the RN version in the hermes tarball was causing more harm than good. With the version in the name, we ended up with multiple tarballs for debug and release and we were not able to explicitly pick the right tarball given a build. This change remove the version from the tarball name. ## Changelog [General][Changed] - Remove React Native version from Hermes tarball name Differential Revision: D41156353 fbshipit-source-id: cf47c67e94e1b0c6319d82babd8780e9c82566cd
1 parent 5744b21 commit 8ecc2ec

File tree

5 files changed

+23
-67
lines changed

5 files changed

+23
-67
lines changed

.circleci/config.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ references:
5555
hermes_workspace_debug_cache_key: &hermes_workspace_debug_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-debug-{{ checksum "/tmp/hermes/hermesversion" }}
5656
hermes_workspace_release_cache_key: &hermes_workspace_release_cache_key v2-hermes-{{ .Environment.CIRCLE_JOB }}-release-{{ checksum "/tmp/hermes/hermesversion" }}
5757
hermes_windows_cache_key: &hermes_windows_cache_key v3-hermes-{{ .Environment.CIRCLE_JOB }}-{{ checksum "tmp/hermes/hermesversion" }}
58-
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v2-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}
59-
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v1-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}
58+
hermes_tarball_debug_cache_key: &hermes_tarball_debug_cache_key v3-hermes-tarball-debug-{{ checksum "/tmp/hermes/hermesversion" }}
59+
hermes_tarball_release_cache_key: &hermes_tarball_release_cache_key v2-hermes-tarball-release-{{ checksum "/tmp/hermes/hermesversion" }}
6060
pods_cache_key: &pods_cache_key v8-pods-{{ .Environment.CIRCLE_JOB }}-{{ checksum "packages/rn-tester/Podfile.lock.bak" }}-{{ checksum "packages/rn-tester/Podfile" }}
6161
windows_yarn_cache_key: &windows_yarn_cache_key v1-win-yarn-cache-{{ arch }}-{{ checksum "yarn.lock" }}
6262
yarn_cache_key: &yarn_cache_key v5-yarn-cache-{{ .Environment.CIRCLE_JOB }}
@@ -303,8 +303,8 @@ commands:
303303
exit 0
304304
fi
305305
306-
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>" --releaseVersion "*")
307-
TARBALL_PATH=$(ls $HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME)
306+
TARBALL_FILENAME=$(node ~/react-native/scripts/hermes/get-tarball-name.js --buildType "<< parameters.flavor >>")
307+
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
308308
309309
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
310310
echo "$TARBALL_PATH"
@@ -852,7 +852,9 @@ jobs:
852852
- run:
853853
name: Set HERMES_ENGINE_TARBALL_PATH
854854
command: |
855-
echo "export HERMES_ENGINE_TARBALL_PATH=$(ls -AU $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-*.tar.gz | head -1)" >> $BASH_ENV
855+
BUILD_TYPE="<< parameters.flavor >>"
856+
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
857+
echo "export HERMES_ENGINE_TARBALL_PATH=$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME" >> $BASH_ENV
856858
- run:
857859
name: Create iOS template project
858860
command: |
@@ -1224,20 +1226,13 @@ jobs:
12241226
12251227
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
12261228
1227-
# get_release_version() is defined in build-apple-framework.sh
1228-
pushd ./sdks/hermes || exit 1
1229-
BUILD_TYPE=$BUILD_TYPE source ./utils/build-apple-framework.sh
1230-
RELEASE_VERSION=$(get_release_version)
1231-
popd
1232-
1233-
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE" --releaseVersion "$RELEASE_VERSION")
1229+
TARBALL_FILENAME=$(node ./scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
12341230
12351231
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
12361232
12371233
TARBALL_OUTPUT_PATH=$(node ./scripts/hermes/create-tarball.js \
12381234
--inputDir ./sdks/hermes \
12391235
--buildType "$BUILD_TYPE" \
1240-
--releaseVersion "$RELEASE_VERSION" \
12411236
--outputDir $TARBALL_OUTPUT_DIR)
12421237
12431238
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
@@ -1406,8 +1401,8 @@ jobs:
14061401
cp -r $HERMES_WS_DIR/win64-bin/* ./sdks/hermesc/win64-bin/.
14071402
cp -r $HERMES_WS_DIR/linux64-bin/* ./sdks/hermesc/linux64-bin/.
14081403
mkdir -p ./ReactAndroid/external-artifacts/artifacts/
1409-
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-debug-*.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
1410-
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-runtime-darwin-release-*.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
1404+
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
1405+
cp $HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz ./ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
14111406
14121407
- run_yarn
14131408
- download_gradle_dependencies

scripts/hermes/__tests__/hermes-utils-test.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -387,30 +387,15 @@ describe('hermes-utils', () => {
387387

388388
describe('getHermesPrebuiltArtifactsTarballName', () => {
389389
it('should return Hermes prebuilts tarball name', () => {
390-
expect(
391-
getHermesPrebuiltArtifactsTarballName('Debug', '1000.0.0'),
392-
).toEqual('hermes-runtime-darwin-debug-v1000.0.0.tar.gz');
390+
expect(getHermesPrebuiltArtifactsTarballName('Debug')).toEqual(
391+
'hermes-ios-debug.tar.gz',
392+
);
393393
});
394394
it('should throw if build type is undefined', () => {
395395
expect(() => {
396396
getHermesPrebuiltArtifactsTarballName();
397397
}).toThrow('Did not specify build type.');
398398
});
399-
it('should throw if release version is undefined', () => {
400-
expect(() => {
401-
getHermesPrebuiltArtifactsTarballName('Release');
402-
}).toThrow('Did not specify release version.');
403-
});
404-
it('should return debug Hermes prebuilts tarball name for RN 0.70.0', () => {
405-
expect(
406-
getHermesPrebuiltArtifactsTarballName('Debug', '0.70.0'),
407-
).toEqual('hermes-runtime-darwin-debug-v0.70.0.tar.gz');
408-
});
409-
it('should return a wildcard Hermes prebuilts tarball name for any RN version', () => {
410-
expect(getHermesPrebuiltArtifactsTarballName('Debug', '*')).toEqual(
411-
'hermes-runtime-darwin-debug-v*.tar.gz',
412-
);
413-
});
414399
});
415400

416401
describe('createHermesPrebuiltArtifactsTarball', () => {
@@ -426,7 +411,6 @@ describe('hermes-utils', () => {
426411
const tarballOutputPath = createHermesPrebuiltArtifactsTarball(
427412
path.join(SDKS_DIR, 'hermes'),
428413
'Debug',
429-
'1000.0.0',
430414
tarballOutputDir,
431415
excludeDebugSymbols,
432416
);
@@ -448,7 +432,6 @@ describe('hermes-utils', () => {
448432
const tarballOutputPath = createHermesPrebuiltArtifactsTarball(
449433
path.join(SDKS_DIR, 'hermes'),
450434
'Debug',
451-
'1000.0.0',
452435
tarballOutputDir,
453436
excludeDebugSymbols,
454437
);

scripts/hermes/create-tarball.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ let argv = yargs
3131
describe: 'Specifies whether Hermes was built for Debug or Release.',
3232
default: 'Debug',
3333
})
34-
.option('v', {
35-
alias: 'releaseVersion',
36-
type: 'string',
37-
describe: 'The version of React Native that will use this tarball.',
38-
default: '1000.0.0',
39-
})
4034
.option('o', {
4135
alias: 'outputDir',
4236
describe: 'Location where the tarball will be saved to.',
@@ -50,7 +44,6 @@ let argv = yargs
5044
async function main() {
5145
const hermesDir = argv.inputDir;
5246
const buildType = argv.buildType;
53-
const releaseVersion = argv.releaseVersion;
5447
const excludeDebugSymbols = argv.excludeDebugSymbols;
5548
let tarballOutputDir = argv.outputDir;
5649

@@ -69,7 +62,6 @@ async function main() {
6962
const tarballOutputPath = createHermesPrebuiltArtifactsTarball(
7063
hermesDir,
7164
buildType,
72-
releaseVersion,
7365
tarballOutputDir,
7466
excludeDebugSymbols,
7567
);

scripts/hermes/get-tarball-name.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,15 @@
1616
const yargs = require('yargs');
1717
const {getHermesPrebuiltArtifactsTarballName} = require('./hermes-utils');
1818

19-
let argv = yargs
20-
.option('b', {
21-
alias: 'buildType',
22-
type: 'string',
23-
describe: 'Specifies whether Hermes was built for Debug or Release.',
24-
default: 'Debug',
25-
})
26-
.option('v', {
27-
alias: 'releaseVersion',
28-
type: 'string',
29-
describe: 'The version of React Native that will use this tarball.',
30-
default: '1000.0.0',
31-
}).argv;
19+
let argv = yargs.option('b', {
20+
alias: 'buildType',
21+
type: 'string',
22+
describe: 'Specifies whether Hermes was built for Debug or Release.',
23+
default: 'Debug',
24+
}).argv;
3225

3326
async function main() {
34-
const tarballName = getHermesPrebuiltArtifactsTarballName(
35-
argv.buildType,
36-
argv.releaseVersion,
37-
);
27+
const tarballName = getHermesPrebuiltArtifactsTarballName(argv.buildType);
3828
console.log(tarballName);
3929
return tarballName;
4030
}

scripts/hermes/hermes-utils.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,11 @@ set_target_properties(native-hermesc PROPERTIES
212212
}
213213
}
214214

215-
function getHermesPrebuiltArtifactsTarballName(buildType, releaseVersion) {
215+
function getHermesPrebuiltArtifactsTarballName(buildType) {
216216
if (!buildType) {
217217
throw Error('Did not specify build type.');
218218
}
219-
if (!releaseVersion) {
220-
throw Error('Did not specify release version.');
221-
}
222-
return `hermes-runtime-darwin-${buildType.toLowerCase()}-v${releaseVersion}.tar.gz`;
219+
return `hermes-ios-${buildType.toLowerCase()}.tar.gz`;
223220
}
224221

225222
/**
@@ -233,7 +230,6 @@ function createTarballFromDirectory(directory, filename) {
233230
function createHermesPrebuiltArtifactsTarball(
234231
hermesDir,
235232
buildType,
236-
releaseVersion,
237233
tarballOutputDir,
238234
excludeDebugSymbols,
239235
) {
@@ -268,7 +264,7 @@ function createHermesPrebuiltArtifactsTarball(
268264

269265
const tarballFilename = path.join(
270266
tarballOutputDir,
271-
getHermesPrebuiltArtifactsTarballName(buildType, releaseVersion),
267+
getHermesPrebuiltArtifactsTarballName(buildType),
272268
);
273269

274270
try {

0 commit comments

Comments
 (0)