Skip to content

Commit

Permalink
restore sapling getdeps build with thrift
Browse files Browse the repository at this point in the history
Bring it back so we can to
   a) test eden fs and mononoke as their tests need the hg binary and thus a sapling manifest to depend upon
   b) change to thrift files in OSS space, as it runs thrift compiler rather than using pre-compiled thrift output.

Started with backout of 73302ef and badf6d1, and then generated actions with:

`./build/fbcode_builder/getdeps.py --allow-system-packages generate-github-actions --free-up-disk --os-type=linux --src-dir=. --output-dir=.github/workflows --job-name "Sapling w/ Thrift " --job-file-prefix=sapling-with-thrift_ sapling`

Test plan:

Build locally with: `./build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --src-dir=. sapling`

CI
  • Loading branch information
ahornby committed Oct 14, 2023
1 parent c0248fa commit 94d33d8
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 0 deletions.
164 changes: 164 additions & 0 deletions .github/workflows/sapling-with-thrift_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# This file was @generated by getdeps.py

name: Sapling w/ Thrift Linux

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:
runs-on: ubuntu-20.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 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 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 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 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 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 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 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 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 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@v2
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
68 changes: 68 additions & 0 deletions build/fbcode_builder/manifests/sapling
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions eden/scm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ 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

test-getdeps: install-getdeps
# Run one test 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 -j1 --getdeps-build --with-hg="$(PREFIX)/bin/$(HGNAME)" test-status.t test-convert.t

check: tests

.PHONY: tests
Expand Down

0 comments on commit 94d33d8

Please sign in to comment.