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

Cargo workspace inheritance support #1177

Open
cmac4603 opened this issue Apr 15, 2024 · 3 comments
Open

Cargo workspace inheritance support #1177

cmac4603 opened this issue Apr 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@cmac4603
Copy link

Version

❯ fastly version
Fastly CLI version v10.8.10 (7f391164)
Built with go version go1.22.2 linux/amd64 (2024-04-15)
Viceroy version: viceroy 0.9.6

What happened
Running fastly compute serve on a rust compute@edge service, which is a workspace member in a larger project, it seems workspace inheritance is not supported.

  • Cargo.toml
[workspace]
members = ["api", "worker"]
resolver = "2"

[workspace.package]
authors = ["Colin MacRae <cmac4603@users.noreply.github.com>"]
edition = "2018"
version = "1.1.0"
  • worker/Cargo.toml
[package]
name = "my-app"
version.workspace = true
edition.workspace = true
authors.workspace = true

Results in this output:

ERROR: error reading Cargo.toml manifest: (3, 1): Can't convert workspace = true
(*toml.Tree) to a tree.

Replacing with standard variable and not using the inheritance works, but now there's duplication and multiple places to change the version number for example.

@cmac4603 cmac4603 added the bug Something isn't working label Apr 15, 2024
@Integralist
Copy link
Collaborator

Integralist commented Apr 15, 2024

Thanks for raising this issue @cmac4603

I was the person who initially implemented support for Cargo workspaces (here, see the NOTES section for an example of the set up I was using to test with), and unfortunately, not being a Rust developer, I was not aware of all the features of Cargo workspaces (so my apologies for any issues you've run into).

I'll raise a ticket internally for this to be looked at. I can't give any estimate as to when, but again, thank you for making us aware of this issue 👍🏻

Thanks again.

@cmac4603
Copy link
Author

Thanks @Integralist, I only just discovered this pattern myself late last year (workspace inheritance came out in rust 1.64 Oct 2022), but it's a great pattern as we almost exclusively use workspaces where I work :) Look forward to seeing this get implemented

@kailan
Copy link
Member

kailan commented Jul 24, 2024

👍 to this – I'm unable to run the examples for the fastly/esi crate.

[package]
name = "esi_example_minimal"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish = false
➜  esi_example_minimal git:(release-0.5.0) ✗ fastly compute serve
✓ Verifying fastly.toml
✓ Identifying package name
✓ Identifying toolchain

ERROR: error reading Cargo.toml manifest: (3, 1): Can't convert workspace = true
(*toml.Tree) to a tree.

If you believe this error is the result of a bug, please file an issue: https://github.com/fastly/cli/issues/new?labels=bug&template=bug_report.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants