Skip to content

Makefile: Don't use cargo xtask - #364

Merged
cgwalters merged 2 commits into
bootc-dev:mainfrom
jeckersb:xtask-manpages
Sep 14, 2026
Merged

cgwalters merged 2 commits into
bootc-dev:mainfrom
jeckersb:xtask-manpages

Conversation

@jeckersb

Copy link
Copy Markdown
Collaborator

In #346 the manpage generation
was changed to mirror bootc, however it missed the important part that
bootc does not directly run cargo xtask but instead runs cargo run --release --package xtask -- ..., which is an important distinction
because the former requires the cargo-xtask binary to be present in
$PATH somewhere. In the RPM buildroot we don't have cargo-xtask so
this fails to generate manpages via packit (and would eventually FTBFS
in Fedora, too).

Closes: #355
Signed-off-by: John Eckersberg dev@eckersberg.com

In bootc-dev#346 the manpage generation
was changed to mirror bootc, however it missed the important part that
bootc does not directly run `cargo xtask` but instead runs `cargo run
--release --package xtask -- ...`, which is an important distinction
because the former requires the `cargo-xtask` binary to be present in
$PATH somewhere.  In the RPM buildroot we don't have `cargo-xtask` so
this fails to generate manpages via packit (and would eventually FTBFS
in Fedora, too).

Closes: bootc-dev#355
Signed-off-by: John Eckersberg <dev@eckersberg.com>
@jeckersb jeckersb mentioned this pull request Sep 14, 2026
@jeckersb

Copy link
Copy Markdown
Collaborator Author

well this partially fixes it, re: #355 (comment) still more to do

@cgwalters

Copy link
Copy Markdown
Collaborator

This is fine, but what was missed was copying https://github.com/bootc-dev/bootc/blob/main/.cargo/config.toml which I think is a better fix

This mirrors how bootc works, this is important because we might not
have git installed (for example, in the buildroot during RPM build).

Signed-off-by: John Eckersberg <dev@eckersberg.com>
@jeckersb

Copy link
Copy Markdown
Collaborator Author

This is fine, but what was missed was copying https://github.com/bootc-dev/bootc/blob/main/.cargo/config.toml which I think is a better fix

Yes, although that alias kinda obfuscates what is going on (hence my confusion)

@cgwalters

Copy link
Copy Markdown
Collaborator

Yes, although that alias kinda obfuscates what is going on (hence my confusion)

I agree it's subtle if one doesn't know about it, but it is documented in the first google search result (for me) for "cargo xtask" ➡️ https://github.com/matklad/cargo-xtask

So I think the right fix is to add that alias - and actually we should have a CI check that verifies that it works, I think that was the other real gap.

@jeckersb

Copy link
Copy Markdown
Collaborator Author

Yes, although that alias kinda obfuscates what is going on (hence my confusion)

I agree it's subtle if one doesn't know about it, but it is documented in the first google search result (for me) for "cargo xtask" ➡️ https://github.com/matklad/cargo-xtask

So I think the right fix is to add that alias - and actually we should have a CI check that verifies that it works, I think that was the other real gap.

Ah ok, I didn't realize that it's always just been an alias, instead assuming there was come cargo-xtask binary installed in the cargo path like all of the other cargo-XXX drop-ins. I'll change the first commit to add the alias.

@jeckersb

Copy link
Copy Markdown
Collaborator Author

Actually I went to add the alias but it's already there so something else is going on.

@cgwalters

Copy link
Copy Markdown
Collaborator

OK hum my offhand guess is this may be something with the Fedora RPM rust macros overwriting cargo.toml, IIRC I got burnt by that in the past, not sure why bootc doesn't hit the same thing.

@cgwalters
cgwalters merged commit 15f519e into bootc-dev:main Sep 14, 2026
28 checks passed
@jeckersb

Copy link
Copy Markdown
Collaborator Author

OK hum my offhand guess is this may be something with the Fedora RPM rust macros overwriting cargo.toml, IIRC I got burnt by that in the past, not sure why bootc doesn't hit the same thing.

Yeah seems this is intentional:

- The `%cargo_prep` macro was adapted to unconditionally remove any pre-existing
  `.cargo` directory. In almost all cases, upstream settings in `.cargo/config`
  or `.cargo/config.toml` are incompatible with RPM build environments. This
  also removes a warning about potentially both of these files being present.

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.

packit copr builds are broken

2 participants