Skip to content

Warn users if they create a package in a workspace without listing them as a member #4451

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

Open
kayagokalp opened this issue Apr 17, 2023 · 4 comments · May be fixed by #7123
Open

Warn users if they create a package in a workspace without listing them as a member #4451

kayagokalp opened this issue Apr 17, 2023 · 4 comments · May be fixed by #7123
Assignees
Labels
enhancement New feature or request forc forc-pkg Everything related to the `forc-pkg` crate. good first issue Good for newcomers may be rewarded ODHack13

Comments

@kayagokalp
Copy link
Member

cargo warns users with a warning if they create a package inside a workspace directory like the following:

warning: compiling this new package may not work due to invalid workspace configuration

current package believes it's in a workspace when it's not:
current:   /Users/kayagokalp/fuel/dev/sway/forc-error/Cargo.toml
workspace: /Users/kayagokalp/fuel/dev/sway/Cargo.toml

We might want to do something similar. In our case a child package wouldn't be "thinking" it's in a workspace but it is still pretty easy to forget listing a package in the workspace manifest file.

@kayagokalp kayagokalp added enhancement New feature or request forc forc-pkg Everything related to the `forc-pkg` crate. labels Apr 17, 2023
@kayagokalp kayagokalp self-assigned this Apr 17, 2023
@kayagokalp kayagokalp removed their assignment Apr 24, 2023
@kayagokalp kayagokalp added the good first issue Good for newcomers label Apr 24, 2023
@eureka-cpu
Copy link
Contributor

@gr00vytvniks

@andrewvious
Copy link
Contributor

Would you mind showing me how to create a minimal reproduction of this problem, so I have something to test against?
@kayagokalp

@khayss
Copy link

khayss commented Apr 24, 2025

Can I handle this task?

@perpetual-cosmos
Copy link

Hey,
I’ll implement a check that warns users when a new package is added under a workspace directory but isn’t listed in the workspace manifest—similar to how Cargo surfaces workspace configuration issues. This will help prevent silent misconfigurations during development.
Let me know if there's a preferred format or trigger point for displaying this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc forc-pkg Everything related to the `forc-pkg` crate. good first issue Good for newcomers may be rewarded ODHack13
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants