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
flutter/dart: remove non-stable versions and bump #109477
flutter/dart: remove non-stable versions and bump #109477
Conversation
@GrahamcOfBorg build dart flutter |
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.
diff LGTM
@GRBurst Can we also have your review here? |
@thiagokokada I tried your your diff and it works with
The same issue occurs when trying to use a beta/dev/master version using |
@PeterZainzinger Huh... going to try, but I don't think this PR is the cause of this issue. If we did the same just by updating how master is current is it would have the same issue. The fault of this problem is that Flutter or Dart is not shipping with all the dependencies needed to build anymore, so we probably need some changes in how Flutter is packaged. |
If anything, this PR will make easier to fix this issue, because instead of trying to fix it in all channels, now the only channel that matters is stable. |
Ok, I see your point. I agree that it is outside of the scope of this PR, although I think we should try to fix it anyway is a we make a big change to this module. I investigated a bit further, downloaded both tarballs (1.22.4 vs 1.22.5) and noticed that the 1.22.5 does not ship node_preamble in its .pub_cache/hosted/pub.dartlang.org directory. The version has not changed at all. The workaround is quite obvious, add the pub package as an source and copy it to cache. But that pretty hacky and maybe there are other packages that are missing as well... |
I created an issue in the flutter repo. The problem in the tarball is pretty obviously on their side. |
@PeterZainzinger Actually I do think the issue is in our side. We need to do the build in two steps, the first one will download the deps and the second one will build the derivation. I gave it a try in this branch: thiagokokada@e2e30e0 It almost works, the dependency resolution now works correctly. But it fails later on with If someone knows how to fix this issue it would be welcome. |
Rebased. |
@PeterZainzinger Fixed the issue. Now Flutter 1.22.5 builds and runs (at least on my machine). |
|
||
rm -rf bin/cache/{artifacts,dart-sdk,downloads} | ||
rm -f bin/cache/*.stamp |
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.
Not really needed since those paths were not in $out
.
I would like to try. Not sure if the outputHash in deps.nix is stable. Looks like a bit of an hack to be tbh and something that has to be maintained in the future. But if it works.... |
It should be. I took this trick from the official docs: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/maven.section.md#double-invocation. Yeah, it is for Maven but applied you can apply the idea in other places. BTW, it is generated from a |
I think how this derivation is currently it could eventually evolve to a more generic build (like
Coincidentally had the same idea. Please test it with commit 1b838f969c699cdc4fd09f6b91dfdd300f36e110 (everything is the same so it will not even trigger a build). Can you review and approve @PeterZainzinger? Also need re-reviews from @GRBurst @ericdallo @babariviere and @SuperSandro2000. |
Some last cleanups:
|
@thiagokokada other than the note above the diff looks good to me. |
I think this PR is mostly ready to merge, but still would like a review from @GRBurst for the Dart parts of it. |
export PUB_CACHE="${repository}" | ||
|
||
pushd "$FLUTTER_TOOLS_DIR" | ||
${dart}/bin/pub get --offline |
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.
Using pub get
here since it works and avoids an offline warning.
Related issue #108606. Nowadays we have multiple outdated versions of Flutter in nixpkgs. Instead, let's focus in having in having stable versions of Flutter working. Users needing to use beta or dev versions of Flutter can use mkFlutter function, that still exists.
For those that need other versions of Dart, they can use the new sources parameter instead.
Needs to do a build in 2-pass now since Google stopped shipping all dependencies needed to build Flutter. This may be an oversight from them since they used to ship everything, but this makes the whole build process more robust. The first step will download all dependencies from pub, and the second step will build Flutter. Since we need to build repository first, we also require a new depsSha256 parameter to be passed, that represents the SHA256 of the resulting derivation of all Flutter dependencies downloaded from https://pub.dev. This commit also makes some changes in mkFlutter, allowing the user to pass src instead of passing version/channel/filename, allowing for more flexibility (i.e: building from a local fork of Flutter).
Rebased and fixed conflicts. @SuperSandro2000 can we have this merged? I think it is in a good state, and while @GRBurst didn't respond it yet it concurs that this is a good idea: #108606 (comment) |
This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 3 packages built:
|
This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 1 package built:
|
Updating Linux Kernel from 5.9 to 5.10, supporting the latest available Kernel (as of this writing); Emacs 28 with support for Pure GTK and Native compilation enabled, the required snippet from [this Reddit post](https://www.reddit.com/r/emacs/comments/kqb9s9/cannot_recompile_packagess_error_wrong_number_of/gj3cfn3/?utm_source=share&utm_medium=web2x&context=3) was included using a short URL provided by Bitly. flutterPackages.dev was removed by [this](NixOS/nixpkgs#109477), changing to default stable packages.
Updating Linux Kernel from 5.9 to 5.10, supporting the latest available Kernel (as of this writing); Emacs 28 with support for Pure GTK and Native compilation enabled, the required snippet from [this Reddit post](https://www.reddit.com/r/emacs/comments/kqb9s9/cannot_recompile_packagess_error_wrong_number_of/gj3cfn3/?utm_source=share&utm_medium=web2x&context=3) was included using a short URL provided by Bitly. flutterPackages.dev was removed by [this](NixOS/nixpkgs#109477), changing to default stable packages.
Updating Linux Kernel from 5.9 to 5.10, supporting the latest available Kernel (as of this writing); Emacs 28 with support for Pure GTK and Native compilation enabled, the required snippet from [this Reddit post](https://www.reddit.com/r/emacs/comments/kqb9s9/cannot_recompile_packagess_error_wrong_number_of/gj3cfn3/?utm_source=share&utm_medium=web2x&context=3) was included using a short URL provided by Bitly. flutterPackages.dev was removed by [this](NixOS/nixpkgs#109477), changing to default stable packages.
Updating Linux Kernel from 5.9 to 5.10, supporting the latest available Kernel (as of this writing); Emacs 28 with support for Pure GTK and Native compilation enabled, the required snippet from [this Reddit post](https://www.reddit.com/r/emacs/comments/kqb9s9/cannot_recompile_packagess_error_wrong_number_of/gj3cfn3/?utm_source=share&utm_medium=web2x&context=3) was included using a short URL provided by Bitly. flutterPackages.dev was removed by [this](NixOS/nixpkgs#109477), changing to default stable packages.
Motivation for this change
Closes #108606.
This PR removes non-stable versions of Dart and Flutter. The reason is that Flutter/Dart is really old nowadays, specially the non-stable versions. Having to maintain multiple versions makes bumps more difficult. Removing it and focusing in the stable will make it easier to bump versions (at least I hope).
For those that need to use
beta
ordev
versions of Dart/Flutter, there is still a way using the following example:Bumps:
dart: 2.10.0 -> 2.10.4, 2.10.4 -> 2.10.5
flutter: 1.22.0 -> 1.22.4, 1.22.4 -> 1.22.5
Didn't bump Flutter to version 1.22.5 because it is missing some dependency. I think it is lack of a proper Dart release with this version of Flutter (Google didn't release Dart 2.10.5), so it tries to download the dependency from https://pub.dev/ and fails because we use--offline
flag during build.I don't think this is something that will happen frequently, so I didn't bother trying to fix it, but we may need to create some way to solve dependencies online before building if this is a constantly issue in the future.Flutter derivation is now build in a 2-pass process: the first step download its dependencies from https://pub.dev, creating a local repository cache, and the second step uses the repository cache from the first step to finally build Flutter. This makes the build process much more robust and future proof, since we don't depend on Google packaging Flutter with all dependencies anymore.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)