alexcrichton opened PR #4294 from src-tarball
to main
:
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. Onlywinapi
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 tocargo vendor
. If this becomes an issue
we could specifically remove the bulky contents of crates in the
vendor
directory such asv8
since it's only used for fuzzing.Closes #3808
<!--
Please ensure that the following steps are all taken care of before submitting
the PR.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
alexcrichton has marked PR #4294 as ready for review.
alexcrichton updated PR #4294 from src-tarball
to main
.
alexcrichton requested peterhuene for a review on PR #4294.
jameysharp submitted PR review.
jameysharp created PR review comment:
I haven't used
cargo vendor
but it seems like the--versioned-dirs
option would be nice.
jameysharp submitted PR review.
jameysharp created PR review comment:
How about this instead, to be a little more clear about what's being done to the string?
tag=${GITHUB_REF#refs/tags/}
jameysharp created PR review comment:
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.
jameysharp created PR review comment:
I'm always nervous about what
cp *
will grab. I mean, it won't copy top-level dotfiles, which is currently okay since the only things there are.git*
, but it's a little weird. On the other hand, ifmain.yml
someday gets changed to run this script later, thencp *
will copy build products and the like.Constructing a clean copy with submodules is more of a pain than I'd like, so I think it's worth relying on the script running early enough that the working copy is pristine. Given that, I don't think you need to copy anything. You can ask GNU tar to archive
.
, but ignore.git
and prepend$pkgname
to every path, with these options:--transform "s/^\./$pkgname/S" --exclude-vcs
alexcrichton submitted PR review.
alexcrichton created PR review comment:
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.
alexcrichton updated PR #4294 from src-tarball
to main
.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Neat! I had to use
--exclude=.git
instead of--exclude-vcs
because otherwise it was ignoring files in vendored directories which Cargo didn't like, but I prefer to avoid copying things around.
alexcrichton created PR review comment:
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 atar
on some system which is too old
alexcrichton submitted PR review.
jameysharp created PR review comment:
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.
jameysharp submitted PR review.
jameysharp submitted PR review.
alexcrichton updated PR #4294 from src-tarball
to main
.
alexcrichton merged PR #4294.
Last updated: Nov 22 2024 at 17:03 UTC