forked from FuelLabs/fuel-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish compiled fuel-core binaries on release (FuelLabs#342)
* Setup a cross based process for building fuel-core binaries * Update .github/workflows/ci.yml Co-authored-by: John Adler <[email protected]> * PR feedback * update fuel-vm patch Co-authored-by: John Adler <[email protected]>
- Loading branch information
Showing
11 changed files
with
225 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[target.aarch64-unknown-linux-gnu] | ||
image = "aarch64-linux-gnu" | ||
|
||
[target.aarch64-unknown-linux-musl] | ||
image = "aarch64-linux-musl" | ||
|
||
[target.x86_64-unknown-linux-gnu] | ||
image = "x86_64-linux-gnu" | ||
|
||
[target.x86_64-unknown-linux-musl] | ||
image = "x86_64-linux-musl" |
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,5 @@ | ||
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main | ||
|
||
RUN dpkg --add-architecture arm64 && \ | ||
apt-get update && \ | ||
apt-get install --assume-yes clang-8 libclang-8-dev binutils-aarch64-linux-gnu |
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,5 @@ | ||
FROM ghcr.io/cross-rs/aarch64-unknown-linux-musl:main | ||
|
||
RUN dpkg --add-architecture arm64 && \ | ||
apt-get update && \ | ||
apt-get install --assume-yes clang libclang-dev binutils-aarch64-linux-gnu |
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,10 @@ | ||
FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main | ||
|
||
RUN yum -y update && \ | ||
yum -y install centos-release-scl && \ | ||
yum-config-manager --enable rhel-server-rhscl-8-rpms && \ | ||
yum -y install llvm-toolset-7.0 | ||
|
||
COPY centos-entrypoint /usr/bin/entrypoint.sh | ||
RUN chmod +x /usr/bin/entrypoint.sh | ||
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ] |
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,4 @@ | ||
FROM ghcr.io/cross-rs/x86_64-unknown-linux-musl:main | ||
|
||
RUN apt-get update && \ | ||
apt-get install --assume-yes clang libclang-dev binutils-aarch64-linux-gnu |
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,26 @@ | ||
CI Tooling | ||
=== | ||
|
||
Cross-platform compilation is handled using [cross](https://github.com/cross-rs/cross). | ||
This is because cross ensures binaries will run on as many platforms as possible. | ||
It also works-around various [bugs](https://github.com/rust-lang/rust-bindgen/issues/1229) | ||
in rust bind-gen that prevent us from simply using `--target` with cargo to cross-compile. | ||
|
||
We use custom extensions of the docker images provided by cross | ||
in order to support building rocksdb with clang. Each target requires its own dockerfile, | ||
as they all have slightly different distros, package managers and compiler toolchains. | ||
|
||
To test cross compilation of fuel core locally, build the provided dockerfiles | ||
with the image tags expected by Cross.toml using the helper script: | ||
|
||
```shell | ||
./build-images.sh | ||
``` | ||
|
||
To cross-compile fuel core for a supported target, you can build it as you | ||
would with cargo but using cross instead: | ||
|
||
```shell | ||
cargo install cross | ||
cross build --profile=release --target ${target} -p fuel-core | ||
``` |
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker build -t x86_64-linux-gnu -f Dockerfile.x86_64-unknown-linux-gnu-clang . | ||
|
||
docker build -t x86_64-linux-musl -f Dockerfile.x86_64-unknown-linux-musl-clang . | ||
|
||
docker build -t aarch64-linux-gnu -f Dockerfile.aarch64-unknown-linux-gnu-clang . | ||
|
||
docker build -t aarch64-linux-musl -f Dockerfile.aarch64-unknown-linux-musl-clang . |
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,3 @@ | ||
#!/usr/bin/env bash | ||
source scl_source enable llvm-toolset-7.0 | ||
exec "$@" |
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,3 @@ | ||
#!/bin/sh | ||
|
||
brew install llvm |