-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: add fast multi-platform build #389
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0b26e97
feat: use cross for multiplatform builds
merklefruit 68f11f0
feat: zigbuild
merklefruit f1b55b9
fix: build-arg
merklefruit 29aa316
fix: target path
merklefruit c0f6881
chore: fixes
merklefruit 2a0accc
feat: use base dir to hold binaries
merklefruit 0671f11
fix: adjust copy path in cross build file
merklefruit 93117cc
fix: use static name for binary output file
merklefruit 7211b15
fix: attempt at native cargo on native arch
merklefruit 738f7f8
chore: rm shell
merklefruit c64c253
chore: debug logs
merklefruit 4697777
chore: handle edge case with cargo
merklefruit 6c97f61
chore: typo
merklefruit 9e3704c
feat: add cross compiled openssl path
merklefruit da19682
chore: fix cross compile script
merklefruit 556468d
chore: adjust openssl paths
merklefruit 4519cbc
fix: more fixes to cross build script
merklefruit 97255ca
fix: use correct compiler
merklefruit f71fa98
chore: more cross compilation tests
merklefruit 966de9e
chore: more cross compilation tests
merklefruit ec349f7
chore: use cross for bolt-sidecar
merklefruit 2d3d7b5
chore: typo
merklefruit 38acf9f
chore: typo
merklefruit e019f4f
chore: only arm64 with cross
merklefruit 4df28d6
feat: use cross for everything with openssl cross compiled lib
merklefruit 3c88a0e
fix: cargo clean between builds, use more recent gcc
merklefruit 3e565c1
chore: rm compilation support script, update docs
merklefruit c9fc73f
chore: add troubleshooting tips
merklefruit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
# log files | ||
*_dump.log | ||
logs/ | ||
target/ | ||
|
||
# environment secrets | ||
.env | ||
|
||
# IDEs | ||
.vscode | ||
.idea | ||
|
||
# build artifacts | ||
target/ | ||
dist/ | ||
|
||
# other | ||
.DS_Store | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[build] | ||
pre-build = [ | ||
# We depend on openssl for the build, so we need to install its cross-compiled version | ||
# more info at: https://github.com/cross-rs/cross/wiki/Configuration#build | ||
"dpkg --add-architecture $CROSS_DEB_ARCH", | ||
"apt-get update && apt-get --assume-yes --no-install-recommends install libssl-dev:$CROSS_DEB_ARCH" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[build] | ||
pre-build = [ | ||
# We depend on openssl for the build, so we need to install its cross-compiled version | ||
# more info at: https://github.com/cross-rs/cross/wiki/Configuration#build | ||
"dpkg --add-architecture $CROSS_DEB_ARCH", | ||
"apt-get update && apt-get --assume-yes --no-install-recommends install libssl-dev:$CROSS_DEB_ARCH", | ||
|
||
# Update the default gcc and g++ to 10 to avoid a bug in gcc 9 that causes a build failure | ||
# more info at: https://github.com/cross-rs/cross/issues/1565#issuecomment-2483968180 | ||
"apt-get --assume-yes --no-install-recommends install gcc-10 g++-10 && ln -sf /usr/bin/gcc-10 /usr/bin/gcc && ln -sf /usr/bin/g++-10 /usr/bin/g++" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This image is meant to enable cross-architecture builds. | ||
# It assumes the binary has already been compiled for `$TARGETPLATFORM` and is | ||
# locatable in `./dist/bin/$TARGETARCH/$BINARY`. | ||
|
||
FROM --platform=$TARGETPLATFORM ubuntu:22.04 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/chainbound/bolt | ||
LABEL org.opencontainers.image.licenses="MIT" | ||
|
||
# Filled by docker buildx | ||
ARG TARGETARCH | ||
|
||
# Should be set by the caller when building the image | ||
ARG BINARY | ||
|
||
COPY ./dist/bin/$TARGETARCH/$BINARY /usr/local/bin/bolt | ||
|
||
ENTRYPOINT ["/usr/local/bin/bolt"] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 had to remove the ssz-rs
sha2-asm
feature as it was breaking for cross-compiledaarch64
.There might be a way to do it but for now I had to disable it