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

forc-pkg: package name and external library alias may not clash #6861

Closed
jjcnn opened this issue Jan 27, 2025 · 2 comments · Fixed by #6888
Closed

forc-pkg: package name and external library alias may not clash #6861

jjcnn opened this issue Jan 27, 2025 · 2 comments · Fixed by #6888
Assignees
Labels
bug Something isn't working forc-pkg Everything related to the `forc-pkg` crate.

Comments

@jjcnn
Copy link
Contributor

jjcnn commented Jan 27, 2025

The compiler gets confused when the alias of a dependency is the same as the name of the package:

[project]
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "lib_contract"

[dependencies]
lib_contract = { path = "../lib_contract_abi/", package = "lib_contract_abi" }

forc-pkg should throw an error in this situation, but it doesn't.

@JoshuaBatty JoshuaBatty added forc-pkg Everything related to the `forc-pkg` crate. bug Something isn't working labels Jan 29, 2025
@kayagokalp kayagokalp self-assigned this Feb 4, 2025
@kayagokalp
Copy link
Member

[project]
authors = ["Fuel Labs <[email protected]>"]
entry = "main.sw"
license = "Apache-2.0"
name = "lib_contract_abi"

[dependencies]
lib_contract = { path = "../lib_contract_abi/", package = "lib_contract_abi" }

Should we also disallow situations where package alias is colliding with package name as well?

@jjcnn
Copy link
Contributor Author

jjcnn commented Feb 4, 2025

Should we also disallow situations where package alias is colliding with package name as well?

That situation is currently caught by the compiler, but I think it would be better if forc-pkg did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forc-pkg Everything related to the `forc-pkg` crate.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants