Giter Club home page Giter Club logo

Comments (7)

cat-in-136 avatar cat-in-136 commented on June 9, 2024 3

@gilescope you said "Just bump toml_edit " but bumping cargo_toml seems to be correct. In addition to bumping it, some modification is necessary because there is incompatibility between cargo_toml 0.11 and 0.13.

from cargo-generate-rpm.

gilescope avatar gilescope commented on June 9, 2024

This please. Just bump toml_edit to lastest version will do it.

from cargo-generate-rpm.

Christiaan676 avatar Christiaan676 commented on June 9, 2024

@cat-in-136 Thanks for updating and releasing a new version. Unfortunately trying it out on my project fails with the following error:

$ cargo generate-rpm --payload-compress none -p bin
/usr/local/cargo/bin/cargo-generate-rpm: Cargo.toml: value from workspace hasn't been set

Project layout looks like:

\
   \bin
      \src
      Cargo.toml
   <Some other projects in workspace>
   Cargo.toml

The workspace toml has the version, edition, license set. And in project project has the matching workspace = true. The cargo command is executed from the workspace dir.

from cargo-generate-rpm.

cat-in-136 avatar cat-in-136 commented on June 9, 2024

@Christiaan676 It's up to your cargo.toml

I've confirmed it with following tiny workspace.

/foo/Cargo.toml

[workspace]
members = ["bar"]

[workspace.package]
version = "1.2.3"
authors = ["Nice Folks"]
license = "MIT"
description = "A short description of my package"
documentation = "https://example.com/bar"

/foo/bar/Cargo.toml

[package]
name = "bar"
version.workspace = true
authors.workspace = true
license.workspace = true
description.workspace = true
documentation.workspace = true

[package.metadata.generate-rpm]
assets = [
    { source = "target/release/bar", dest = "/usr/bin/bar", mode = "0755" }
]

/foo/bar/src/main.rs

fn main() {
    println!("Hello, world!");
}

I hope this will be of help to you.

Execute under workspace directory (/foo)

$ cargo build ---release
$ cargo-generate-rpm -p bar

from cargo-generate-rpm.

Christiaan676 avatar Christiaan676 commented on June 9, 2024

@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.

I'll see if I can make an example.

from cargo-generate-rpm.

Christiaan676 avatar Christiaan676 commented on June 9, 2024

@cat-in-136 Appertly a know issue in cargo_tml https://gitlab.com/crates.rs/cargo_toml/-/issues/20

from cargo-generate-rpm.

cat-in-136 avatar cat-in-136 commented on June 9, 2024

@Christiaan676 I've confirmed this issue and reproduced in my environment. I filed new another issue #47 for the package.edition issue related to https://gitlab.com/crates.rs/cargo_toml/-/issues/20 .

from cargo-generate-rpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.