Skip to content

Commit 19282ad

Browse files
thezhangweifacebook-github-bot
authored andcommitted
F Release Promote redex-staging to redex-stable 2nd land
Summary: We are moving forward with the F release based on the AB test [results](https://fb.workplace.com/groups/RedexTeam/posts/1644837602730337/). Re-land of D61694226 allow-large-files Reviewed By: ssj933 Differential Revision: D61984453 fbshipit-source-id: 530dd5bf7f5b6d06c91da09edf23b6a35011dbb1
1 parent c8cd272 commit 19282ad

File tree

228 files changed

+8583
-2964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+8583
-2964
lines changed

.circleci/config.yml

Lines changed: 28 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,6 @@ commands:
138138

139139
# For testing, need additional dependencies not provided by the image.
140140

141-
# Version where dx is available as a package. May remove this eventually.
142-
test-build-setup-no-sdk:
143-
steps:
144-
- run:
145-
name: Setup for tests
146-
command: |
147-
sudo apt-get install -y --no-install-recommends dalvik-exchange default-jdk-headless
148-
sudo ln -s /usr/bin/dalvik-exchange /usr/local/bin/dx
149-
150-
# Special version of the above to work around Debian Testing package issues.
151-
#
152141
# Note: CircleCI does not allow to drop existing caches (in case they are
153142
# outdated, for example). The expectation is that the "cache key"
154143
# changes, for example via the checksum of a dependency file.
@@ -163,72 +152,51 @@ commands:
163152
# See:
164153
# * [https://support.circleci.com/hc/en-us/articles/115015426888-Clear-project-dependency-cache]
165154
# * [https://devops.stackexchange.com/questions/9147/how-to-get-other-than-no-value-when-interpolating-environment-some-var]
166-
test-build-setup-sdk:
155+
test-build-setup:
167156
steps:
168157
- run:
169-
name: Setup for tests (Deb Testing)
170-
command: |
171-
sudo apt-get install -y --no-install-recommends default-jdk-headless
172-
173-
- run:
174-
name: Create cache key file
158+
name: Setup for tests
175159
command: |
176-
echo "Cache key is: ${CACHE_VERSION}"
177-
echo "${CACHE_VERSION}" > cache_version.rev
160+
sudo apt-get install -y --no-install-recommends default-jdk-headless zip unzip
178161
179162
- restore_cache:
180163
name: Restoring SDK Cache
181164
keys:
182-
- android-build-tools-{{ checksum "cache_version.rev" }}
165+
- v3-android-build-tools
183166

184167
# We have to emulate cache behavior. Skip downloads if files exist.
185168
- run:
186169
name: Check/Install (SDK)
187170
command: |
188-
if [ -e ~/sdk/build-tools/25.0.3/dx ] ; then
189-
echo "Found SDK."
190-
exit 0
171+
if [ -e sdk/build-tools/29.0.2/dx ] ; then echo "Found SDK." ; exit 0 ; fi
172+
173+
# Check whether cache file exists, then check dx again.
174+
if [ -f "sdk.tar.zstd" ] ; then
175+
zstd --decompress --stdout sdk.tar.zstd | tar xf -
176+
if [ -e sdk/build-tools/29.0.2/dx ] ; then echo "Unpacked SDK." ; exit 0 ; fi
191177
fi
178+
179+
# Download.
192180
echo "SDK missing, downloading..."
193-
rm -rf ~/sdk 2>/dev/null
181+
rm -rf sdk 2>/dev/null && mkdir -p sdk/cmdline-tools
182+
echo "Downloading SDK to $(pwd)/sdk"
194183
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
195-
mkdir -p ~/sdk/cmdline-tools
196-
unzip commandlinetools-linux-6609375_latest.zip -d ~/sdk/cmdline-tools/
197-
pushd ~/sdk/cmdline-tools/tools/bin >/dev/null
198-
echo 'y' | ./sdkmanager --install 'build-tools;25.0.3'
184+
unzip commandlinetools-linux-6609375_latest.zip -d sdk/cmdline-tools/
185+
pushd sdk/cmdline-tools/tools/bin >/dev/null
186+
echo 'y' | ./sdkmanager --install 'build-tools;29.0.2'
187+
./sdkmanager --install 'platforms;android-29'
199188
popd >/dev/null
200189
201-
- run:
202-
name: Check/Install (Symlink)
203-
command: |
204-
if [ -L /usr/local/bin/dx ] ; then
205-
echo "Found symlink."
206-
exit 0
207-
fi
208-
echo "Adding symlink..."
209-
sudo ln -s ~/sdk/build-tools/25.0.3/dx /usr/local/bin/dx
190+
# Compress for cache. For reason see description of build cache.
191+
# We do not need the emulator and it is large. Delete.
192+
rm -rf sdk/emulator 2>/dev/null
193+
tar cf - sdk | zstd -T0 -3 > sdk.tar.zstd
210194
211195
- save_cache:
212196
name: Saving SDK Cache
213197
paths:
214-
- ~/sdk
215-
key: android-build-tools-{{ checksum "cache_version.rev" }}
216-
217-
test-build-setup:
218-
parameters:
219-
use_sdk:
220-
type: boolean
221-
default: true
222-
steps:
223-
- when:
224-
condition: << parameters.use_sdk >>
225-
steps:
226-
- test-build-setup-sdk
227-
- when:
228-
condition:
229-
not: << parameters.use_sdk >>
230-
steps:
231-
- test-build-setup-no-sdk
198+
- sdk.tar.zstd
199+
key: v3-android-build-tools
232200

233201
# Level of indirection because there seems to be no way to set parameters
234202
# in the steps.
@@ -247,18 +215,14 @@ commands:
247215
run_tests:
248216
type: boolean
249217
default: true
250-
use_sdk:
251-
type: boolean
252-
default: true
253218
job_name:
254219
type: string
255220
steps:
256221
- base-build-setup:
257222
save_boost_cache: << parameters.save_boost_cache >>
258223
setup_toolchain_extra: << parameters.setup_toolchain_extra >>
259224

260-
- test-build-setup:
261-
use_sdk: << parameters.use_sdk >>
225+
- test-build-setup
262226

263227
- run:
264228
name: Create Build Cache File
@@ -270,7 +234,8 @@ commands:
270234
keys:
271235
# Always distinguish caches for the job, arch and branch. Look for the current revision first,
272236
# then "newest" cache.
273-
- &build-cache v1-build-cache-{{ checksum "/tmp/build.txt" }}-{{ arch }}-{{ .Branch }}-{{ .Revision }}
237+
- &build-cache v2-build-cache-{{ checksum "/tmp/build.txt" }}-{{ arch }}-{{ .Branch }}-{{ .Revision }}
238+
- v2-build-cache-{{ checksum "/tmp/build.txt" }}-{{ arch }}-{{ .Branch }}-
274239
- v1-build-cache-{{ checksum "/tmp/build.txt" }}-{{ arch }}-{{ .Branch }}-
275240

276241
- run:
@@ -289,7 +254,7 @@ commands:
289254
name: Configure
290255
working_directory: build
291256
command: |
292-
../repo/configure --enable-protobuf << parameters.configure_extra >>
257+
../repo/configure --enable-protobuf --with-android-sdk="$(pwd)/../sdk" << parameters.configure_extra >>
293258
294259
- run:
295260
name: Build
@@ -347,10 +312,6 @@ commands:
347312
mode_32:
348313
type: boolean
349314
default: false
350-
# Download DX from the Android SDK.
351-
use_sdk:
352-
type: boolean
353-
default: true
354315
job_name:
355316
type: string
356317
steps:
@@ -359,7 +320,6 @@ commands:
359320
steps:
360321
- setup-build-and-test-w-make-impl:
361322
save_boost_cache: << parameters.save_boost_cache >>
362-
use_sdk: << parameters.use_sdk >>
363323
setup_toolchain_extra: "32"
364324
# Would be nice to properly use environment, but that's only at
365325
# the jobs or run level.
@@ -374,7 +334,6 @@ commands:
374334
steps:
375335
- setup-build-and-test-w-make-impl:
376336
save_boost_cache: << parameters.save_boost_cache >>
377-
use_sdk: << parameters.use_sdk >>
378337
job_name: << parameters.job_name >>
379338

380339
build_debian:
@@ -392,9 +351,6 @@ commands:
392351
mode_32:
393352
type: boolean
394353
default: false
395-
use_sdk:
396-
type: boolean
397-
default: true
398354
job_name:
399355
type: string
400356
steps:
@@ -411,7 +367,6 @@ commands:
411367
git restore-mtime
412368
- setup-build-and-test-w-make:
413369
save_boost_cache: << parameters.save_boost_cache >>
414-
use_sdk: << parameters.use_sdk >>
415370
mode_32: << parameters.mode_32 >>
416371
job_name: << parameters.job_name >>-<< parameters.install_clang_llvm_org >>
417372

@@ -482,7 +437,6 @@ jobs:
482437
resource_class: large
483438
steps:
484439
- build_debian:
485-
use_sdk: false
486440
job_name: debian_10
487441

488442
build-deb_stable:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: base-build-setup
2+
inputs:
3+
save_boost_cache:
4+
required: false
5+
default: false
6+
setup_toolchain_extra:
7+
required: false
8+
default: ''
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Cache boost
13+
if: inputs.save_boost_cache == 'true'
14+
uses: actions/[email protected]
15+
with:
16+
key: boost-1-71-0-v5
17+
path: /tmp/toolchain/dl_cache/boost_cache
18+
- name: Cache protobuf
19+
if: inputs.save_boost_cache == 'true'
20+
uses: actions/[email protected]
21+
with:
22+
key: protobuf3-v3
23+
path: /tmp/toolchain/dl_cache/protobuf
24+
- name: Setup
25+
run: sudo -E ./setup_oss_toolchain.sh ${{ inputs.setup_toolchain_extra }}
26+
working-directory: repo
27+
env:
28+
TOOLCHAIN_TMP: /tmp/toolchain
29+
shell: bash
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: build_debian
2+
inputs:
3+
save_boost_cache:
4+
required: false
5+
default: false
6+
install_clang:
7+
required: false
8+
default: false
9+
install_clang_llvm_org:
10+
required: false
11+
default: -1
12+
mode_32:
13+
required: false
14+
default: false
15+
job_name:
16+
required: false
17+
runs:
18+
using: composite
19+
steps:
20+
# Reinitialize. It is easier to do this (again) to not have to deal with
21+
# fixing `uses:` paths.
22+
- uses: actions/[email protected]
23+
with:
24+
path: repo
25+
# We want to run restore-mtime, which needs to find actual commit data
26+
# and not just the shallow default result. The easiest way for this seems
27+
# to be the filter support of Github (https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/).
28+
fetch-depth: 1000000
29+
filter: "tree:0"
30+
- uses: ./.github/actions/debian-based-image-build-setup
31+
with:
32+
mode_32: "${{ inputs.mode_32 }}"
33+
install_clang: "${{ inputs.install_clang }}"
34+
install_clang_llvm_org: "${{ inputs.install_clang_llvm_org }}"
35+
- name: Run git-restore-mtime
36+
run: git restore-mtime
37+
working-directory: repo
38+
shell: bash
39+
- uses: ./.github/actions/setup-build-and-test-w-make
40+
with:
41+
save_boost_cache: "${{ inputs.save_boost_cache }}"
42+
mode_32: "${{ inputs.mode_32 }}"
43+
job_name: "${{ inputs.job_name }}-${{ inputs.install_clang_llvm_org }}"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: debian-based-image-build-setup
2+
inputs:
3+
mode_32:
4+
required: false
5+
default: false
6+
install_clang:
7+
required: false
8+
default: false
9+
install_clang_llvm_org:
10+
required: false
11+
default: -1
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Update Apt Data
16+
run: sudo apt-get -qq update || ( apt-get -qq update && apt-get -qq install --no-install-recommends -y sudo ; )
17+
shell: bash
18+
- name: Install tools
19+
run: sudo apt-get install -qq --no-install-recommends -y git-restore-mtime zstd tar
20+
shell: bash
21+
- name: Add 32-bit Arch
22+
run: sudo dpkg --add-architecture i386 && sudo apt-get update
23+
if: inputs.mode_32 == 'true'
24+
shell: bash
25+
- name: Install Clang
26+
run: sudo apt-get install -qq -y --no-install-recommends clang
27+
if: inputs.install_clang == 'true'
28+
shell: bash
29+
- name: Install Clang (apt.llvm.org)
30+
run: |-
31+
sudo apt-get install -qq -y --no-install-recommends lsb-release software-properties-common
32+
sudo /bin/bash -c "$(wget -O - https://apt.llvm.org/llvm.sh | sed -e 's/^add-apt-repository.*$/& -y\n& -y/')"
33+
ls /usr/bin/clang*
34+
if: 0 == inputs.install_clang_llvm_org
35+
shell: bash
36+
37+
- name: Install Clang (apt.llvm.org)
38+
run: |-
39+
sudo apt-get install -qq -y --no-install-recommends lsb-release software-properties-common
40+
sudo /bin/bash -c "$(wget -O - https://apt.llvm.org/llvm.sh | sed -e 's/^add-apt-repository.*$/& -y\n& -y/')" "llvm.sh" ${{ inputs.install_clang_llvm_org }}
41+
ls /usr/bin/clang*
42+
if: -1 != inputs.install_clang_llvm_org && 0 != inputs.install_clang_llvm_org
43+
shell: bash

0 commit comments

Comments
 (0)