-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Implicitly add std
dependency if unspecified
#1137
Conversation
Rather an implicitly including both |
Good point! I was blindly following Rust in this case where both |
core
and std
dependencies if unspecifiedstd
dependency if unspecified
4276868
to
ce63830
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK.
TODO: Pass `forc` semver version through to `Manifest` `from_file` constructor in order to set `tag` for `core` and `std` git dependencies.
This is necessary in order to pin the version of the implicit `std` dependency to the version of `forc`.
By overriding either the `core` or `std` dependency manually, we disable the implicit inclusion of the `std` dependency which may have caused CI issues in the future when `forc`'s version is updated before the git tag for the new version is made available.
3d7fdca
to
c2093f4
Compare
Just rebased onto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but would like @sezna to confirm that there's nothing nuanced we missed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable. Do you want to do the thing we mentioned regarding omitting std as a Forc.toml flag as a part of this PR, or as a follow-up? If the latter, would you mind making an issue to track it?
Filed #1150 to track removing |
While loading a
Manifest
with thefrom_file
constructor, we check for dependencies declared with eitherstd
orcore
packages.If neither
core
orstd
exist, we add their associatedgit
dependencies pointing to this sway repo at thetag
equal toforc
's currentsemver
version. This way, the implicitcore
andstd
deps are pinned alongside the version offorc
that fetches them, guaranteeing that the manifests are compatible and that thecore
andstd
versions are compatible with eachother.If both
core
andstd
are supplied by the user, or if only one of eithercore
orstd
are provided by the user, then we don't implicitly include either. This is because in the case that only eithercore
orstd
are provided, we cannot guarantee that an implicitly includedcore
orstd
would be compatible with the user-specified one.Closes #330
Sway repo examples/tests
It's best we leave the examples and test suite with the explicit
path
dependencies in order to ensure that they remain tested against the current state offorc
rather than the latest tagged commit. This will also avoid running into CI issues during the PRs whereforc
's version is updated but the tag hasn't yet been pushed.This also adds a
core
dependency declaration to all tests that otherwise contained an empty[dependencies]
table. By overriding either thecore
orstd
dependency manually, we disable the implicit inclusion of thestd
dependency.TODO
forc
semver version through toManifest::from_file
constructor in order to settag
forcore
andstd
git dependencies.core
/std
.