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

Error raised on workspace inheritance of package.edition #47

Closed
cat-in-136 opened this issue Dec 18, 2022 · 2 comments · Fixed by #48
Closed

Error raised on workspace inheritance of package.edition #47

cat-in-136 opened this issue Dec 18, 2022 · 2 comments · Fixed by #48

Comments

@cat-in-136
Copy link
Owner

"value from workspace hasn't been set" error raised when workspace inheritance is used and its toml has package.edition.

#44 (comment)

@cat-in-136 Did some testing. When I use the workspace for the version / license it works fine. But adding the edition, will result in the above error. First gut feeling is that somethings is going wrong in the toml_edit lib, as the generate-rpm code is not using the edition field. That would suggest things go wrong on line 73: manifest.inherit_workspace(&workspace_manifest, p.as_ref())?;, some context to the errors would help.

It is caused by the cargo_toml bug https://gitlab.com/crates.rs/cargo_toml/-/issues/20

cat-in-136 added a commit that referenced this issue Dec 18, 2022
…ritance of package.edition

To generate a `Manifest` instance, generate slice directly instead of calling `from_path_with_metadata`.
cat-in-136 added a commit that referenced this issue Dec 18, 2022
…ritance of package.edition

To generate a `Manifest` instance, generate slice directly instead of calling `from_path_with_metadata`.
@cat-in-136
Copy link
Owner Author

@Christiaan676 I wrote a workaround code referring to bnjbvr/cargo-machete@096df04 :

https://github.com/cat-in-136/cargo-generate-rpm/tree/cargo_toml_20_hack

Could you please confirm my cargo_toml_20_hack branch? If it is sufficient for your project, I would like to merge this change.

@Christiaan676
Copy link

@cat-in-136 The fix works for me. Thanks for applying the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants