-
Notifications
You must be signed in to change notification settings - Fork 205
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
add indication of DAML_SDK_VERSION for daml version #7385
Conversation
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.
Excellent idea. Thank you.
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.
Nice thank you!
I’m slightly confused about the PR title. Is this only referring to daml-head
as that one sets the environment variable? Once you’ve created a project with daml-head new
, it will just pick up the version from daml.yaml
so this shouldn’t change much.
Fixes #7381. ``` $ alias daml=~/.daml/sdk/0.0.0/daml/daml $ daml version DAML SDK versions: 0.0.0 1.4.0 1.5.0-snapshot.20200811.4959.0.bbc2fe56 1.5.0-snapshot.20200818.5027.0.1b33d374 1.5.0-snapshot.20200902.5118.0.2b3cf1b3 (default SDK version for new projects) $ DAML_SDK_VERSION=invalid daml version daml: Invalid value for environment variable DAML_SDK_VERSION. context: Determining SDK version and path. details: Invalid SDK version "invalid": Failed reading: takeWhile1 $ DAML_SDK_VERSION=1.4.4 daml version DAML SDK versions: 0.0.0 1.4.0 1.4.4 (selected by env var DAML_SDK_VERSION, not installed) 1.5.0-snapshot.20200811.4959.0.bbc2fe56 1.5.0-snapshot.20200818.5027.0.1b33d374 1.5.0-snapshot.20200902.5118.0.2b3cf1b3 (default SDK version for new projects) $ DAML_SDK_VERSION=1.4.0 daml version DAML SDK versions: 0.0.0 1.4.0 (selected by env var DAML_SDK_VERSION) 1.5.0-snapshot.20200811.4959.0.bbc2fe56 1.5.0-snapshot.20200818.5027.0.1b33d374 1.5.0-snapshot.20200902.5118.0.2b3cf1b3 (default SDK version for new projects) $ DAML_SDK_VERSION=1.5.0-snapshot.20200902.5118.0.2b3cf1b3 daml version DAML SDK versions: 0.0.0 1.4.0 1.5.0-snapshot.20200811.4959.0.bbc2fe56 1.5.0-snapshot.20200818.5027.0.1b33d374 1.5.0-snapshot.20200902.5118.0.2b3cf1b3 (selected by env var DAML_SDK_VERSION, default SDK version for new projects) $ ``` CHANGELOG_BEGIN CHANGELOG_END
16c7abf
to
0d79df6
Compare
Updated title: it was meant to be the env var, so
As a user, this does not leave me with a clear answer as to which version I'm using. Any suggestion on how to deal with that? |
I'd always just show one indicator: Inside a project:
Outside a project without an env variable:
Outside a project with an env variable:
|
I think your last point should probably be |
Perhaps a star like
|
I like the star! |
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.
Regarding the PR: Nice addition! I like it.
Regarding the star: It looks nice but it's vague, and might lead people to be confused about how SDK versions work. Personally I would add a second "overrides daml.yaml" clause in cases where the environment variable is given, there is a project path, and the project sdk version doesn't match the env var version, like:
$ daml-head version
DAML SDK versions:
0.0.0 (selected by env var DAML_SDK_VERSION, overrides daml.yaml)
1.4.0 (project SDK version from daml.yaml)
1.5.0-snapshot.20200811.4959.0.bbc2fe56
1.5.0-snapshot.20200818.5027.0.1b33d374
1.5.0-snapshot.20200902.5118.0.2b3cf1b3
I don't really like this approach as it seems messy both in implementation and for the user. They have to read all the way to the end of the line to find out that it overrides, and there is nothing on the 1.4 line that indicates it's not actually selected. The more I think about it the less I believe we can get something clear without having a separate section. If you don't like the star, how about:
Without the env var set that would become:
and without a project:
In addition to being extra clear, this also makes the various ways to set the version used discoverable. |
@cocreature I did mean "Outside a project with an env variable:". I thought
I can see how the specificity could be interpreted in the opposite direction if we consider the env var a command override |
The env var takes precedence over the project version atm and we do have users relying on that, e.g., they pull in finlib and want to compile it in the current version so rather than trying to patch the file, they set the env var. This behavior is also explicitly documented with exactly this usecase. |
@garyverhaegen-da Could you finish merging this PR and open an issue for making the "SDK version selection process" clearer for users in |
Fixes #7381.
CHANGELOG_BEGIN
CHANGELOG_END