Skip to content

Commit

Permalink
fix edenfs oss build
Browse files Browse the repository at this point in the history
Fix edenfs OSS build to stop it breaking on every PR.  Fixes:

edenfs has a dependency on mvfst but it was missing a find_package() call to add it.

edenfs manifest needs sapling as a test dependency not a build dependency.  This was unnecessarily breaking the edenfs build as sapling getdeps build is currently broken

Added the mvfst dep to the manifest and regenerated the github actions file with: `./build/fbcode_builder/getdeps.py --allow-system-packages generate-github-actions --no-tests --os-type=linux --src-dir=. --output-dir=.github/workflows --job-name "EdenFS " --job-file-prefix=edenfs_ eden`

Missing a declared dep on edencommon in the rpc code CMakeLists.txt, this fixed missing edencommon headers

There was a GCC incompability in ImmediateFuture.h, enum needed to be public to make it build.

RIngBuffer.h was missing the size_t type causing its test to fail to build, so included it

Repo urls hadn't been updated in eden and mononoke manifests, which means actions generation didn't know they were in same checkout.

Test plan:

Run locally: `./build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. eden`

Run a PR.   Before, broken with missing mvfst, e.g. https://github.com/facebook/sapling/actions/runs/5493408315/jobs/10011553849
```
CMake Error at build/fbcode_builder/CMake/FBThriftCppLibrary.cmake:148 (target_link_libraries):
  Target "eden_service_thrift_cpp" links to:

    mvfst::mvfst_server_async_tran

  but the target was not found.  Possible reasons include:
```

After, works
  • Loading branch information
ahornby committed Jul 12, 2023
1 parent dcbdb13 commit 5dc53b3
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 39 deletions.
52 changes: 25 additions & 27 deletions .github/workflows/edenfs_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
run: sudo apt-get update
- name: Install system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive eden
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- 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 blake3
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests blake3
- name: Fetch cpptoml
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cpptoml
- name: Fetch gflags
Expand Down Expand Up @@ -79,12 +79,6 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests nghttp2
- name: Fetch libcurl
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libcurl
- 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
Expand All @@ -93,22 +87,28 @@ jobs:
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 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 edencommon
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests edencommon
- 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: Fetch sapling
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests sapling
- name: Fetch edencommon
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests edencommon
- name: Build ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests ninja
- name: Build cmake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests cmake
- name: Build blake3
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests blake3
- name: Build cpptoml
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests cpptoml
- name: Build gflags
Expand Down Expand Up @@ -163,12 +163,6 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests nghttp2
- name: Build libcurl
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libcurl
- name: Build libffi
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libffi
- name: Build ncurses
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests ncurses
- name: Build python
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests python
- name: Build libsodium
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libsodium
- name: Build xz
Expand All @@ -177,20 +171,24 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests folly
- name: Build fizz
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fizz
- name: Build mvfst
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests mvfst
- name: Build libffi
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libffi
- name: Build ncurses
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests ncurses
- name: Build python
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests python
- name: Build edencommon
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests edencommon
- name: Build wangle
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests wangle
- name: Build fbthrift
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fbthrift
- name: Build fb303
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fb303
- name: Build rust-shed
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests rust-shed
- name: Build sapling
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests sapling
- name: Build edencommon
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests edencommon
- name: Build eden
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. eden --project-install-prefix eden:/usr/local
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests --src-dir=. eden --project-install-prefix eden:/usr/local
- name: Copy artifacts
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --strip --src-dir=. eden _artifacts/linux --project-install-prefix eden:/usr/local --final-install-prefix /usr/local
- uses: actions/upload-artifact@v2
Expand Down
3 changes: 3 additions & 0 deletions CMake/EdenConfigChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ include_directories(${WANGLE_INCLUDE_DIR})
find_package(FBThrift CONFIG REQUIRED COMPONENTS cpp2 py)
include_directories(${FBTHRIFT_INCLUDE_DIR})

find_package(mvfst CONFIG REQUIRED)
include_directories(${MVFST_INCLUDE_DIR})

find_package(GMock MODULE REQUIRED)
include_directories(${GMOCK_INCLUDEDIR} ${LIBGMOCK_INCLUDE_DIR})
include(GoogleTest)
Expand Down
8 changes: 6 additions & 2 deletions build/fbcode_builder/getdeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,12 @@ def write_job_for_platform(self, platform, args): # noqa: C901
if has_same_repo_dep:
no_deps_arg = "--no-deps "

no_tests_arg = ""
if not args.enable_tests:
no_tests_arg = "--no-tests "

out.write(
f" run: {getdepscmd}{allow_sys_arg} build {no_deps_arg}--src-dir=. {manifest.name} {project_prefix}\n"
f" run: {getdepscmd}{allow_sys_arg} build {no_tests_arg}{no_deps_arg}--src-dir=. {manifest.name} {project_prefix}\n"
)

out.write(" - name: Copy artifacts\n")
Expand All @@ -1106,7 +1110,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
out.write(" name: %s\n" % manifest.name)
out.write(" path: _artifacts\n")

if manifest.get("github.actions", "run_tests", ctx=manifest_ctx) != "off":
if args.enable_tests and manifest.get("github.actions", "run_tests", ctx=manifest_ctx) != "off":
out.write(" - name: Test %s\n" % manifest.name)
out.write(
f" run: {getdepscmd}{allow_sys_arg} test --src-dir=. {manifest.name} {project_prefix}\n"
Expand Down
5 changes: 3 additions & 2 deletions build/fbcode_builder/manifests/eden
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ shipit_project = eden
shipit_fbcode_builder = true

[git]
repo_url = https://github.com/facebookexperimental/eden.git
repo_url = https://github.com/facebook/sapling.git

[github.actions]
run_tests = off
Expand All @@ -30,6 +30,7 @@ pexpect
python-toml
python-filelock
edencommon
mvfst

[dependencies.fbsource=on]
rust
Expand All @@ -52,7 +53,7 @@ libcurl
# Added so that OSS doesn't see system "python" which is python 2 on darwin and some linux
python

[dependencies.all(fb=off)]
[dependencies.all(test=on,fb=off)]
# Outside Meta hg is not installed, or if it is, its not the one we want to test with
sapling

Expand Down
2 changes: 1 addition & 1 deletion build/fbcode_builder/manifests/mononoke
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ shipit_project = eden
shipit_fbcode_builder = true

[git]
repo_url = https://github.com/facebookexperimental/eden.git
repo_url = https://github.com/facebook/sapling.git

[build.not(os=windows)]
builder = cargo
Expand Down
1 change: 1 addition & 0 deletions eden/fs/nfs/portmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ target_link_libraries(
PUBLIC
eden_nfs_rpc
Folly::folly
edencommon::edencommon_utils
)

add_library(
Expand Down
16 changes: 9 additions & 7 deletions eden/fs/utils/ImmediateFuture.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,11 @@ class ImmediateFuture {
return kind_ == Kind::Immediate;
}

private:
using Try = folly::Try<T>;
using SemiFuture = folly::SemiFuture<T>;

struct Empty {};
explicit ImmediateFuture(Empty) noexcept;

/**
* Define the behavior of the SemiFuture constructor and continuation when
* dealing with ready SemiFuture.
*
* gcc 11.3 on ubuntu complains if this is in private section.
*/
enum class SemiFutureReadiness {
/**
Expand All @@ -307,6 +302,13 @@ class ImmediateFuture {
LazySemiFuture,
};

private:
using Try = folly::Try<T>;
using SemiFuture = folly::SemiFuture<T>;

struct Empty {};
explicit ImmediateFuture(Empty) noexcept;

ImmediateFuture(SemiFuture fut, SemiFutureReadiness readiness) noexcept;

friend ImmediateFuture<folly::Unit> makeNotReadyImmediateFuture();
Expand Down
1 change: 1 addition & 0 deletions eden/fs/utils/RingBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <vector>
#include <stddef.h>

namespace facebook::eden {

Expand Down

0 comments on commit 5dc53b3

Please sign in to comment.