Skip to content

Commit

Permalink
getdeps: add xxhash ubuntu and homebrew packages, fix actions generat…
Browse files Browse the repository at this point in the history
…ion and regenerate (#966)

Summary:
X-link: facebookincubator/zstrong#1010

EdenFS build on github CI was failing with missing xxhash include: https://github.com/facebook/sapling/actions/runs/11311478649/job/31457761727#step:108:3838

Add package mappings to the xxhash manifest

When I went to regenerate the github actions found I'd previously introduced a bug in the actions generation with a mis-merged run_tests check where if tests not run it wouldn't generate system dependency usage.  Fix it and regenerate


Test Plan:
Build locally on ubuntu-22.04 toolbox to repro issue, its broken,
```
./build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. eden
```

Install the packages:
```
./build/fbcode_builder/getdeps.py install-system-deps --recursive eden
```

Run again, it builds:
```
./build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. eden
```

Regenerate the github workflow:
```
 ./build/fbcode_builder/getdeps.py --allow-system-packages generate-github-actions --no-tests --free-up-disk --os-type=linux --src-dir=. --output-dir=.github/workflows --job-name "EdenFS " --job-file-prefix=edenfs_ eden --num-jobs=8  --project-install-prefix sapling:/usr/local
```

Differential Revision: D64302134

Pulled By: ahornby
  • Loading branch information
ahornby authored and facebook-github-bot committed Oct 13, 2024
1 parent 23e67fc commit b59064f
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 6 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/edenfs_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
- name: Update system package info
run: sudo apt-get update
- name: Install system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive eden
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --no-tests --recursive eden
- name: Install packaging system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive patchelf
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --no-tests --recursive patchelf
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Fetch lmdb
Expand All @@ -50,6 +50,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests glog
- name: Fetch googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests googletest
- name: Fetch xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xxhash
- name: Fetch zstd
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zstd
- name: Fetch boost
Expand Down Expand Up @@ -148,6 +150,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests glog
- name: Build googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests googletest
- name: Build xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests xxhash
- name: Build zstd
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests zstd
- name: Build boost
Expand Down Expand Up @@ -237,4 +241,5 @@ jobs:
name: eden
path: _artifacts
- name: Show disk space at end
if: always()
run: df -h
8 changes: 8 additions & 0 deletions .github/workflows/mononoke-integration_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
- name: Fetch googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests googletest
- name: Fetch xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xxhash
- name: Fetch python-setuptools
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests python-setuptools
- name: Fetch autoconf
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests autoconf
- name: Fetch automake
Expand Down Expand Up @@ -136,6 +140,10 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fmt
- name: Build googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests googletest
- name: Build xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests xxhash
- name: Build python-setuptools
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests python-setuptools
- name: Build autoconf
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests autoconf
- name: Build automake
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/mononoke_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive patchelf
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Fetch xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xxhash
- name: Fetch ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ninja
- name: Fetch cmake
Expand Down Expand Up @@ -102,6 +104,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fb303
- name: Fetch rust-shed
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests rust-shed
- name: Build xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests xxhash
- name: Build ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests ninja
- name: Build cmake
Expand Down Expand Up @@ -183,4 +187,5 @@ jobs:
- name: Test mononoke
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. mononoke --project-install-prefix mononoke:/
- name: Show disk space at end
if: always()
run: df -h
5 changes: 5 additions & 0 deletions .github/workflows/mononoke_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive mononoke
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Fetch xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xxhash
- name: Fetch openssl
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests openssl
- name: Fetch ninja
Expand Down Expand Up @@ -82,6 +84,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fb303
- name: Fetch rust-shed
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests rust-shed
- name: Build xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests xxhash
- name: Build openssl
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests openssl
- name: Build ninja
Expand Down Expand Up @@ -151,4 +155,5 @@ jobs:
- name: Test mononoke
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. mononoke --project-install-prefix mononoke:/usr/local
- name: Show disk space at end
if: always()
run: df -h
4 changes: 4 additions & 0 deletions .github/workflows/sapling-cli-getdeps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Fetch hexdump
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests hexdump
- name: Fetch xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xxhash
- name: Fetch bz2
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests bz2
- name: Fetch ninja
Expand Down Expand Up @@ -112,6 +114,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests rust-shed
- name: Build hexdump
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests hexdump
- name: Build xxhash
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests xxhash
- name: Build bz2
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests bz2
- name: Build ninja
Expand Down
18 changes: 14 additions & 4 deletions build/fbcode_builder/getdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ def get_run_on(self, args):
def write_job_for_platform(self, platform, args): # noqa: C901
build_opts = setup_build_options(args, platform)
ctx_gen = build_opts.get_context_generator()
if args.enable_tests:
ctx_gen.set_value_for_project(args.project, "test", "on")
else:
ctx_gen.set_value_for_project(args.project, "test", "off")
loader = ManifestLoader(build_opts, ctx_gen)
self.process_project_dir_arguments(args, loader)
manifest = loader.load_manifest(args.project)
Expand Down Expand Up @@ -1081,7 +1085,10 @@ def write_job_for_platform(self, platform, args): # noqa: C901
free_up_disk = ""

allow_sys_arg = ""
if run_tests:
if (
build_opts.allow_system_packages
and build_opts.host_type.get_package_manager()
):
sudo_arg = "sudo "
allow_sys_arg = " --allow-system-packages"
if build_opts.host_type.get_package_manager() == "deb":
Expand All @@ -1092,13 +1099,16 @@ def write_job_for_platform(self, platform, args): # noqa: C901
if build_opts.is_darwin():
# brew is installed as regular user
sudo_arg = ""
tests_arg = "--no-tests "
if run_tests:
tests_arg = ""
out.write(
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive {manifest.name}\n"
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps {tests_arg}--recursive {manifest.name}\n"
)
if build_opts.is_linux() or build_opts.is_freebsd():
out.write(" - name: Install packaging system deps\n")
out.write(
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive patchelf\n"
f" run: {sudo_arg}python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps {tests_arg}--recursive patchelf\n"
)
required_locales = manifest.get(
"github.actions", "required_locales", ctx=manifest_ctx
Expand Down Expand Up @@ -1176,7 +1186,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
no_deps_arg = "--no-deps "

no_tests_arg = ""
if not args.enable_tests:
if not run_tests:
no_tests_arg = "--no-tests "

out.write(
Expand Down
7 changes: 7 additions & 0 deletions build/fbcode_builder/manifests/xxhash
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ sha256 = baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4
[rpms]
xxhash-devel

[debs]
libxxhash-dev
xxhash

[homebrew]
xxhash

[build.not(os=windows)]
builder = make
subdir = xxHash-0.8.2
Expand Down

0 comments on commit b59064f

Please sign in to comment.