Skip to content

Use published bootc-internal-{utils,blockdev} crates#963

Merged
cgwalters merged 1 commit into
coreos:mainfrom
cgwalters:sync-bootc-code
Jul 14, 2025
Merged

Use published bootc-internal-{utils,blockdev} crates#963
cgwalters merged 1 commit into
coreos:mainfrom
cgwalters:sync-bootc-code

Conversation

@cgwalters

@cgwalters cgwalters commented Jun 30, 2025

Copy link
Copy Markdown
Member

For now we'll continue to publish bootupd as a crate,
but I think we should eventually stop doing this.

Closes: #964

@cgwalters cgwalters mentioned this pull request Jun 30, 2025
41 tasks
@HuijingHei

Copy link
Copy Markdown
Contributor

Thank you @cgwalters for the workaround, not sure if my understanding is correct, in this case, the dependencies bootc-blockdev and bootc-utils do not have a specified version here, so the publish will fail.

$ git clone https://github.com/cgwalters/bootupd.git -b sync-bootc-code
$ cargo publish --dry-run
    Updating crates.io index
error: all dependencies must have a version specified when publishing.
dependency `bootc-blockdev` does not specify a version
Note: The published dependency will use the version from crates.io,
the `path` specification will be removed from the dependency declaration.

@cgwalters

cgwalters commented Jun 30, 2025

Copy link
Copy Markdown
Member Author

Ah right, thanks for testing this out. Yeah I think we're hitting a really longstanding Rust toolchain limitation that requires publishing these sub-crates when what we really want is for them to just be automatically vendored.

I think this PR would need to be reworked to instead rework the sub-crates as modules (very unfortunate ergonomic hit).

xref e.g. https://www.reddit.com/r/rust/comments/10k4q0c/rust_2030_christmas_list_subcrate_dependencies/

@cgwalters

Copy link
Copy Markdown
Member Author

OK I hacked this up to use modules instead (it's ugly) and it at least compiles locally, but for some reason cargo publish --dry-run seems to fail with

error: couldn't read `src/bootc/blockdev/src/blockdev.rs`: No such file or directory (os error 2)
  --> src/main.rs:53:1
   |
53 | mod bootc_blockdev;
   | ^^^^^^^^^^^^^^^^^^^

error: could not compile `bootupd` (bin "bootupd") due to 1 previous error
error: failed to verify package tarball

No idea about that right now

cgwalters added a commit to cgwalters/bootc that referenced this pull request Jul 1, 2025
See coreos/bootupd#963

Basically I just want a way to keep these in sync with bootupd;
we're not attempting to make a truly public library.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters

Copy link
Copy Markdown
Member Author

Man it's just so unreasonably difficult to share these little bits of code between two projects without going all the way to publishing as a stable crate, which has a pretty high overhead for what it would give us (especially in making a separate RPM package for it!).

Anyways, I now did bootc-dev/bootc#1394

What I always find really ironic about this from the distro side is that there are no alarms about duplicate code that no one is actively trying to keep in sync.

@HuijingHei

Copy link
Copy Markdown
Contributor

Man it's just so unreasonably difficult to share these little bits of code between two projects without going all the way to publishing as a stable crate, which has a pretty high overhead for what it would give us (especially in making a separate RPM package for it!).

Anyways, I now did bootc-dev/bootc#1394

This remains the best available solution.

For now we'll continue to publish bootupd as a crate,
but I think we should eventually stop doing this.

Closes: coreos#964
@cgwalters cgwalters changed the title Sync (copy) bootc blockdev & utils crates Use published bootc-internal-{utils,blockdev} crates Jul 13, 2025
@cgwalters cgwalters requested a review from HuijingHei July 13, 2025 20:02
@cgwalters cgwalters enabled auto-merge July 13, 2025 20:02
@HuijingHei

Copy link
Copy Markdown
Contributor

Thank you @cgwalters for fixing the issue.

@HuijingHei HuijingHei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@cgwalters cgwalters merged commit 71814e6 into coreos:main Jul 14, 2025
12 checks passed
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.

bootupd does not comply with Rust packaging MUST rule

2 participants