Skip to content
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

rust2rpm: disable development-only feature for regenerating sources #48

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

HuijingHei
Copy link
Member

@HuijingHei
Copy link
Member Author

Create new spec with this patch, the development-only features are disabled as expected, see following results:

]# rust2rpm -s ignition-config
• Generated: rust-ignition-config.spec
]# wget https://src.fedoraproject.org/rpms/rust-ignition-config/raw/rawhide/f/rust-ignition-config.spec
]# diff rust-ignition-config.spec rust-ignition-config.spec.1
1c1
< # Generated by rust2rpm 26
---
> # Generated by rust2rpm 23
8c8
< Version:        0.4.0
---
> Version:        0.3.0
14a15,16
> # Disable development-only feature for regenerating sources
> Patch0:         ignition-config-fix-metadata.diff
16c18
< BuildRequires:  cargo-rpm-macros >= 24
---
> BuildRequires:  rust-packaging >= 21
50c52
< %autosetup -n %{crate}-%{version} -p1
---
> %autosetup -n %{crate}-%{version_no_tilde} -p1

@HuijingHei
Copy link
Member Author

Not sure if we still need Patch0: ignition-config-fix-metadata.diff to remove the build-dependencies crates in Cargo.toml, anyway to test this?

@prestist
Copy link
Contributor

prestist commented Jul 15, 2024

@HuijingHei Yeah I think this will work; regarding testing, I think the test is the .spec file should be disabling features using '--feature' or rpm macros.

So the main test is that we have features disabled "listed in the generated spec file"

That should then make the .patch file and the 'patch 0' line obsolete.

edit link https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/

@HuijingHei
Copy link
Member Author

Thanks @prestist for the confirmation!

Copy link
Contributor

@prestist prestist left a comment

Choose a reason for hiding this comment

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

LGTM

@HuijingHei HuijingHei merged commit 1e38009 into coreos:main Jul 17, 2024
6 checks passed
@HuijingHei HuijingHei deleted the hide-feature branch July 17, 2024 04:07
This was referenced Jul 17, 2024
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.

2 participants