Skip to content

Commit

Permalink
build-sys: Drop custom version glue code
Browse files Browse the repository at this point in the history
It was annoying me that rust-analyzer was showing an error for
our `version.rs`. Something we're doing there is wrong, maybe
related to the output directory?

But when I dig in a bit I don't understand how we ended up
with this custom code when the clap docs show use of the
`clap::crate_version` macro which looks just fine to me.

Not having a `build.rs` just simplifies things.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Dec 17, 2024
1 parent fa096f5 commit b21161b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
1 change: 0 additions & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ version = "1.1.3"
# For now don't bump this above what is currently shipped in RHEL9;
# also keep in sync with the version in cli.
rust-version = "1.75.0"
build = "build.rs"

include = ["/src", "LICENSE-APACHE", "LICENSE-MIT"]

Expand Down
22 changes: 0 additions & 22 deletions lib/build.rs

This file was deleted.

4 changes: 1 addition & 3 deletions lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ use crate::spec::Host;
use crate::spec::ImageReference;
use crate::utils::sigpolicy_from_opts;

include!(concat!(env!("OUT_DIR"), "/version.rs"));

/// Perform an upgrade operation
#[derive(Debug, Parser, PartialEq, Eq)]
pub(crate) struct UpgradeOpts {
Expand Down Expand Up @@ -398,7 +396,7 @@ impl InternalsOpts {
#[derive(Debug, Parser, PartialEq, Eq)]
#[clap(name = "bootc")]
#[clap(rename_all = "kebab-case")]
#[clap(version,long_version=CLAP_LONG_VERSION)]
#[clap(version,long_version=clap::crate_version!())]
#[allow(clippy::large_enum_variant)]
pub(crate) enum Opt {
/// Download and queue an updated container image to apply.
Expand Down

0 comments on commit b21161b

Please sign in to comment.