Skip to content
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

Add source tarballs to our releases #4294

Merged
merged 3 commits into from
Aug 15, 2022

Conversation

alexcrichton
Copy link
Member

This commit adds a small script to create a source tarball as part of
the release process. This goes further than requested by #3808 by
vendoring all Rust dependencies as well to be more in line with
"download the source once then build somewhere without a network".
Vendoring the Rust dependencies makes the tarball pretty beefy (67M
compressed, 500M uncompressed). Unfortunately most of this size comes
from vendored crates such as v8, pqcrypto-kyber, winapi, capstone-sys,
plotters, and web-sys. Only winapi in this list is actually needed for
wasmtime-the-binary and only on Windows as well but for now this is
the state of things related to cargo vendor. If this becomes an issue
we could specifically remove the bulky contents of crates in the
vendor directory such as v8 since it's only used for fuzzing.

Closes #3808

@alexcrichton alexcrichton marked this pull request as ready for review June 21, 2022 19:17
ci/build-src-tarball.sh Outdated Show resolved Hide resolved
# Vendor all crates.io dependencies since this is supposed to be an
# offline-only-compatible tarball
mkdir /tmp/$pkgname/.cargo
cargo vendor > /tmp/$pkgname/.cargo/config.toml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't used cargo vendor but it seems like the --versioned-dirs option would be nice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'll leave this as the default options since that's primarily only intended if it needs to be opted-in to, but I don't think there would be any harm in passing it in.

ci/build-src-tarball.sh Outdated Show resolved Hide resolved

# Create the tarball from the destination
mkdir -p dist
tar -czf dist/$pkgname.tar.gz -C /tmp $pkgname
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure other people have thought about this more than I have, but I'd be inclined to add options like --owner=root:0 --group=root:0 --sort=name and possibly --mtime=@0, to make the contents of the generated tarball independent of the runner on which it's built.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm somewhat hesitant to do that because we haven't done it for any other tarballs and I'm always somewhat scared of using fancy tar options in fear that we'll eventually get a tar on some system which is too old

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that's fair. Though I just did a quick check out of curiosity, and --sort is the newest of these flags, and even the version of GNU tar in Ubuntu 16.04 had that option. Since this is only supposed to run on GitHub runners I guess I wouldn't be as concerned about whether random systems have the same options available.

Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think some more options to cargo vendor and tar would be nice to have, but I'm also happy with this as-is.

This commit adds a small script to create a source tarball as part of
the release process. This goes further than requested by bytecodealliance#3808 by
vendoring all Rust dependencies as well to be more in line with
"download the source once then build somewhere without a network".
Vendoring the Rust dependencies makes the tarball pretty beefy (67M
compressed, 500M uncompressed). Unfortunately most of this size comes
from vendored crates such as v8, pqcrypto-kyber, winapi, capstone-sys,
plotters, and web-sys. Only `winapi` in this list is actually needed for
`wasmtime`-the-binary and only on Windows as well but for now this is
the state of things related to `cargo vendor`. If this becomes an issue
we could specifically remove the bulky contents of crates in the
`vendor` directory such as `v8` since it's only used for fuzzing.

Closes bytecodealliance#3808
@alexcrichton
Copy link
Member Author

Ok I'll go ahead and merge this then and we can follow-up with changes if necessary.

@alexcrichton alexcrichton merged commit 69483a2 into bytecodealliance:main Aug 15, 2022
@alexcrichton alexcrichton deleted the src-tarball branch August 15, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release source code with submodules
2 participants