Commit Graph

6500 Commits

Author SHA1 Message Date
hacker1024
c4cbf526e9 Merge remote-tracking branch 'NixOS/master' into feature/futter-linux-desktop 2023-04-25 12:51:56 +10:00
Lily Foster
6fd6ce1094
Merge pull request #206476 from winterqt/prefetch-npm-deps-git-dev-deps
prefetch-npm-deps: download dev deps for git deps with install scripts
2023-04-24 20:26:32 -04:00
Alyssa Ross
90a8b9e3fe rustPlatform.buildRustPackage: fix cross
.override breaks splicing, so this was using the shell for the host
platform.
2023-04-24 19:43:39 +00:00
Weijia Wang
1d76b4d7f1
Merge pull request #227634 from GenericNerdyUsername/requireFile-hash
`requireFile`: allow using `hash` instead of `sha256`/`sha1`
2023-04-22 23:42:32 +03:00
Weijia Wang
a6cf8594cb
Merge pull request #227510 from wegank/fhs-aarch64
buildFHSEnv: restrict pkgsi686Linux to x86_64-linux
2023-04-22 22:00:35 +03:00
GenericNerdyUsername
3687bee81c
requireFile: allow using hash instead of sha256/sha1 2023-04-22 16:02:34 +01:00
hacker1024
89bb0ed91b flutter.buildFlutterApplication: Add an option to generate the dependency list with IFD
This is useful for projects outside of Nixpkgs.
2023-04-23 00:32:24 +10:00
hacker1024
9f05297dc8 flutter.buildFlutterApplication: Manually supply the dependency list
This removes the need for IFD.
2023-04-23 00:12:45 +10:00
Artturi
5fd9ce4fa7
Merge pull request #190610 from amjoseph-nixpkgs/pr/build-rust-crate/gdk3 2023-04-22 15:45:56 +03:00
Weijia Wang
3c6e26b2ee buildFHSEnv: restrict pkgsi686Linux to x86_64-linux 2023-04-22 15:31:27 +03:00
Doron Behar
a82c8611ce
buildGoModule: don't inherit build hooks when building go-modules (#225349)
* buildGoModule: don't inherit postBuild hook when building go-modules

This is a slight revert of 5ce647b8bf
(#212800).

Inheriting these hooks in the `.go-modules` derivation can be confusing:
One doesn't expect them to run when generating the fixed output modules
derivation, but only on the main derivation. A `postBuild` hook that
adds some files to $out will cause a very hard to debug issue[1].

This commit adds support for a dedicated `modPostBuild` hook that will
be used only by the derivation building `.go-modules`. Additionally,
`go.section.md` now explains these attributes behavior better.

[1]:
https://discourse.nixos.org/t/cant-update-a-go-package-getting-go-inconsistent-vendoring/27063/6

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2023-04-22 11:08:54 +10:00
Florian Klink
6b27ed3229
Merge pull request #169116 from ElvishJerricco/systemd-stage-1-networkd
Systemd stage 1 networkd
2023-04-21 18:40:59 +02:00
Artturi
ddc418f3b1
Merge pull request #187210 from pinn3/fetchgit/remove-outdated-comment 2023-04-19 03:49:19 +03:00
7c6f434c
17b4ad7c2f
Merge pull request #217587 from winterqt/build-dotnet-module-darwin-sandbox
buildDotnetModule: fix sandboxed builds on darwin
2023-04-17 14:08:21 +00:00
hacker1024
37e93f7c3b flutter.buildFlutterApplication: Supply package metadata to overrides 2023-04-17 14:40:18 +10:00
Adam Joseph
9e3b2a5822
Merge pull request #226366 from mmlb/rename-gnatboot
gnatboot: rename to gnat-bootstrap
2023-04-16 22:37:53 +00:00
hacker1024
0495725a1f flutter.buildFlutterApplication: Introduce a package override repository
Some Flutter packages require additional attribute values to be added to buildFlutterApplication, to add things like libraries and environment variables.

To prevent duplication in applications that use the packages, a repository of package overrides is kept. buildFlutterApplication will look for package overrides for each dependency, and apply them by calling overrideAttrs on itself.
2023-04-17 03:21:01 +10:00
hacker1024
329c494d0c flutter.buildFlutterApplication: Allow overriding configuration attributes
This allows thing like `flutterBuildFlags` and `runtimeDependencies` to be overridden with `overrideAttrs`.

Attributes that affect dependency retrieval cannot be overridden.
2023-04-17 02:59:02 +10:00
hacker1024
87f809e0c6 dart.list-dart-deps: Add list-dart-deps function
This uses `dart pub deps` (https://dart.dev/tools/pub/cmd/pub-deps) to retrieve information about project dependencies.

It requires a fetch-dart-deps derivation as input.
2023-04-16 23:16:17 +10:00
hacker1024
4f5dd08fe8 dart.fetch-dart-deps: Add hook runtime dependencies 2023-04-16 23:11:07 +10:00
hacker1024
b68a185b0f dart.fetch-dart-deps: Expose the package cache files through passthru 2023-04-16 23:06:22 +10:00
hacker1024
bbfc7911d3 flutter.buildFlutterApplication: Supply runtime dependencies
This wraps Flutter programs with an appropriate LD_LIBRARY_PATH.

For some reason, the RUNPATH of the executable is not used to load dynamic libraries in dart:ffi with DynamicLibrary.open().

This could alternatively be fixed with patchelf --add-needed, but this would cause all the libraries to be opened immediately,
which is not what application authors expect.

The name of the runtimeDependencies argument was chosen to match autoPatchelfHook, which has a similar feature.
2023-04-16 19:25:42 +10:00
Atemu
f63a12f296 tree-wide: buildFHSUserEnv -> buildFHSEnv 2023-04-16 10:15:13 +02:00
hacker1024
eefb67036f flutter.buildFlutterApplication: Move debugging symbols into another output
This reduces the size of the executable.

It works well with Nix - if the user includes the version in their bug report, the exact debugging symbols required can easily be found.
2023-04-16 16:47:08 +10:00
hacker1024
5a5435dea6 flutter.buildFlutterApplication: Add flutterBuildFlags argument 2023-04-16 15:45:09 +10:00
Manuel Mendez
31d6802773 gnatboot: rename to gnat-bootstrap
Most other bootstrap compilers are named -bootstrap so lets follow that
pattern.
2023-04-15 18:52:14 -04:00
hacker1024
1f7eab1c38 dart.fetch-dart-deps: Fix invalid syntax in pubspec validation statement 2023-04-16 03:56:14 +10:00
hacker1024
075f50f2d1 dart.fetch-dart-deps: Compress the generated pubspec.lock file
This is much more practical for users to copy, as it significantly reduces the length of the output.
2023-04-16 03:32:26 +10:00
hacker1024
643b62c8f1 dart.fetch-dart-deps: Don't allow overriding the deps derivation name 2023-04-16 03:21:29 +10:00
hacker1024
5fa3b41041 dart.fetch-dart-deps: Verify the pubspec.lock as well as pubspec.yaml
88275ca6d6 inadvertently stopped the pubspec.lock from changing, as it copied the file before running pub get.

pub get can modify the pubspec.lock to update it to newer formats (for example by adding hashes and updating URLs, see an example diff below). We do not need the modifications at any later stage, so we can preserve the original file.

      boolean_selector:
        dependency: transitive
        description:
          name: boolean_selector
    +      sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
    +      url: "https://pub.dev"
    -      url: "https://pub.dartlang.org"
        source: hosted
    +    version: "2.1.1"
    -    version: "2.1.0"
2023-04-16 03:20:36 +10:00
hacker1024
0e5db63dc3 dart.fetch-dart-deps: Don't delete .git/pub-packages 2023-04-16 02:56:43 +10:00
hacker1024
88275ca6d6 flutter.buildFlutterApplication: Allow using a custom pubspec.lock 2023-04-16 01:49:43 +10:00
hacker1024
d2ab34122d dart.fetch-dart-deps: Remove stray comment from the dependency derivation 2023-04-16 00:55:55 +10:00
gilice
4e68ee327e flutter.buildFlutterApplication: Add an explanation when a pubspec mismatch occurs 2023-04-16 00:35:15 +10:00
hacker1024
915a6779fc flutter.buildFlutterApplication: Refactor dependency setup as a standalone derivation with an output hook
This allows anything that needs to build a Dart application (such as a future `buildDartApplication` function) to use the same setup.
2023-04-16 00:17:41 +10:00
Kira Bruneau
99a95083df
Merge pull request #178280 from veprbl/pr/ccache_clang_fix
cc-wrapper: disable response files for ccache
2023-04-15 06:47:01 -04:00
hacker1024
f00f918e27 flutter: Remove cached Git package Git directories
Pub does not perform any Git operations on the cached package directly, instead cloning it through a mirror.

The .git directories are not needed, and are a source of non-determinism.
2023-04-15 20:30:46 +10:00
hacker1024
c3a87421ae flutter: Don't tarball the package cache
Co-authored-by: FlafyDev <flafyarazi@gmail.com>

The dependency fixed-output derivation now uses the recursive hash mode to avoid tarballing and copying all the files.

https://github.com/NixOS/nix/issues/6660 was ran into during the development of this change. Input references were found in the Git package cache before nukeReferences was used.

It turns out that the mirrors in the Git package cache do not actually need to be preserved, as the SDK does not use them during the build process. They are therefore deleted in the dependency derivation and re-created as blank repositories in the main derivation.

A description of the Git package cache layout can be found here: c890afa1d6/lib/src/source/git.dart (L339)
2023-04-15 20:17:44 +10:00
Weijia Wang
ddd8604a3b moveBuildTree: init 2023-04-14 21:08:27 +03:00
hacker1024
fdce3f30c4 flutter.mkFlutterApp: Don't hash more unstable files
Files and directories such as .dart_tool, .flutter-plugins, .packages and .pub-cache/hosted/*/.cache will be happily regenerated by the SDK in an offline environment.

The patches being made to these files and directories to remove non-determinism were flawed: They did not handle cases where files only appeared in one run, or cases where tooling versions had an effect on the output.
2023-04-15 03:18:56 +10:00
Sandro
b04d4bad27
Merge pull request #216992 from SuperSandro2000/stdenvNative-fix-eval
{bintools,cc}-wrapper: don't fallback to version = null
2023-04-14 11:22:20 +02:00
hacker1024
7e12e3afaa flutter.mkFlutterApp: Remove the target architecture from the dependency derivation name
As the dependency tarballs no longer include SDK artifacts, they are not platform dependent.
2023-04-14 14:25:33 +10:00
hacker1024
30caca0839 flutter.mkFlutterApp: Add Git to nativeBuildInputs
The deterministic Git script depends on it.
2023-04-14 02:16:04 +10:00
hacker1024
f7e3c19cc8 flutter.mkFlutterApp: Don't vendor arbitrary configuration files 2023-04-14 01:49:09 +10:00
hacker1024
8f9aa6b18b flutter.mkFlutterApp: Don't use autoPatchelf on package cache
While this may be beneficial for packages that ship native binaries, this causes issues due to Flutter packages that have inappropriately uploaded build artifacts (such as those from example subprojects) to pub.dev.
2023-04-14 01:41:58 +10:00
hacker1024
04e7ced7e2 mkFlutterApp: Don't fetch prebuilt artifacts
Artifacts are now supplied by the Flutter SDK derivation.

In addition, they are no longer a factor in the dependency hash calculation.
2023-04-13 22:01:42 +10:00
hacker1024
6d50bcc487 mkFlutterApp: Deduplicate build environment setup
The build environment is now set up by the Flutter wrapper, and does not need to be done in mkFlutterApp.
2023-04-13 22:00:24 +10:00
hacker1024
d5aa0c1f97 Merge remote-tracking branch 'NixOS/master' into patch-3 2023-04-13 19:22:50 +10:00
Sandro Jäckel
7090651071
{bintools,cc}-wrapper: don't fallback to version = null
mkDerivation cannot handle that
2023-04-12 22:08:36 +02:00
Sandro Jäckel
a7dbdb7644
cc-wrapper: don't set env to null when nativeTools is used
This is not allowed and fails fatal
2023-04-12 22:08:36 +02:00