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

feat: disallow dependency package name collision in forc-pkg #6888

Merged
merged 3 commits into from
Feb 9, 2025

Conversation

kayagokalp
Copy link
Member

@kayagokalp kayagokalp commented Feb 4, 2025

Description

closes #6861

forc was allowing dependency name being the same (through the use of package alias and the declaration itself) as the project name.

The following two cases are now invalid and produces an error on the forc-pkg side before going to the compiler.

[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" }

and

[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" }

Copy link

codspeed-hq bot commented Feb 4, 2025

CodSpeed Performance Report

Merging #6888 will not alter performance

Comparing kayagokalp/6861 (f5188d6) with master (c288563)

Summary

✅ 22 untouched benchmarks

@kayagokalp kayagokalp marked this pull request as ready for review February 7, 2025 22:42
@kayagokalp kayagokalp requested a review from a team as a code owner February 7, 2025 22:42
@kayagokalp kayagokalp changed the title feat: disallow dependency alias package name collision in forc-pkg feat: disallow dependency package name collision in forc-pkg Feb 7, 2025
@kayagokalp kayagokalp self-assigned this Feb 7, 2025
@kayagokalp kayagokalp added bug Something isn't working forc-pkg Everything related to the `forc-pkg` crate. labels Feb 7, 2025
@JoshuaBatty JoshuaBatty requested a review from a team February 8, 2025 23:30
Copy link
Contributor

@zees-dev zees-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@JoshuaBatty JoshuaBatty enabled auto-merge (squash) February 9, 2025 06:46
@JoshuaBatty JoshuaBatty merged commit 1fdf630 into master Feb 9, 2025
41 checks passed
@JoshuaBatty JoshuaBatty deleted the kayagokalp/6861 branch February 9, 2025 06:58
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 this pull request may close these issues.

forc-pkg: package name and external library alias may not clash
3 participants