From 58924b55cc777e898797c5ee039056bc349b62d2 Mon Sep 17 00:00:00 2001 From: Alex Hornby Date: Mon, 14 Oct 2024 12:17:46 -0700 Subject: [PATCH] getdeps: add xxhash ubuntu and homebrew packages, fix actions generation and regenerate Summary: X-link: https://github.com/facebookincubator/zstrong/pull/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: https://github.com/facebook/sapling/pull/966 Reviewed By: genevievehelsel Differential Revision: D64302134 Pulled By: ahornby fbshipit-source-id: 3384dab4f31e202881310e2b5369bb23fb533a1b --- build/fbcode_builder/getdeps.py | 18 ++++++++++++++---- build/fbcode_builder/manifests/xxhash | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 8a42fcd43c..ef81d3c3c8 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -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) @@ -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": @@ -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 @@ -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( diff --git a/build/fbcode_builder/manifests/xxhash b/build/fbcode_builder/manifests/xxhash index 8e490011e5..557ded0ddd 100644 --- a/build/fbcode_builder/manifests/xxhash +++ b/build/fbcode_builder/manifests/xxhash @@ -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