diff options
author | Thomas Orgis | 2020-09-30 12:15:55 +0200 |
---|---|---|
committer | Thomas Orgis | 2020-09-30 12:15:55 +0200 |
commit | 7648fe210d095397484dc911330360c238ce2bb6 (patch) | |
tree | 2b4cfea69a728f0feb02238fde33a4eb118370de /rust-crates | |
parent | 51cc21158ebe623a1e230eb7d10e75d991023b7a (diff) |
cbindgen: make build local and reproducible
My approach involves a cargo snapshot tarball (directory .cargo,
matching the default $HOME/.cargo, also less chance of conflict
in source trees) that is extracted inside the source tree and
used by the default build.
It's still WIP. We need to agree on the idea of cargo snapshots
or another way of integrating the cargo downloads into summon.
In my opinion, we need something that can be mirrored/self-hosted.
I hope we find something better in future. Maybe at least some
tooling support in quill to generate those cargo snapshots
automatically. But one crucial point: Each grimoire guru needs
access to a place that serves as canonical URL. I use my own
server at sobukus.de now, but I presume it should be on
sourcemage.org …
Also, about the naming of spells: With the increasing number of
ecosystems (perl, python[23], ruby, go, rust) that produce their
inevitable re-inventions of various wheels in form of packages,
we really should start prefixing things. The spell cbindgen should
be called rust-cbindgen. Anything from CPAN should be perl-anything
or cpan-anything.
Diffstat (limited to 'rust-crates')
-rwxr-xr-x | rust-crates/FUNCTIONS | 4 | ||||
-rwxr-xr-x | rust-crates/cbindgen/DETAILS | 10 | ||||
-rw-r--r-- | rust-crates/cbindgen/HISTORY | 5 | ||||
-rwxr-xr-x | rust-crates/cbindgen/PRE_BUILD | 5 | ||||
-rw-r--r-- | rust-crates/cbindgen/WIP | 4 |
5 files changed, 24 insertions, 4 deletions
diff --git a/rust-crates/FUNCTIONS b/rust-crates/FUNCTIONS index cba2919d0e..b593044567 100755 --- a/rust-crates/FUNCTIONS +++ b/rust-crates/FUNCTIONS @@ -2,14 +2,14 @@ ## Section-default build script. #------------------------------------------------------------------------- function default_build_cargo() { - env CARGO_HOME="$SOURCE_DIRECTORY/cargo_home" cargo build --release + env CARGO_HOME="$SOURCE_DIRECTORY/.cargo" cargo build --release } #------------------------------------------------------------------------- ## Section-default install script. #------------------------------------------------------------------------- function default_install_cargo() { - env CARGO_HOME="$SOURCE_DIRECTORY/cargo_home" \ + env CARGO_HOME="$SOURCE_DIRECTORY/.cargo" \ cargo install --path "$SOURCE_DIRECTORY" --root "${INSTALL_ROOT}/usr" --locked $@ && rm -f "$INSTALL_ROOT/usr/.crates.toml" && rm -f "$INSTALL_ROOT/usr/.crates2.json" diff --git a/rust-crates/cbindgen/DETAILS b/rust-crates/cbindgen/DETAILS index a37c33f5d3..d897e04b93 100755 --- a/rust-crates/cbindgen/DETAILS +++ b/rust-crates/cbindgen/DETAILS @@ -8,10 +8,18 @@ SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-git" SOURCE_IGNORE="volatile" FORCE_DOWNLOAD="on" else +# The sources consist of the upstream tarball and a cargo tarball which is the +# result of running +# CARGO_HOME=$PWD/.cargo cargo fetch +# tar -czf $(basename $PWD)-cargo.tar.gz .cargo Cargo.lock +# With the non-scm branch, we want offline builds. VERSION="0.14.6" - SOURCE_HASH="sha512:1243d180e767087a92bbbcf68a6111b39f09b5899195d0d85c81bab36f0fe33d567540f12ed959ece8b0d87162736b6bbac48e85af5dc9709e137c9b77ca5591" SOURCE="${SPELL}-${VERSION}.tar.gz" + SOURCE2="${SPELL}-${VERSION}-cargo.tar.gz" + SOURCE_HASH="sha512:1243d180e767087a92bbbcf68a6111b39f09b5899195d0d85c81bab36f0fe33d567540f12ed959ece8b0d87162736b6bbac48e85af5dc9709e137c9b77ca5591" + SOURCE2_HASH="sha512:091c57a948b6825abb7bf5a8b3165a74ce87d034a20c29d7e8502f71212182d663aec7a6324fc6a81794260ade16eab49fe6ccf35e6a6e2710a04090998435fb" SOURCE_URL[0]="https://github.com/eqrion/${SPELL}/archive/v${VERSION}.tar.gz" + SOURCE2_URL[0]="https://sobukus.de/rust/${SOURCE2}" SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}" fi WEB_SITE="https://docs.rs/cbindgen" diff --git a/rust-crates/cbindgen/HISTORY b/rust-crates/cbindgen/HISTORY index fc48d126ea..0a21cd5a39 100644 --- a/rust-crates/cbindgen/HISTORY +++ b/rust-crates/cbindgen/HISTORY @@ -1,3 +1,8 @@ +2020-09-30 Thomas Orgis <sobukus@sourcemage.org> + * DETAILS, PRE_BUILD: package the dependencies into SOURCE2 + for networkless build + * WIP: note some improvement + 2020-09-26 Florian Franzmann <siflfran@hawo.stw.uni-erlangen.de> * DETAILS: version 0.14.6 diff --git a/rust-crates/cbindgen/PRE_BUILD b/rust-crates/cbindgen/PRE_BUILD new file mode 100755 index 0000000000..6920cf266b --- /dev/null +++ b/rust-crates/cbindgen/PRE_BUILD @@ -0,0 +1,5 @@ +default_pre_build && +if [[ -n $SOURCE2 ]]; then + cd "$SOURCE_DIRECTORY" && + unpack_file 2 +fi diff --git a/rust-crates/cbindgen/WIP b/rust-crates/cbindgen/WIP index e72545f0b6..d40ffa2e70 100644 --- a/rust-crates/cbindgen/WIP +++ b/rust-crates/cbindgen/WIP @@ -1 +1,3 @@ -Has too many crates being downloaded and built during BUILD phase. +Well, does not download anymore during BUILD, but the +huge dependency tarball as SOURCE2 is also not that much +fun. |