fastly / cli

Build, deploy and configure Fastly services from your terminal
https://fastly.dev/reference/cli/
Apache License 2.0
139 stars 56 forks source link

Cargo workspace inheritance support #1177

Open cmac4603 opened 2 months ago

cmac4603 commented 2 months ago

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.

[workspace.package] authors = ["Colin MacRae cmac4603@users.noreply.github.com"] edition = "2018" version = "1.1.0"


- worker/Cargo.toml
```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.

Integralist commented 2 months ago

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 commented 2 months ago

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