-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some Rust smoketesting CI for barretenberg_wrapper #14
Conversation
.github/workflows/rust.yml
Outdated
# TODO: Enable when tests work | ||
# - name: Run cargo test | ||
# working-directory: "./barretenberg_wrapper" | ||
# run: | | ||
# cargo +${{ matrix.toolchain }} test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On linux, running cargo test
fails with a ton of linker errors. I'm not sure why.
On Mac, the tests pedersen tests fail with (what looks like) an ordering problem.
I'd love some help getting the tests working in this project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the tests to match aztec_backend
as per @vezenovm's suggestions and re-enabled the test step. I'm guessing we'll still have issues with linking on Linux though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linux tests were failing because rust picks up gcc as the linker on ubuntu. I've added a config file to override that as per rust-lang/rust#71515 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it seems by specifying this inside of barretenberg_wrapper, it'll apply when used as a dependency as per the Hierarchical Structure documentation: https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure
1159376
to
b1959d3
Compare
10ab90b
to
4070246
Compare
@@ -0,0 +1,2 @@ | |||
[target.x86_64-unknown-linux-gnu] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we'll want to add something similar for aarch64-unknown-linux-gnu
in PR #8
4070246
to
08a95c5
Compare
This looks like the same error message I'm getting when trying to build barretenberg locally. There's something in the test files which is borked (everything builds fine if you delete all the tests). |
@TomAFrench It looks flakey, as they pass most of the time. I updated a couple tests that weren't updated but maybe there are others that need to be updated. I'll ask @vezenovm |
@@ -0,0 +1,93 @@ | |||
name: Rust | |||
|
|||
on: [push, pull_request] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on: [push, pull_request] | |
on: | |
push: | |
branches: 'kw/noir-dsl' | |
pull_request: | |
branches: '*' |
This currently runs CI twice on PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running the PR twice is actually good because a push
runs with the branch as it's own base and pull_request
runs with the upstream as the base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow on this. When you say "with the upstream as the base" do you mean "as if the PR were rebased on top of the branch being merged into"? I haven't heard anything about push
and pull_request
treating the same commit differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
Note that
GITHUB_SHA
for this event is the last merge commit of the pull request merge branch. If you want to get the commit ID for the last commit to the head branch of the pull request, usegithub.event.pull_request.head.sha
instead.
Thus, the checkout action running on something triggered by pull_request
will checkout a merge between the upstream and the PR and test it. And push
just checks out to the commit that is pushed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting. I didn't know that GH did that temporary merge for pull_request
.
Personally I generally try to avoid merging branches into a base branch which is ahead of it (e.g. through first merging back into the PR branch) to check this explicitly rather than relying on GH.
Unfortunately it's 100% of the time for me which prevents me from building anything noir-related. |
I'm confused, why are the tests being built if you are building Noir itself? This issue is only showing up when the tests are run in this repository. There was a separate |
I can confirm that I also get the Illegal Instruction error in the google tests 100% of the time when building barretenberg (on my other machine - linux x86_64). |
Aha, I've just been running I've added that manually to |
Oh, I wouldn't trust the I suppose we can add the |
Yeah, I think the When building nargo I get the errors fixed in #13 and 2630271. These are fixed now and nargo just needs to have dependencies updated. Not knowing this, I came here to try and hunt down the issue and once Barretenberg starts throwing the same error as nargo did, it's natural to try and troubleshoot there. |
Yep! I'm working on getting everything updated so nargo builds. I just started on Monday and nargo wouldn't build on my Mac with everything fresh. So, of course, I've been on a mission to make sure it works! Just waiting on a few PRs across various repos. |
Thanks, I apprecate it! I just tested with your PR on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
* Cargo format * Clippy fixes * Update tests to match tests in aztec_backend * Add cargo config to set clang as linker when target is x86_64-unknown-linux-gnu
* Cargo format * Clippy fixes * Update tests to match tests in aztec_backend * Add cargo config to set clang as linker when target is x86_64-unknown-linux-gnu
This adds some CI for the
barretenberg_wrapper
crate. I wanted to get this added so we are more comfortable with changes such as my #9 PR and #8 (which we'll want to rebase on this). I believe ARM support is on the GitHub Action roadmap, so we'll be able to expand this matrix in the future.I also needed to fix some rust formatting and clippy stuff in separate commits.
I'll also have some comments inline.
Depends upon #13