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
buildDartPackage: init, dart-sass: init at 1.26.10 #92814
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
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.
I think the docs deserve their own commit
@jonringer Split documentation change into its own commit, and addressed your other feedback. Thank you! |
Hey, this would be nice to have! It might later extended or forked to support building Flutter packages too! I tried verifying on OSX, but my OSX environment is slightly broken right now. I was unable to verify on Linux due to |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Is it feasible to fetch and hash the packages individually? Right now if a package changes, there's no way to know what happened, let alone recover. Large (fragile) fixed-output derivations do make builds unreproducible. |
sass = "sass"; | ||
}; | ||
|
||
meta = with stdenv.lib; { |
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.
meta = with stdenv.lib; { | |
meta = with lib; { |
@@ -0,0 +1,28 @@ | |||
{ stdenv, fetchFromGitHub, buildDartPackage }: |
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.
{ stdenv, fetchFromGitHub, buildDartPackage }: | |
{ lib, stdenv, fetchFromGitHub, buildDartPackage }: |
set -x | ||
export PUB_CACHE="${pubCache}" | ||
pub get --offline --no-precompile | ||
${buildSnapshots} |
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.
set -x | |
export PUB_CACHE="${pubCache}" | |
pub get --offline --no-precompile | |
${buildSnapshots} | |
set -x | |
export PUB_CACHE="${pubCache}" | |
pub get --offline --no-precompile | |
${buildSnapshots} |
inherit (stdenv.lib) concatStringsSep mapAttrsToList; | ||
buildSnapshot = name: path: | ||
with stdenv.lib; '' |
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.
inherit (stdenv.lib) concatStringsSep mapAttrsToList; | |
buildSnapshot = name: path: | |
with stdenv.lib; '' | |
inherit (lib) concatStringsSep mapAttrsToList; | |
buildSnapshot = name: path: | |
with lib; '' |
|
||
diff = "${diffutils.nativeDrv or diffutils}/bin/diff"; | ||
|
||
dartOpts = with stdenv.lib; |
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.
dartOpts = with stdenv.lib; | |
dartOpts = with lib; |
@@ -0,0 +1,165 @@ | |||
{ stdenv, diffutils, dart, makeWrapper }: |
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.
{ stdenv, diffutils, dart, makeWrapper }: | |
{ lib, stdenv, diffutils, dart, makeWrapper }: |
@@ -11,6 +11,7 @@ | |||
<xi:include href="bower.xml" /> | |||
<xi:include href="coq.xml" /> | |||
<xi:include href="crystal.section.xml" /> | |||
<xi:include href="dart.section.xml" /> |
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.
Please convert this to markdown.
the value from the error output. The following output shows the value of | ||
`pubSha256` for the `dart-sass` expression: | ||
|
||
``` |
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.
``` | |
```ShellSession |
sass = "sass"; | ||
}; | ||
|
||
meta = with stdenv.lib; { |
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.
meta = with stdenv.lib; { | |
meta = with lib; { |
expression for building `dart-sass`: | ||
|
||
```nix | ||
{ stdenv, fetchFromGitHub, buildDartPackage }: |
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.
{ stdenv, fetchFromGitHub, buildDartPackage }: | |
{ lib, stdenv, fetchFromGitHub, buildDartPackage }: |
@roberth Agreed; I am now using a different approach in https://github.com/tadfisher/nix-dart, although that repository requires flakes for now. I think I'll close this and look at porting that mechanism instead. |
@tadfisher I'm glad you've found an even better approach. When porting those expressions to Nixpkgs, keep in mind that Hydra won't let you import from derivation (e.g. |
Motivation for this change
The
sass
tool is outdated, and is no longer the reference SASS implementation. The reference implementation is nowdart-sass
, which is written in Dart and runs under the Dart VM. However, nixpkgs lacks a convenience builder for Dart applications.This adds a
buildDartPackage
function, which builds Dart applications using the standardpub
package manager anddart
VM from the Dart SDK. The resulting compiled snapshots will run on any architecture supported by the Dart VM. A wrapper script is generated for launching snapshots using the Dart VM built by nixpkgs.See doc/languages-frameworks/dart.section.md (rendered) for documentation.
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)