1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-01 10:26:51 +03:00

143 Commits

Author SHA1 Message Date
26616c4c75 getdeps: update github windows runner and internal CI to VS 2022
Summary:
X-link: https://github.com/facebookincubator/fizz/pull/163

The github [windows-2019 actions image was retired by github](https://github.com/actions/runner-images/issues/12045),  so all jobs on it fail

Update to windows-2022 to get them running again

windows-2022 has [different tools and versions than windows-2019](https://github.com/actions/runner-images/issues/3949).  Notably it moves from Visual Studio 2019 (aka msvc 16.x) to Visual Studio 2022 (aka msvc 17.x), hence the update to buildopts.py discovery

In the course of regenerating the github actions I also fixed a couple of issues that stopped regeneration matching repo contents
  * a few workflows were using workflow_dispatch, added support
  * there were a trailing and double spaces for project_prefix, fixed (use ignore whitespace to remove this from review!)

Reviewed By: bigfootjon, yfeldblum

Differential Revision: D78019509

fbshipit-source-id: f8b0e9438bfc6b481b4207ad82bc1002e496a2d9
2025-07-09 22:23:08 -07:00
603a3a6686 fix(fbcode_builder): fail the build when cmake build fails
Summary:
This change causes fbcode_builder (getdeps.py) to fail immediately on most non-zero error codes from delegated commands.

While internal tools may be able to surface failures in a build that doesn't fail fast, the debug cycle is difficult externally -- this makes failures pop out more easily and has been instrumental in debugging OSS build issues.

X-link: https://github.com/facebook/sapling/pull/1099

Differential Revision: D77608371

Pulled By: quark-zju

fbshipit-source-id: e9fc00a574bc64fbc165a22e51406e85d015e2ae
2025-07-03 14:28:13 -07:00
4f0db407cf feat(fbcode_builder): Enable python pex archives to allow native library dependencies
Summary:
Fixes integration test failure due to lack of a functioning
python-psutil (on Linux, this requires the inclusion of native code
which is not permitted in a zipapp).

X-link: https://github.com/facebook/sapling/pull/1100

Reviewed By: zzl0

Differential Revision: D77674102

Pulled By: quark-zju

fbshipit-source-id: 11ac197d8c4082eaf16e0e28bc1a45c67f7dbb07
2025-07-03 11:01:44 -07:00
7de0314b74 cachelib: regenerate github actions
Summary:
X-link: https://github.com/facebook/CacheLib/pull/388

Regenerate github actions.  Adds --runs-on arg to pass runs-on: parameter cachelib needs

Reviewed By: pbhandar2

Differential Revision: D75015742

fbshipit-source-id: af5803fa95fd4c2b9f25a7eaa817ffe2d135d23c
2025-05-19 17:05:48 -07:00
e1dc78a2a5 Dynamically determine and copy dependencies in package-fboss.py
Summary:
X-link: https://github.com/facebook/fboss/pull/387

We want to copy libraries identified by ldd rather than the hardcoded mapping we have right now in package-fboss.py. These need to be packaged alongside the binaries as they are dynamically linked.

Reviewed By: paulcruz74

Differential Revision: D72731449

fbshipit-source-id: 79748615b7b0970269a5663b17f2102c6f537ffa
2025-04-23 12:53:51 -07:00
68fffb16d7 preserve http_proxy in generated github actions sudo invocatons
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1102

make it possible to run the generated github actions locally with [act](https://github.com/nektos/act) when behind a proxy by preserving http_proxy in generated github actions sudo invocatons

also updated to consistently write `apt-get` instead of the interactive `apt` (we had a mix)

example usage (substitute myproxy for your actual proxy):
```
mkdir $HOME/act-artifacts
cd ~/fizz
time act -r -j build -W .github/workflows/getdeps_linux.yml --artifact-server-path=$HOME/act-artifacts --artifact-server-addr=127.0.0.1 --cache-server-addr=127.0.0.1 --env http_proxy=http://myproxy:8080 --env https_proxy=myproxy:8080 --action-offline-mode
```

Reviewed By: bigfootjon

Differential Revision: D67864689

fbshipit-source-id: 45695675ca5672e56104c8c33803afe004ff98da
2025-01-07 02:43:19 -08:00
d4355c4300 add github actions caching
Summary:
X-link: https://github.com/facebook/sapling/pull/1005

Speed up github builds with github actions CI caching based on the cache-key mechanism already present in getdeps.

Cached fizz windows build completed in 22% of original time,  linux build in 54% of the original time,  and mac in 72% of original time.  This saves a lot of waiting around for PR builds on OSS changes as windows signal is usually the lagging one.  Speed ups will vary across the different Meta OSS projects.

Windows benefits most from caching dependencies as we don't use system packages there at all,  linux next as its default runner is slower than mac, and then finaly mac (the strongest hardware of the default github runners).

Github allows [up to 10GB cache per repo](https://github.blog/changelog/2021-11-23-github-actions-cache-size-is-now-increased-to-10gb-per-repository/), expiring data over capacity.  You can see the size of the caches generated in the [caches view of githhub actions UX](https://github.com/ahornby/fizz/actions/caches?query=sort%3Asize-desc),  looks like our usage is pretty small so far.

More background:
Github actions caching decides its own compression format (currently it prefers zstd), but they are free to change that in future, hence no .zstd suffix or similar on the cache keys.

Github actions caches from main are used from feature branches but not vice versa, hence a PR can't pollute cache for the trunk build.  This allows us to benefit from caching on main and PRs where dependency versions match.

The final item being built, and dependencies inside the same repo as the final are not cached.  A different mechanism would be necessary for those (e.g. using a tool like ccache/sccache or caching cargo/buck2 output).  This means that when building EdenFS, sapling could not be cached (its in the same repo), but folly could be as we have a key for it based on the folly-rev.txt file.

When there is a cache hit the build step is skipped using extension of the conditionals introduced in previous diff D67839708

Reviewed By: bigfootjon

Differential Revision: D67839730

fbshipit-source-id: c384a216eb27ccd3f816e3c31b167232bda571a6
2025-01-06 15:15:49 -08:00
ebb3bbc12d skip unnecessary github actions steps
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1100

Update generated github actions to only run the fetch and and build steps when there are sources expected for a manifest

For local github actions testing using `act` this speeds up the test runs, and in real github CI it makes it clearer which steps are actually doing something on the given runner (we don't know exactly what it has installed beforehand)

Also set the windows git config the same as on internal CI

Reviewed By: bigfootjon

Differential Revision: D67839708

fbshipit-source-id: 0a60c6fc89e8c6abb2464f879459aa23d5aec969
2025-01-06 11:16:30 -08:00
38454e0f22 Follow-up to earlier commit to change label to 8-core
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1086

Discussed with Opensource team further. 4-core-ubuntu-22.04 label does not work since it does not exist and runners can work only with the allocated list of labels.

Opensource team has now added necessary label, is added for 8-core as requested. So, now making code change for good, hopefully!

https://fb.workplace.com/groups/osssupport/permalink/27367197886235467/

Reviewed By: xiangxu1121

Differential Revision: D66487987

fbshipit-source-id: 62fa2b60b5613876aaa1f0c1a47dde8826746926
2024-12-06 22:16:27 -08:00
1cf2c66666 make openssl install less confusing, align openssl version
Summary:
X-link: https://github.com/facebookincubator/fizz/pull/152

X-link: https://github.com/facebookincubator/zstrong/pull/1073

On linux getdeps uses system openssl,  on macOS we mostly use the homebrew one on github CI. Both of these are openssl3.x,  however the fallback build from source version is still set as openssl1.1.  This can be confusing, giving the impression getdeps based builds need openssl1.1
* Update the openssl manifest source url to openssl-3.0.15,  this version picked to match the ubuntu 22.04 LTS system packages.

The other potentially confusing part was that the openssl source tarball was downloaded even when on on a platform like Linux where openssl is always taken from the system packages.
* Make the download configurable so that does nothing if satisfied from system packages, and no need to check the cache.

Reviewed By: ckwalsh

Differential Revision: D66495352

fbshipit-source-id: 4d24bb82bfabe44c7764b819de7f4a05f80daed1
2024-12-02 01:42:44 -08:00
5a007c0e3b getdeps: add env subcommand
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1025

Add getdeps.py `env` subcommand to get the environment from getdeps in a sourcable form so that its easier to run/test/debug the binaries

There is an existing `debug` subcommand, but it starts an interactive shell inside getdeps, which isn't so useful for programatic use.

To get the output clean enough to source I switched getdeps print() logging to go to stderr.

example usage:
```
$ (source <(./build/fbcode_builder/getdeps.py --allow-system-packages env mononoke_integration); which mononoke)
```

Reviewed By: jdelliot

Differential Revision: D64982397

fbshipit-source-id: 65212936d42185e4d395557b56d3dba499caa128
2024-10-27 05:01:22 -07:00
3860d2e77c 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
2024-10-14 12:17:46 -07:00
295872b122 run .t tests for getdeps sapling cli build
Summary:
Connect up the sapling *.t tests so that github CI has visible cli test status.

To get them to run:
 * some needed fbpython on path. I included a shim for that in the test makefile target.
 * test-rust-hooks: Command not found message,  added a glob
 * test-identity.t: add a glob for the sapling version
 * test-eolfilename.t: output order was unstable, added sorts to make stable
 * helpers-testrepo.sh: fix assumption that system hg would be able to read test repo, check if its Sapling first.
 * added a manifest for the hexdump utility some of the tests required
 * excluded a few remaining tests (see comments in Makefile for reason)
 * fixed getdeps support for generating actions steps for test only dependencies

NB  the tests run as "hg".  The expectations would need to be updated if we were to run as "sl"

X-link: https://github.com/facebook/sapling/pull/963
X-link: https://github.com/facebookincubator/zstrong/pull/1004

Reviewed By: quark-zju

Differential Revision: D63958737

Pulled By: ahornby

fbshipit-source-id: 75c0d39258c320100d8d02b31390994bc2f3a3ce
2024-10-07 13:46:20 -07:00
d9f683feb9 restore mononoke getdeps integration tests
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/995

Bring back mononoke getdeps integration tests.  This is a refesh of the previously working export-D34186407 branch from 2022

Main changes since:
 * depend on restored sapling manifest from previous commit
 * bring back selected manifests needed by mononoke that were deleted in D51869247. I added the sqlite binary packages from this to the sqlite3 manifest rather than bring back the sqllite3-bin manifest
 * add manifests for new tools used: ripgrep, git-lfs, and zstd cli (we already had the zstd libs)
 * fix a few test expecations that where too closely tied to git cli or TLS version etc (ubuntu 22.04 is on older version)
 * getdeps MakefileBuilder.run_tests() improvements
   * fix error status reporting, was not failing if tests failed
   * pass of --num-jobs to tests to stop it OOMing my machine
   * pass of --filter to tests so can iterate on one test more easily

Can to iterate local execution for one test with:
```
python3 ./build/fbcode_builder/getdeps.py test --num-jobs 4 --allow-system-packages --no-facebook-internal --src-dir=. mononoke_integration --retry 0 --filter server/test-gettreepack.t
```

X-link: https://github.com/facebook/sapling/pull/951

Reviewed By: quark-zju

Differential Revision: D62978526

Pulled By: ahornby

fbshipit-source-id: 0070a67d798bb23ee9e78e1a5149ba5364d548c9
2024-09-20 15:35:26 -07:00
99ca509365 fix project_install_prefix for generate-github-actions
Summary:
X-link: https://github.com/facebook/sapling/pull/952

fix getdeps generate-github-actions by adding missing process_project_dir_arguments.  Without this couldn't specify any project_install_prefix other that the default /usr/local

mononoke installs directly to getdeps inst dir so needs a project_install_prefix of / for the artifact discovery to work

regenerated the gh actions with `python3 fbcode/opensource/fbcode_builder/getdeps.py generate-github-actions mononoke --os-type=linux --allow-system-packages --output-dir fbcode/eden/oss/.github/workflows --job-file-prefix mononoke_ --job-name-prefix "Mononoke " --free-up-disk --project-install-prefix mononoke:/`

Resolves https://github.com/facebook/sapling/issues/922

Reviewed By: bigfootjon

Differential Revision: D63031271

fbshipit-source-id: 768a4fbd7617c6061eca66b4d916ac25a4b66be9
2024-09-20 10:39:23 -07:00
879664a286 Fix actions/upload-artifact deprecation
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/970

actions/upload-artifact < v4 is deprecated and will not be supported after November 30, 2024.[1] Migrate to v4 instead -- the API used by fbcode_builder is not changed by this version bump.

[1] https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

X-link: https://github.com/facebook/folly/pull/2284

Reviewed By: yfeldblum

Differential Revision: D61730024

Pulled By: Orvid

fbshipit-source-id: 37eb13c6257a233ae170aa44aadeeb35a01568b1
2024-08-29 18:07:25 -07:00
da8d696080 Support of Arch Linux in getdeps.py
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/907

I don't sure that I make all in accordance with the your contribution pipeline, so please correct me If there is needed.
So, I've made some changes to support the `pacman` package manager in your `getdeps.py` script. In `manifests` I'm also duplicated some packages from `debs` and `rpms` sections and create a new `pps` sections with according packages for  `pacman`.

Issue:  https://github.com/facebook/folly/issues/1701

X-link: https://github.com/facebook/folly/pull/1702

Reviewed By: yfeldblum

Differential Revision: D33514769

Pulled By: Orvid

fbshipit-source-id: a081c3a5bcb7f7cdde3a4a91c0d15517c0a171b3
2024-07-15 13:50:07 -07:00
3dfff8fb84 CI: enable clang tests (#898)
Summary: Pull Request resolved: https://github.com/facebookincubator/zstrong/pull/898

Reviewed By: malanka

Differential Revision: D59065671

fbshipit-source-id: 2a09ae13e1d4c62a7b9a907cca0e911672435ad1
2024-07-03 08:57:21 -07:00
6790282a52 Refactoring
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/897

Builder refactoring: instead of providing `install_dirs` to `build()`, `test()` etc., provide `loader` and `dep_manifests` when creating the builder. This is a cleaner API because we were computing `install_dirs` in multiple places before.

Furthermore this lets us do things that need to see the manifests of the dependencies, not just the list of `install_dirs`, such as treating direct dependencies differently from indirect dependencies (see D58244928).

Reviewed By: chadaustin

Differential Revision: D58200528

fbshipit-source-id: e52d35e84161b83ab49ab43099c3e3b9bb03f36e
2024-06-26 17:02:17 -07:00
42696ea895 debug doesn't require build first
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/870

brainfart

Reviewed By: chadaustin

Differential Revision: D58200715

fbshipit-source-id: ccb02285e672e3e638e6eda92fc0610eb903cb69
2024-06-06 07:50:05 -07:00
33643225be Add debug command
Summary:
Starts a shell in the build dir, with the environment set up in the
same way as for the build. Useful for experimenting and testing.

Reviewed By: chadaustin

Differential Revision: D58082246

fbshipit-source-id: 82b275401528d7616c2560d80b4c187de67f6032
2024-06-04 13:57:07 -07:00
7a68727398 --extra-cmake-defines should be a global flag
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/858

Because it needs to be passed to other commands that use project
hashes, such as "test".

(in general there are probably a lot more of these, just fixing the
ones I've ran into so far)

Reviewed By: genevievehelsel

Differential Revision: D58082245

fbshipit-source-id: 09fa6b5ce4cc4b3ae7ecfb34ac83681cecb36e3c
2024-06-04 11:00:48 -07:00
f1d35639d6 --shared-libs should be a common argument
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/848

Because it should work with `show-inst-dir`, otherwise we can't
calculate the right project hash.

Reviewed By: chadaustin

Differential Revision: D58011867

fbshipit-source-id: d8960b4a993efbada8e27584e56976279fcd6b43
2024-06-01 07:29:20 -07:00
17acb46b52 reverse shebang
Summary: this runs on github... but also not what i really care about

Reviewed By: terrelln

Differential Revision: D57125977

fbshipit-source-id: 39d7fd319a0ce45a36ba11c4301f5a27356b6c9f
2024-05-08 15:10:30 -07:00
97ff7b02d5 bump repo ci to ubuntu-22.04
Summary:
X-link: https://github.com/facebook/folly/pull/2189

X-link: https://github.com/facebookincubator/zstrong/pull/782

Now that Ubuntu 24.04 LTS [has been released](https://ubuntu.com/blog/canonical-releases-ubuntu-24-04-noble-numbat), it is a suitable time to bump the version of Ubuntu used in CI to Ubuntu 22.04 LTS, which is the prior LTS.

Ubuntu 22.04 LTS ships with GCC 11.2, and is the first Ubuntu release to ship with a version of GCC that implements C++20 coroutines.

Reviewed By: chadaustin

Differential Revision: D57017204

fbshipit-source-id: ce5754e7dfc6cb066739bf164e725de8e21f8d24
2024-05-07 09:51:01 -07:00
fbf5f9adfb change python3 to fbpython
Summary:
there is a bunch of scripts that uses python3 to run, this means that they are at the mercy of whoever controll their path, in linux, this can be system python3, but can also be platform python (and probably it is both), and in windows in particular it abuses c:\tools\fb-python\python3.exe. fbpython is the universal way to run python at the company that chooses the right platform python, but also provides monitoring and observability.

this scripts generates jobs like

https://www.internalfb.com/sandcastle/job/18014399781484898/

that will stop working once we remove c:\tools\fb-python\python3*.exe

Reviewed By: fried

Differential Revision: D56896564

fbshipit-source-id: d911fdaf6750635adb05b096f0522603baf47bcc
2024-05-02 13:49:18 -07:00
4efce72184 Rebuild GitHub Actions workflows
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/749

Updating generated workflow files to account for recent changes. Most notably, this updates the checkout action to v4 and sets an explicit read-only permission.

This also adds support for `--cron` in the codegen to account for only running CI on a schedule (useful for managing costs).

Reviewed By: ahornby

Differential Revision: D56165825

fbshipit-source-id: 298b16effefb6b8a2dc6cbcf07d4ec4a61f48364
2024-04-24 15:36:57 -07:00
220ffee5db getdeps: support GETDEPS_WGET_ARGS in wget version, support skipping lfs/upload steps
Summary:
X-link: https://github.com/facebookincubator/katran/pull/229

X-link: https://github.com/facebookexperimental/edencommon/pull/18

X-link: https://github.com/facebook/sapling/pull/878

X-link: https://github.com/facebook/openr/pull/154

X-link: https://github.com/facebook/folly/pull/2177

X-link: https://github.com/facebookincubator/zstrong/pull/748

I found it useful to be able to set `GETDEPS_WGET_ARGS` to change some of the flags to `wget` while it's in that fetch mode :)
I also need to skip the lfs upload part in my environment

Reviewed By: mackorone

Differential Revision: D56263907

fbshipit-source-id: ae45c31ebb10123e0358544d294fe2f2979dd59a
2024-04-17 17:24:31 -07:00
f15e30b787 getdeps: add --build-type option to build in Debug or RelWithDebInfo mode
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/653

getdeps: add --build-type option to build in Debug or RelWithDebInfo mode

Adds a --build-type option so one can force RelWithDebInfo or Debug explicity

Default remains RelWithDebInfo for cmake.

cargo default is updated to --release to match cmake more closely, if you don't want release use --build-type Debug.

If you want to run github CI in Debug mode (faster build, but tests will run slower), then can pass --build-type Debug to getdeps.py generate-github-actions

X-link: https://github.com/facebook/sapling/pull/786

Reviewed By: mitrandir77

Differential Revision: D51564770

Pulled By: bigfootjon

fbshipit-source-id: ef30332ca193d9805bce005d12b5dbc9f58fcafc
2023-12-19 12:24:39 -08:00
044fe10bc1 opensource: getdeps: Add show-scratch-dir command
Summary:
X-link: https://github.com/facebookincubator/velox/pull/7446

Add a new command to show the location of the scratch dir that getdeps
will use.

Reviewed By: xavierd

Differential Revision: D51027807

fbshipit-source-id: 80a7cfc04320002588d5ec8964fc88914771c6c7
2023-11-07 06:41:39 -08:00
018b10ba1d use system patchelf in eden fs build
Summary:
X-link: https://github.com/facebookincubator/velox/pull/7072

use system patchelf in eden fs build

Saves us from doing a fetch and build of autoconf, libtool, automake and patchelf during the arfifacts part of CI

X-link: https://github.com/facebook/sapling/pull/750

Reviewed By: sggutier

Differential Revision: D50313417

Pulled By: genevievehelsel

fbshipit-source-id: 7c585357c848c15a65c5797d6c8750d1119b6efd
2023-10-16 12:10:14 -07:00
d57a95d41e fix CI warning about node12 by updating actions/checkout version
Summary:
X-link: https://github.com/facebookincubator/velox/pull/7071

fix CI warning about node12 by updating actions/checkout version

Update the actions/checkout version to fix build warning

X-link: https://github.com/facebook/sapling/pull/749

Reviewed By: sggutier

Differential Revision: D50313430

Pulled By: genevievehelsel

fbshipit-source-id: 4d55d36f7509be51bb4e26728ddbce8e45faba40
2023-10-16 12:10:14 -07:00
75c06de4eb GitHub Workflows security hardening
Summary:
X-link: https://github.com/facebookincubator/velox/pull/6969

This PR adds explicit [permissions section](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions) to workflows. This is a security best practice because by default workflows run with [extended set of permissions](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) (except from `on: pull_request` [from external forks](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an [injection](https://securitylab.github.com/research/github-actions-untrusted-input/) or compromised third party tool or action) is restricted.
It is recommended to have [most strict permissions on the top level](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) and grant write permissions on [job level](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) case by case.

X-link: https://github.com/facebook/watchman/pull/1071

Reviewed By: xavierd

Differential Revision: D50095358

Pulled By: genevievehelsel

fbshipit-source-id: 4fc80c6b7c48df08207f68420b48a90ffcfddf27
2023-10-11 09:21:32 -07:00
d69b7ce154 Upgrade to boost 1.83
Summary:
X-link: https://github.com/facebookincubator/velox/pull/6943

Update to boost 1.83.  This addresses a folly build failure on Xcode 15, due to
boost 1.78 referring to the removed std::unary_function.

Reviewed By: jdelliot

Differential Revision: D49972186

fbshipit-source-id: 8d9fdd27c24ccc5a072b6973b86e0c8ed5b77ac3
2023-10-09 12:31:42 -07:00
35714fcbbb fix getdeps actions generation for rust toolchain
Summary:
X-link: https://github.com/facebookincubator/velox/pull/6924

fix getdeps actions generation for rust toolchain

Generated actions files created from getdeps.py were missing rust toolchain which meant annoying manual edits

This change also makes the github actions generation honor the --no-tests argument, which is useful  when regenerating the edenfs actions

X-link: https://github.com/facebook/sapling/pull/682

Reviewed By: sggutier

Differential Revision: D49875258

Pulled By: genevievehelsel

fbshipit-source-id: 173f86083ba92bab4063813d3e392df428b9ffe4
2023-10-06 21:20:06 -07:00
0ad429a261 allow getdeps github actions to free up disk
Summary:
X-link: https://github.com/facebookincubator/velox/pull/6927

allow getdeps github actions to free up disk

Allow getdeps to free up some disk from the runner and intermediate build steps as some runs (notably the linux eden and mononoke ones) are hitting disk space limits

X-link: https://github.com/facebook/sapling/pull/689

Reviewed By: sggutier

Differential Revision: D49875256

Pulled By: genevievehelsel

fbshipit-source-id: b85b6b2f11857670915b64f47d3c0abd4ca8ca31
2023-10-06 21:20:06 -07:00
d3102141dc Fix typos discovered by codespell
Summary:
`codespell --ignore-words-list=arithmetics,atleast,crate,crated,deriver,ect,hel,onl,startin,whats --skip="*.lock"`
* https://pypi.org/project/codespell

X-link: https://github.com/facebookincubator/mvfst/pull/307

Reviewed By: hanidamlaj, lnicco

Differential Revision: D47809078

Pulled By: kvtsoy

fbshipit-source-id: 566557f2389746db541ff265a5dec8d6404b3701
2023-07-26 17:10:41 -07:00
55f4585d07 Back out "Fix typos discovered by codespell"
Summary:
Original commit changeset: 337824bc37bc

Original Phabricator Diff: D47722462

Reviewed By: jbeshay, terrelln, lnicco

Differential Revision: D47801753

fbshipit-source-id: 795ffcccbc2223608e2a707ec2e5bcc7dd974eb3
2023-07-26 12:49:13 -07:00
4246f00ff1 Re-sync with internal repository (#456)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-07-25 10:04:09 -07:00
80fd72f767 fix-ci: move from unmaintained actions-rs to a maintained alternative
Summary:
Unfortunately `actions-rs` is [unmaintained](https://github.com/actions-rs/toolchain/issues/216) and I am trying to advocate a move from actions-rs to its maintained alternative such as https://github.com/dtolnay/rust-toolchain across the community.

X-link: https://github.com/facebook/hhvm/pull/9369

Reviewed By: dtolnay

Differential Revision: D46326694

Pulled By: dtolnay

fbshipit-source-id: 2f08553539fba083e5ec90662328d69b78e19b44
2023-07-04 16:07:50 -07:00
d3eb1a3d72 Use sudo when installing dependencies on Linux (#4796)
Summary:
X-link: https://github.com/facebookincubator/velox/pull/4796

`brew` no longer supports running as root:

```
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
Command '['brew', 'install', 'autoconf', 'automake', 'boost', 'cmake', 'double-conversion', 'icu4c', 'libevent', 'libsodium', 'libtool', 'lz4', 'ninja', 'openssl@1.1', 'xz', 'zlib', 'zstd']' returned non-zero exit status 1.
!! Failed
```

And as a result the recommended install instructions no longer work:

```
sudo ./build/fbcode_builder/getdeps.py install-system-deps ...
```

and cannot be made to work portably across platforms because Linux requires `sudo` be there while macOS requires `sudo` not be there.

To fix this move `sudo` to Linux system dependency installation only.

Also update `apt-get` to `apt` while at it.

Resolves https://github.com/facebook/fbthrift/issues/545.

Reviewed By: somasun

Differential Revision: D45371004

fbshipit-source-id: 75334db22226efc961e7d4d6c6eca911086b97ba
2023-05-01 09:30:16 -07:00
3573a0587c Only upload cached projects with built_marker (#4087)
Summary:
X-link: https://github.com/facebookincubator/velox/pull/4087

Under some circumstances, getdeps can cache a project artifact
where there is no built_marker, forcing the script to re-build the artifact
from source.  After D43260530 (47dde7c249) this no longer causes a build failure, but it can
still make builds take longer than they should.

This ensures we only cache artifacts with a built_marker, so that they aren't
overwritten by artifacts without.

Reviewed By: genevievehelsel

Differential Revision: D43405855

fbshipit-source-id: b1b9e194e642fa820d0fbc54a7c15ff81fc90a82
2023-02-22 18:50:08 -08:00
9bcc1277d4 Pyvelox sphinx documentation (#3363)
Summary:
This is the initial PR to integrate PyVelox documentation.

X-link: https://github.com/facebookincubator/velox/pull/3363

Reviewed By: Yuhta

Differential Revision: D43483032

Pulled By: kgpai

fbshipit-source-id: f632974161b0c71c461415d239b1fa3726bb8299
2023-02-22 14:40:00 -08:00
47dde7c249 Fetch source archive if cached artifact's built_marker is missing (#4035)
Summary:
X-link: https://github.com/facebookincubator/velox/pull/4035

If getdeps finds a cached build artifact, it currently skips fetching the
source archive, which is done by calling `fetcher.update()`:
https://www.internalfb.com/code/fbsource/[f64171219e95f47c81929cde0a09e720e079dd31]/fbcode/opensource/fbcode_builder/getdeps.py?lines=691

But without the built_marker, the script will still create a builder for the
artifact:
https://www.internalfb.com/code/fbsource/[f64171219e95f47c81929cde0a09e720e079dd31]/fbcode/opensource/fbcode_builder/getdeps.py?lines=600

This then fails when the builder tries to extract the missing source archive.
In Boost's case:
https://www.internalfb.com/code/fbsource/[f64171219e95f47c81929cde0a09e720e079dd31]/fbcode/opensource/fbcode_builder/getdeps/builder.py?lines=1021

This logic seems to have been broken for a while, but became a problem after
watchman's Windows build started finding cached boost and ninja artifacts that
were missing the built_marker, presumably uploaded by other projects as a
result of D42996394 (db79e34cc7).

This change fixes the broken watchman build, but itself doesn't get us back to
using cached artifacts.

Reviewed By: kmancini

Differential Revision: D43260530

fbshipit-source-id: ac0072f213a534aada4046d34fe090510fc5d618
2023-02-16 11:31:40 -08:00
db79e34cc7 Update the built_marker hashing logic only for current project (#3934)
Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/3934

Reviewed By: shri-khare

Differential Revision: D42996394

fbshipit-source-id: e4fe54ba6e7f51b4fc640bf80bbb18b257903b1c
2023-02-03 10:43:23 -08:00
4761c000af Update build_marker only if specific cmake-target is not requested (#3788)
Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/3788

Reviewed By: chadaustin

Differential Revision: D42637430

fbshipit-source-id: 6997a537a0f924b068551c244463082b3e105be6
2023-01-24 16:44:43 -08:00
730dad1340 Enable building specific cmake targets (#3759)
Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/3759

Reviewed By: chadaustin

Differential Revision: D42551680

fbshipit-source-id: 4e5c5bef2ad2997e04ab8fb8db4ef7fbeda0bcab
2023-01-19 18:03:58 -08:00
5d10b9a536 automation should use apt-get instead of apt
Summary:
Automation should use `apt-get` instead of `apt`, as `apt` does not
have a stable interface.

This fixes a warning when running getdeps.py on recent Ubuntu:

```
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
```

Reviewed By: fanzeyi

Differential Revision: D39031719

fbshipit-source-id: 54a0fe51ce159174b089fc446e99a4ab5d69d626
2022-08-25 15:19:18 -07:00
4333130372 upgrade getdeps GitHub actions to Ubuntu 20 (#516)
Summary:
X-link: https://github.com/facebook/fbthrift/pull/516

X-link: https://github.com/facebook/watchman/pull/1050

Pull Request resolved: https://github.com/facebook/proxygen/pull/426

X-link: https://github.com/facebook/folly/pull/1842

X-link: https://github.com/facebook/fboss/pull/117

Sadly, even though Ubuntu 18.04 is still in LTS, GitHub is deprecating
its runner image.

Migrate the generated GitHub Actions to 20.04.

https://github.com/actions/runner-images/issues/6002

https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/

Reviewed By: fanzeyi

Differential Revision: D38877286

fbshipit-source-id: 85f3324d6666eacb190a43985585b438de69d545
2022-08-22 10:05:10 -07:00
6495a90f93 disable autocrlf on Windows jobs
Summary:
In D36905191 (6e6bf12f62), getdeps gained the ability to apply patches on Windows.

However, on GitHub Action workers, `core.autocrlf` is turned on by default. This means the patch files we checked in will end up having CRLF endings while the source code we downloaded are still in LF endings, and `git apply` doesn't like that.

This diff teaches getdeps to disable `core.autocrlf` in GitHub Action Windows workers.

Reviewed By: vitaut

Differential Revision: D37008387

fbshipit-source-id: 34c9f89e8783d0613040d190c4ad3477bd7bfd53
2022-06-08 13:18:38 -07:00