Skip to content

packaging: Support vendoring the Rust sources #1391

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

Closed
wants to merge 4 commits into from

Conversation

cgwalters
Copy link
Member

This ends up being different than what landed in librsvg (that
was imported into ostree) because in rpm-ostree we've basically
been using git archive-based tarball generation rather than make dist
for a long time. And supporting make dist looks like it'd get into
handling the libdnf bits and walking into cmake land so...yeah
let's not do that.

The canonical sources are in git (recursively via submodule),
except for the Rust sources, which cargo can download dynamically,
and with this patch we support glomming all of that together
into a tarball.

(And turn off make dist so people understand how we do it)

Tested by make -f Makefile.dist-packaging dist-snapshot, then
copying the resulting tarball into a container with --net=none
and building there.

This ends up being different than what landed in librsvg (that
was imported into ostree) because in rpm-ostree we've basically
been using `git archive`-based tarball generation rather than `make dist`
for a long time.  And supporting `make dist` looks like it'd get into
handling the `libdnf` bits and walking into `cmake` land so...yeah
let's not do that.

The canonical sources are in git (recursively via submodule),
except for the Rust sources, which cargo can download dynamically,
and with this patch we support glomming all of that together
into a tarball.

(And turn off `make dist` so people understand how we do it)

Tested by `make -f Makefile.dist-packaging dist-snapshot`, then
copying the resulting tarball into a container with `--net=none`
and building there.
@cgwalters
Copy link
Member Author

@@ -29,4 +29,15 @@ ls -al ${TARFILE_TMP}
tar -A -f ${TARFILE_TMP} submodule.tar
rm submodule.tar
done
tmpd=$(mktemp -d)
Copy link
Member

Choose a reason for hiding this comment

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

Let's add a trap to nuke this for good measure? (I just tried this patch locally, and it died on some local config issue and left the directory behind!)

cargo vendor -q --sync ${TOP}/rust/Cargo.toml vendor
cp ${TOP}/rust/Cargo.lock .
cp ${TOP}/rust/cargo-vendor-config .cargo/config
tar --transform='s,^,rust/,' -vrf ${TARFILE_TMP} .
Copy link
Member

Choose a reason for hiding this comment

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

Neat!

Copy link
Member

Choose a reason for hiding this comment

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

Though let's drop the -v? Seems inconsistent to be printing these when we're not printing anything else during dist-snapshot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixups ⬇️

@jlebon
Copy link
Member

jlebon commented Jun 6, 2018

LGTM! Though that last fixup looks like it's targeting the wrong commit, right?

@cgwalters
Copy link
Member Author

Yep, fixed the fixup.

@jlebon
Copy link
Member

jlebon commented Jun 6, 2018

@rh-atomic-bot r+ ae73b3a

@rh-atomic-bot
Copy link

⌛ Testing commit ae73b3a with merge 82bbacc...

rh-atomic-bot pushed a commit that referenced this pull request Jun 6, 2018
This ends up being different than what landed in librsvg (that
was imported into ostree) because in rpm-ostree we've basically
been using `git archive`-based tarball generation rather than `make dist`
for a long time.  And supporting `make dist` looks like it'd get into
handling the `libdnf` bits and walking into `cmake` land so...yeah
let's not do that.

The canonical sources are in git (recursively via submodule),
except for the Rust sources, which cargo can download dynamically,
and with this patch we support glomming all of that together
into a tarball.

(And turn off `make dist` so people understand how we do it)

Tested by `make -f Makefile.dist-packaging dist-snapshot`, then
copying the resulting tarball into a container with `--net=none`
and building there.

Closes: #1391
Approved by: jlebon
rh-atomic-bot pushed a commit that referenced this pull request Jun 6, 2018
@rh-atomic-bot
Copy link

💔 Test failed - status-atomicjenkins

@jlebon
Copy link
Member

jlebon commented Jun 6, 2018

@rh-atomic-bot retry

@rh-atomic-bot
Copy link

⚡ Test exempted: merge already tested.

rh-atomic-bot pushed a commit that referenced this pull request Jun 6, 2018
LorbusChris pushed a commit to LorbusChris/rpm-ostree-spec that referenced this pull request Oct 22, 2018
rpm-ostree now includes some Rust code.
See coreos/rpm-ostree#1377
and coreos/rpm-ostree#1391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants