-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
build statically-linked sui-node for testing on glibc-based hosts #18611
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
ENV GIT_REVISION=${GIT_REVISION} | ||
ENV PROFILE=${PROFILE} | ||
|
||
RUN --network=none cargo build --frozen --profile ${PROFILE} --bin sui-node | ||
RUN --network=none cargo build --target x86_64-unknown-linux-musl --frozen --profile ${PROFILE} --bin sui-node |
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.
Is this part needed? or is the fixing of the rust flags enough?
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.
it actually is needed:
=> CACHED [build 7/8] COPY --from=linux-headers . / 0.0s
=> ERROR [build 8/8] RUN --network=none cargo build --frozen --profile release --bin sui-node 5.1s
------
> [build 8/8] RUN --network=none cargo build --frozen --profile release --bin sui-node:
5.010 error: cannot produce proc-macro for `ark-ff-asm v0.4.2` as the target `x86_64-unknown-linux-musl` does not support these crate types
------
Dockerfile:67
--------------------
65 | ENV PROFILE=${PROFILE}
66 |
67 | >>> RUN --network=none cargo build --frozen --profile ${PROFILE} --bin sui-node
68 |
69 | FROM scratch AS install
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --frozen --profile ${PROFILE} --bin sui-node" did not complete successfully: exit code: 101
(other references to this issue of needing to specify --target
rust-lang/rust#78210 (comment)
https://msfjarvis.dev/posts/building-static-rust-binaries-for-linux/
The reason behind this seems to be a bug with cargo, where the RUSTFLAGS are applied to the target platform only when --target is explicitly provided
relates to: #13476 |
…stenLabs#18611) ## Description Update Deterministic Sui Build to compile a statically-linked binary. StageX uses `musl` for compiling `sui-node`. In order for this to run the `sui-node` binary directly on glibc-based linux macines, it must be statically linked. ## Test plan Cherry-pick commit to `testnet` branch and test on a private testnet. * build docker image * extract `sui-node` binary * confirm statically linked (run `file` on mac, `ldd` on linux) * upload to baremetal test server + run * check build is still deterministic from github action build, linux machine, macOS machine --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Description
Update Deterministic Sui Build to compile a statically-linked binary.
StageX uses
musl
for compilingsui-node
.In order for this to run the
sui-node
binary directly on glibc-based linux macines, it must be statically linked.Test plan
Cherry-pick commit to
testnet
branch and test on a private testnet.sui-node
binaryfile
on mac,ldd
on linux)Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.