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

Add a special "stable" version identifier that accepts any stable version #36

Open
jakemac53 opened this issue Apr 16, 2019 · 8 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@jakemac53
Copy link
Contributor

Today the any identifier allows any version (stable or pre-release). Changing that behavior would be a breaking change, hence the proposal for a new stable identifier.

As a concrete use case we advise consumers of the build_* packages to generally use any constraints, because they don't directly interact with the imperative api of the packages. However, we released an 2.0.0-alpha.0 version of build_web_compilers and now they are picking that version up by default, which we expected users to have to explicitly opt into.

@jakemac53 jakemac53 added the type-enhancement A request for a change that isn't a bug label Apr 16, 2019
@jakemac53
Copy link
Contributor Author

cc @munificent wdyt?

@munificent
Copy link
Member

now they are picking that version up by default

This should only happen if there are no stable versions. Since all pre-release versions are lower priority than all stable versions, an any clause should only yield a pre-release version when there are no stable ones at all.

Is there something else going on here?

@jakemac53
Copy link
Contributor Author

There are stable versions, in the 1.x range, but no 2.x stable versions.

@jakemac53
Copy link
Contributor Author

You can repro by creating a pubspec with build_web_compilers: any and doing a pub upgrade, you will get 2.0.0-alpha.0 instead of some 1.x version :(

@jakemac53
Copy link
Contributor Author

Note that the pub site properly recognizes it as a pre-release version https://pub.dartlang.org/packages/build_web_compilers

@jakemac53
Copy link
Contributor Author

also cc @natebosch

@jakemac53
Copy link
Contributor Author

Ok, I got some more information here. It looks like if you have only a dependency on build_web_compilers then you will get the stable version. However, if you add another dependency you can end up getting the alpha version.

The easiest way I have discovered to do that is by adding a dependency on the test package.

For this example my pubspec looks like this:

name: playground
dependencies:
  build_web_compilers: any
  test: ^1.0.0

Here is a gist with the output of pub upgrade --no-precompile -v https://gist.github.com/jakemac53/081d8f600e0a569c4821c765b65cd506, let me know if there is another better way to print tracing info.

Note that it lists test first (even though it appears in my pubspec 2nd), and it looks like that is leading to the selection of build_web_compilers 2.0.0-alpha.0?

@jakemac53
Copy link
Contributor Author

Ah, I think this is ultimately because it selects analyzer 0.36 https://gist.github.com/jakemac53/081d8f600e0a569c4821c765b65cd506, which we don't support in older build_web_compilers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants