Comments (1)
How hard would it be for cargo-deb to just read [workspace.package.metadata.deb]
or something like this from the top-level Cargo.toml? Maybe keep the name
key arbitrary and add a package = "workspace-member"
key.
My project is running into this because our "main" will be in src/main/Cargo.toml
as our server is completely modular. So there's no [package]
key, only a [workspace.package]
key at the top level Cargo.toml.
The rationale for this is to make it harder for this kind of metadata or information to go out of sync or outdated, keeping it in the top level is strongly preferred instead of putting it in another Cargo.toml that could get lost.
Additionally, being forced to put this in a workspace now causes assets to use fragile and unappealing relative paths:
license-file = ["../../LICENSE", "3"]
# ..
maintainer-scripts = "../../debian/"
# ..
assets = [
["../../debian/README.md", "usr/share/doc/conduwuit/README.Debian", "644"],
["../../README.md", "usr/share/doc/conduwuit/", "644"],
["../../target/release/conduwuit", "usr/sbin/conduwuit", "755"],
["../../conduwuit-example.toml", "etc/conduwuit/conduwuit.toml", "640"],
]
If my quick design there was implemented, my top level Cargo.toml would look something like this:
[workspace]
resolver = "2"
members = ["src/*"]
default-members = ["src/*"]
[workspace.package]
description = "a very cool fork of Conduit, a Matrix homeserver written in Rust"
license = "Apache-2.0"
authors = [
"strawberry <[email protected]>",
"timokoesters <[email protected]>",
]
version = "0.4.0"
edition = "2021"
# See also `rust-toolchain.toml`
rust-version = "1.77.0"
homepage = "https://conduwuit.puppyirl.gay/"
repository = "https://github.com/girlbossceo/conduwuit"
readme = "README.md"
[workspace.package.metadata.deb]
name = "conduwuit"
# workspace member package name at: src/main/Cargo.toml
package = "conduwuit"
maintainer = "strawberry <[email protected]>"
copyright = "2024, strawberry <[email protected]>"
license-file = ["LICENSE", "3"]
depends = "$auto, ca-certificates"
extended-description = """\
a cool hard fork of Conduit, a Matrix homeserver written in Rust"""
section = "net"
priority = "optional"
conf-files = ["/etc/conduwuit/conduwuit.toml"]
maintainer-scripts = "debian/"
systemd-units = { unit-name = "conduwuit", start = false }
assets = [
["debian/README.md", "usr/share/doc/conduwuit/README.Debian", "644"],
["README.md", "usr/share/doc/conduwuit/", "644"],
["target/release/conduwuit", "usr/sbin/conduwuit", "755"],
["conduwuit-example.toml", "etc/conduwuit/conduwuit.toml", "640"],
]
With this, I no longer need to rely on relative paths from a workspace member in another directory, I no longer need to do -p <package>
in my CI for cargo-deb as it can simply read the top level Cargo.toml, and this information is easier to maintain.
from cargo-deb.
Related Issues (20)
- Consider using `zopfli`'s new streaming encoder feature HOT 4
- cargo-deb looks up README.md in wrong dir when using workspace HOT 1
- Clarification on the "native" nature of packages HOT 3
- Consider adding 'target-dir' option HOT 1
- Allow dpkg-shlibdeps flags or Debian rules file HOT 1
- `conf-files` generates a `conffiles` file with a trailing empty line HOT 1
- Test failures for manifest and control tests on Arch Linux HOT 8
- [Feature-Request] Advanced Usage, "append" option for assets HOT 3
- rodio HOT 1
- warning: Command dpkg-shlibdeps failed to launch (no auto deps for ...) HOT 1
- `License` is not set in the `control` file HOT 2
- unknown-field Vcs-Git Vcs-Browser HOT 2
- Files in /etc are overwritten HOT 6
- Option to generate separate -dbg package with debug symbols when --separate-debug-symbols is used HOT 1
- cargo-deb not packaging the binary
- asset paths don't work properly with "--profile" HOT 1
- file modes in top-level ar archive don't match dpkg HOT 1
- Switch Digest Signing over to sha256 from md5 HOT 2
- separate-debug-symbols option only honored on the CLI but not in Cargo.toml metadata.deb table HOT 1
- Avoid including copyright information HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-deb.