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

Introduce deterministic resolver for alternative sources for dependencies in forc-pkg #6903

Open
kayagokalp opened this issue Feb 7, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request forc-pkg Everything related to the `forc-pkg` crate. team:tooling Tooling Team

Comments

@kayagokalp
Copy link
Member

kayagokalp commented Feb 7, 2025

Currently syntactically we can insert alternative sources for each dependency in the Forc.toml file.

std = { ipfs = "bafybeighr56cwvhje2hxc5gtdiqgxia4slmcbcjvjdflqkmjxukvatqley", git = "https://github.com/fuellabs/sway" }

But forc-pkg's behaviour is undefined at the moment. We should be resolving these alternatives sources in specific order for ensuring correct behaviour for building.

For example if a source has a path source, git source and a registry source, we should not be using the registry version. Because there might be local changes. The registry version is there to enable to be published to the registry.

To reduce further ambiguity cargo does include the following sentence to their docs:

It is possible to specify both a registry version and a git or path location

It is clear that a user can specify a registry version and git or registry version and path. This way the disambiguity between the precedence of path and git is removed.

The summary of this propsed change is that:

  1. Disallow git, path, ipfs to be declared at the same time
  2. But they can be matched with registry version
@kayagokalp kayagokalp added enhancement New feature or request forc-pkg Everything related to the `forc-pkg` crate. team:tooling Tooling Team labels Feb 7, 2025
@kayagokalp kayagokalp self-assigned this Feb 7, 2025
@kayagokalp kayagokalp changed the title Enable deterministic resolveement of alternative sources for dependencies in forc-pkg Introduce deterministic resolver for alternative sources for dependencies in forc-pkg Feb 7, 2025
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-pkg Everything related to the `forc-pkg` crate. team:tooling Tooling Team
Projects
None yet
Development

No branches or pull requests

1 participant