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

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.  Fix it and regenerate

X-link: facebook/sapling#966

Reviewed By: genevievehelsel

Differential Revision: D64302134

Pulled By: ahornby

fbshipit-source-id: 3384dab4f31e202881310e2b5369bb23fb533a1b
  • Loading branch information
ahornby authored and facebook-github-bot committed Oct 14, 2024
1 parent 82da352 commit ca63dcd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
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 ca63dcd

Please sign in to comment.