diff --git a/.github/workflows/sapling-cli-getdeps_linux.yml b/.github/workflows/sapling-cli-getdeps_linux.yml new file mode 100644 index 0000000000000..c6aa57f4d0c67 --- /dev/null +++ b/.github/workflows/sapling-cli-getdeps_linux.yml @@ -0,0 +1,190 @@ +# This file was @generated by getdeps.py + +name: Sapling CLI Getdeps Linux + +on: + push: + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read # to fetch code (actions/checkout) + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Show disk space at start + run: df -h + - name: Free up disk space + run: sudo rm -rf /usr/local/lib/android + - name: Show disk space after freeing up + run: df -h + - 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 sapling + - name: Install packaging system deps + 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 bz2 + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests bz2 + - name: Fetch ninja + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ninja + - name: Fetch cmake + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake + - name: Fetch fmt + 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 python-six + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests python-six + - name: Fetch zstd + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zstd + - name: Fetch boost + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests boost + - name: Fetch double-conversion + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion + - name: Fetch fast_float + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fast_float + - name: Fetch gflags + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests gflags + - name: Fetch glog + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests glog + - name: Fetch libdwarf + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libdwarf + - name: Fetch libevent + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libevent + - name: Fetch lz4 + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests lz4 + - name: Fetch snappy + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests snappy + - name: Fetch zlib + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zlib + - name: Fetch openssl + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests openssl + - name: Fetch liboqs + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests liboqs + - name: Fetch autoconf + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests autoconf + - name: Fetch automake + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests automake + - name: Fetch libtool + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libtool + - name: Fetch libffi + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libffi + - name: Fetch ncurses + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ncurses + - name: Fetch python + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests python + - name: Fetch libsodium + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libsodium + - name: Fetch libiberty + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libiberty + - name: Fetch libunwind + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libunwind + - name: Fetch xz + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests xz + - name: Fetch folly + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests folly + - name: Fetch fizz + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fizz + - name: Fetch mvfst + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests mvfst + - name: Fetch wangle + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests wangle + - name: Fetch fbthrift + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fbthrift + - name: Fetch fb303 + 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 bz2 + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests bz2 + - name: Build ninja + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests ninja + - name: Build cmake + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests cmake + - name: Build fmt + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fmt + - name: Build googletest + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests googletest + - name: Build python-six + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests python-six + - name: Build zstd + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests zstd + - name: Build boost + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests boost + - name: Build double-conversion + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests double-conversion + - name: Build fast_float + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fast_float + - name: Build gflags + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests gflags + - name: Build glog + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests glog + - name: Build libdwarf + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libdwarf + - name: Build libevent + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libevent + - name: Build lz4 + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests lz4 + - name: Build snappy + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests snappy + - name: Build zlib + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests zlib + - name: Build openssl + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests openssl + - name: Build liboqs + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests liboqs + - name: Build autoconf + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests autoconf + - name: Build automake + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests automake + - name: Build libtool + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libtool + - name: Build libffi + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libffi + - name: Build ncurses + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests ncurses + - name: Build python + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests python + - name: Build libsodium + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libsodium + - name: Build libiberty + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libiberty + - name: Build libunwind + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests libunwind + - name: Build xz + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests xz + - name: Build folly + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests folly + - name: Build fizz + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fizz + - name: Build mvfst + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests mvfst + - name: Build wangle + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests wangle + - name: Build fbthrift + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fbthrift + - name: Build fb303 + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fb303 + - name: Build rust-shed + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests rust-shed + - name: Build sapling + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. sapling --project-install-prefix sapling:/usr/local + - name: Copy artifacts + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --strip --src-dir=. sapling _artifacts/linux --project-install-prefix sapling:/usr/local --final-install-prefix /usr/local + - uses: actions/upload-artifact@v4 + with: + name: sapling + path: _artifacts + - name: Test sapling + run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. sapling --project-install-prefix sapling:/usr/local + - name: Show disk space at end + run: df -h diff --git a/build/fbcode_builder/manifests/sapling b/build/fbcode_builder/manifests/sapling new file mode 100644 index 0000000000000..a146b1ac8ac2c --- /dev/null +++ b/build/fbcode_builder/manifests/sapling @@ -0,0 +1,68 @@ +[manifest] +name = sapling +fbsource_path = fbcode/eden +shipit_project = eden +shipit_fbcode_builder = true + +[git] +repo_url = https://github.com/facebook/sapling.git + +[build.not(os=windows)] +builder = make +subdir = eden/scm + +[build.os=windows] +# For now the biggest blocker is missing "make" on windows, but there are bound +# to be more +builder = nop + +[make.build_args] +getdepsbuild + +[make.install_args] +install-getdeps + +[make.test_args] +test-getdeps + +[shipit.pathmap] +fbcode/configerator/structs/scm/hg = configerator/structs/scm/hg +fbcode/configerator/structs/scm/hg/public_autocargo = configerator/structs/scm/hg +fbcode/eden/oss = . +fbcode/eden = eden +fbcode/eden/fs/public_autocargo = eden/fs +fbcode/eden/mononoke/public_autocargo = eden/mononoke +fbcode/eden/scm/public_autocargo = eden/scm +fbcode/tools/lfs = tools/lfs + +[shipit.strip] +^fbcode/configerator/structs/scm/hg(?!/public_autocargo).*/Cargo\.toml$ +^fbcode/eden/addons/.*$ +^fbcode/eden/fs/eden-config\.h$ +^fbcode/eden/fs/py/eden/config\.py$ +^fbcode/eden/hg-server/.*$ +^fbcode/eden/fs(?!/public_autocargo).*/Cargo\.toml$ +^fbcode/eden/mononoke(?!/public_autocargo).*/Cargo\.toml$ +^fbcode/eden/scm(?!/public_autocargo|/edenscmnative/bindings).*/Cargo\.toml$ +^fbcode/eden/scm/build/.*$ +^fbcode/eden/website/.*$ +^fbcode/eden/.*/\.cargo/.*$ +^.*/facebook/.*$ +^.*/fb/.*$ +/Cargo\.lock$ +\.pyc$ + +[dependencies] +fb303 +fbthrift +rust-shed + +[dependencies.not(os=windows)] +python + +# We use the system openssl on linux +[dependencies.not(os=linux)] +openssl + +[dependencies.fbsource=on] +rust diff --git a/eden/scm/.gitignore b/eden/scm/.gitignore index 4ff2a6121f1c3..cf441f066fe74 100644 --- a/eden/scm/.gitignore +++ b/eden/scm/.gitignore @@ -85,6 +85,7 @@ target/ wheelhouse/ *.pc/ +sapling.egg-info/ # hackable windows distribution additions hg-python diff --git a/eden/scm/Makefile b/eden/scm/Makefile index a10d1b7fa1253..72ec0449d8452 100644 --- a/eden/scm/Makefile +++ b/eden/scm/Makefile @@ -138,8 +138,8 @@ wheel: FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG) getdepsbuild: - mkdir -p $(GETDEPS_BUILD_DIR)/eden_scm - ln -sfn $(GETDEPS_BUILD_DIR)/eden_scm build + mkdir -p $(GETDEPS_BUILD_DIR)/sapling + ln -sfn $(GETDEPS_BUILD_DIR)/sapling build GETDEPS_BUILD=1 \ PYTHON_SYS_EXECUTABLE=$(shell $(PYTHON3) contrib/pick_python.py $(PYTHON3)) \ THRIFT="$(GETDEPS_INSTALL_DIR)/fbthrift/bin/thrift1" \ @@ -176,6 +176,13 @@ install-getdeps: getdepsbuild GETDEPS_BUILD=1 $(shell $(PYTHON3) contrib/pick_python.py $(PYTHON3)) \ setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --install-lib="$(PREFIX)/bin" --force +.PHONY: test-getdeps +test-getdeps: + # Run indicative tests to check the binary is minimally good as will be used later in Mononoke getdeps tests + # Running all the tests requires a bit of filtering to run the good set (or deleting flaky ones) + cd tests && PYTHON_SYS_EXECUTABLE=$(shell $(PYTHON3) contrib/pick_python.py $(PYTHON3)) \ + $(shell $(PYTHON3) contrib/pick_python.py $(PYTHON3)) run-tests.py -j2 --getdeps-build --with-hg="$(PREFIX)/bin/$(HGNAME)" test-status.t test-commit.t + check: tests .PHONY: tests