Contribution Guide Up To Date?

Hello,
I’m not sure if this is best placed here or in a git issue, so redirect as appropriate.

I am currently attempting to set up a local repository so I can play with the codebase and test infrastructure. The good news is that the initial instructions at in the Contribution Guidelines are simple and to the point. The bad news is that there appear to be multiple layers of implicit assumptions not captured in the initial setup script.

I am working on a MacBook Pro running 10.14.6. I did a fresh install on the machine this morning and have been adding packages on an “as needed” bases.

git clone https://github.com/libra/libra.git* * cd libra
./scripts/dev_setup.sh* * source ~/.cargo/env
cargo xbuild* * cargo xtest
$ ./scripts/dev_setup.sh appears to work, though at the end it provides differing instructions from the contributions guidelines above:

Finished installing all dependencies.

You should now be able to build the project by running:
source /Users/agc/.cargo/env
cargo build

cargo build works fine, but cargo xbuild does not (xbuild can be partially fixed by manually installing the package, but the cargo.toml file is missing the relevant configuration so ultimately does not run anyway).

neither cargo xtest nor cargo test worked.

cargo xtest appears to fail because the OpenSSL directory is not found and the -sys create cannot be used. The reference to the -sys crate makes it likely that the error is associated with cargo xbuild not being configured properly. cargo xcheck exhibits the same error.

cargo check completes with no problems.

cargo test is failing due to a number of undefined modules, which specific one depends on the compilation order of that specific run. Common culprits include unknown modules storage_client, test_helper, simple_storage_client or missing trait implementation for key_pair.

Concrete questions:

  1. Is the codebase set up for cargo build/test or cargo xbuild/xtest?
  2. The most likely explanation is that my configuration is too clean and there are some implicit background packages that I’ve just missed. Any ideas?
2 Likes

Update on my experience to date:

I got cargo xtest and cargo xcheck to work; the SSL issue was related to the Mac default openssl package being too old; updating that package solved those problems.

cargo xbuild continues to not work, though following the openssl fix cargo build seems sufficient.

The outstanding question is whether cargo build or cargo xbuild (or both) is expected to work.

Thanks in advance.

allen

2 Likes

It looks like the documentation on the website was a little misleading and has been fixed recently. xtest is a cargo alias that is configured in the repo (and is essentially a wrapper around cargo test) but we do not have, nor do we rely on an xbuild command.

2 Likes