-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #389 from chainbound/nico/cross-builds
feat: add fast multi-platform build
- Loading branch information
Showing
9 changed files
with
139 additions
and
58 deletions.
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"] |