Repository navigation
Description
I've spent maybe an hour or two trying to build eden, with no success.
The first issue was that it was not entirely clear how to build eden. The root README.md says to use build.sh to build EdenFS, but doesn't mention anything about building the rest of eden, which are the bits I'm interested in. So I looked in eden/scm, but the README there seems to be leftover from hg, and trying to build something there gave me an error saying something like "this needs to be built using getdeps.py", so I assumed maybe the root build.sh builds everything and the README is stale.
So running build.sh, I got a compilation error in eden/fs/config/EdenConfig.h, due to common/rust/shed/hostcaps/hostcaps.h not existing. So I cloned the rust-shed repo and copied it under common/rust.
Then I got a bunch more compilation errors because the Cargo.toml files request the master branch of the rust-shed repo, which doesn't exist. I rewrote all these from "master" to "main".
Then I got multiple rust build failures on mod fb; lines, presumably because --features fb was being passed to cargo/rustc (which I think should be only be used for internal builds?) first in the rust-shed code I copied into the tree, then elsewhere (don't remember where). I couldn't quickly find why the feature was set, and ./build.sh --no-facebook-internal didn't help, so I replaced all "feature = "fb" by "feature = "zz" to deactivate all this and proceed.
Then I got a build error because eden/scm/lib/third-party/rust/fbthrift/Cargo.toml mentions ../../../../../../thrift/lib/rust, which does not exist. I replaced it with ../../../../../.././external/fbthrift/thrift/lib/rust, which stopped this error but resulting in multiple new ones, so I don't know if that was the right fix:
-
external/fbthrift/thrift/lib/rust/Cargo.toml mentions the support_old_nightly feature of async-trait, which apparently doesn't exist. I removed that.
-
then I got rust errors in external/fbthrift/thrift/lib/rust/src/processor.rs in the NullServiceProcessor implemenation of ServiceProcessor, because the unused parameters of handle_methods are not Send/Sync (??). My rust compiler is already as up to date as it can. So I made everything relevant Send/Sync.
-
finally, I ran into screenfuls of errors like this:
error[E0433]: failed to resolve: could not find `help` in `fbthrift`
--> ~/eden/eden/scm/lib/thrift-types/eden_config/src/lib.rs:105:25
|
105 | ::fbthrift::help::enum_display(VARIANTS_BY_NUMBER, fmt, self.0)
| ^^^^ could not find `help` in `fbthrift`
error[E0433]: failed to resolve: could not find `help` in `fbthrift`
--> ~/eden/eden/scm/lib/thrift-types/eden_config/src/lib.rs:125:25
|
125 | ::fbthrift::help::enum_from_str(VARIANTS_BY_NAME, string, "ConfigSource").map(ConfigSource)
| ^^^^ could not find `help` in `fbthrift`
That's where I'm stuck currently. Any idea how to make progress here?
Activity
chadaustin commentedon Oct 18, 2021
Thank you for the detailed write-up! Our open source story is somewhere nonexistent and lacking. Almost all of the pieces should be there, but we have not yet written up "here's how you run a Mononoke instance", "here's how you configure EdenFS on your local machine", "here's how you package and deploy EdenSCM", etc.
The hostcaps issue is a recent regression. It sounds like rust-shed needs open source build support including C FFI.
I'm not sure about that Thrift error.
v-gb commentedon Oct 18, 2021
Right. It's possible I'd run into a wall pretty quickly even the build were to succeed, but I assume there are still useful things to learn even if starting a VFS or a server is a challenge. Say, what the CLI even looks like. Is there still a notion of draft and obsolescence markers. What's the speed of operation, say commit/status/update, if I import a working copy from some other repo.
chadaustin commentedon Oct 18, 2021
A few things in summary:
gabrielrussoc commentedon Nov 7, 2021
I did some digging around these build failures and I believe one problem is the
eden/scm/lib/thrift-typescrate.eden/scm/lib/thrift-types/build.rshas a comment:https://github.com/facebookexperimental/eden/blob/aebede32db5ed8f54030928ca61be1e143626808/eden/scm/lib/thrift-types/build.rs#L8-L12
The generated files are not good for the OSS build since they are pointing to non-existent files. Namely
fbthriftandtokio_shim:https://github.com/facebookexperimental/eden/blob/aebede32db5ed8f54030928ca61be1e143626808/eden/scm/lib/thrift-types/build.rs#L99-L104
Not really sure what's the right fix it, but regenerating the files pointing to github might do the trick:
@chadaustin Could you fix the build script and regenerate the files whenever you find time? I'd do it if I had access to fbcode :)
gabrielrussoc commentedon Nov 7, 2021
I also hit the hostcaps error and I think the OSS build can simply remove it since it's FB only. In fact, should this code even be in github @chadaustin ?
https://github.com/facebookexperimental/eden/blob/7df253e0c95e2601f68026e22a7a6d4fd7f587a3/eden/fs/config/EdenConfig.h#L784-L800
I deleted this code and the corresponding include to get past the error, without copying rust-shed:
https://github.com/facebookexperimental/eden/blob/7df253e0c95e2601f68026e22a7a6d4fd7f587a3/eden/fs/config/EdenConfig.h#L20
gabrielrussoc commentedon Nov 7, 2021
I got rid of those by removing the fb feature from here:
https://github.com/facebookexperimental/eden/blob/7df253e0c95e2601f68026e22a7a6d4fd7f587a3/eden/scm/lib/backingstore/CMakeLists.txt#L6
gabrielrussoc commentedon Nov 7, 2021
woohoo!
#88
ahornby commentedon Nov 7, 2021
@gabrielrussoc thanks for this, I see the problem with fbthrift and tokio_shim. We've hardcoded the internal fbcode path rather than letting it be generated differently internally vs externally.
I'll take a look, I've already landed some build fixes for internal eden_scm OSS builds so for that at least we're getting close to it working
v-gb commentedon Nov 8, 2021
Thanks! I managed to build edenfs with #88. It's a bit hard to tell whether the resulting exe work normally though, because I haven't built the other parts of eden. I think there may be something weird with the edenfs executable, because its dependency on libgit2 is dynamic:
So anyway I looked for a way to build the client. I think
build/fbcode_builder/getdeps.py build eden_scmis the way to do this. Unfortunately I ran into issues again there, after a couple of simple tweaks [1]:which I suspect comes from https://github.com/facebookexperimental/eden/blob/c7762ae593a9d15ea0b134fc57882849e2f32909/eden/scm/setup.py#L755-L769
There's perhaps some kind of local hack I can use to make progress, but I haven't figured it out yet.
[1]
gabrielrussoc commentedon Nov 8, 2021
my edenfs binary has a bunch of dynamic dependencies:
not sure how to build a static binary, maybe some flag to the build script? For libgit in particular, it is on the binary's rpath which in my case seems to have:
I'm also trying this on osx, which probably makes things slightly different
Anyway, these binaries are definitely hard to move around. Using
--scratch-pathto avoid having everything on a tmp dir also breaks the build for me, with the same error as meta/folly#1667ahornby commentedon Feb 15, 2022
Current state: The OSS build completes now for Eden CLI build and test, Mononoke build and test and Eden FS build. README.md is updated with build steps using getdeps.py to coordinate. EdenFS tests hang about half way through when I run them on github actions, probably due to config missing that is present on our internal hosts.