Merge master into staging-next

This commit is contained in:
nixpkgs-ci[bot]
2026-01-27 06:07:14 +00:00
committed by GitHub
22 changed files with 1665 additions and 89 deletions
+7 -1
View File
@@ -66,7 +66,13 @@ async function dismissReviews({ github, context, core, dry, reviewKey }) {
changesRequestedReviews.every(
(review) =>
commentResolvedRegex.test(review.body) ||
(reviewKey && reviewKeyRegex.test(review.body)),
(reviewKey && reviewKeyRegex.test(review.body)) ||
// If we are called by check-commits and the review body is clearly
// from `commits.js`, then we can safely dismiss the review.
// This helps with pre-existing reviews (before the comments were added).
(reviewKey &&
reviewKey === 'check-commits' &&
review.body.includes('PR / Check / cherry-pick')),
)
) {
reviewsToDismiss = changesRequestedReviews
+48 -57
View File
@@ -1,73 +1,64 @@
{
lib,
stdenv,
buildEnv,
}:
# A special kind of derivation that is only meant to be consumed by the
# nix-shell.
{
name ? "nix-shell",
# a list of packages to add to the shell environment
packages ? [ ],
# propagate all the inputs from the given derivations
inputsFrom ? [ ],
buildInputs ? [ ],
nativeBuildInputs ? [ ],
propagatedBuildInputs ? [ ],
propagatedNativeBuildInputs ? [ ],
...
}@attrs:
let
mergeInputs =
name:
(attrs.${name} or [ ])
++
# 1. get all `{build,nativeBuild,...}Inputs` from the elements of `inputsFrom`
# 2. since that is a list of lists, `flatten` that into a regular list
# 3. filter out of the result everything that's in `inputsFrom` itself
# this leaves actual dependencies of the derivations in `inputsFrom`, but never the derivations themselves
(lib.subtractLists inputsFrom (lib.flatten (lib.catAttrs name inputsFrom)));
lib.extendMkDerivation {
constructDrv = stdenv.mkDerivation;
rest = removeAttrs attrs [
"name"
excludeDrvArgNames = [
"packages"
"inputsFrom"
"buildInputs"
"nativeBuildInputs"
"propagatedBuildInputs"
"propagatedNativeBuildInputs"
"shellHook"
];
in
stdenv.mkDerivation (
{
inherit name;
extendDrvArgs =
_finalAttrs:
{
name ? "nix-shell",
# a list of packages to add to the shell environment
packages ? [ ],
# propagate all the inputs from the given derivations
inputsFrom ? [ ],
...
}@attrs:
let
mergeInputs =
name:
(attrs.${name} or [ ])
++
# 1. get all `{build,nativeBuild,...}Inputs` from the elements of `inputsFrom`
# 2. since that is a list of lists, `flatten` that into a regular list
# 3. filter out of the result everything that's in `inputsFrom` itself
# this leaves actual dependencies of the derivations in `inputsFrom`, but never the derivations themselves
(lib.subtractLists inputsFrom (lib.flatten (lib.catAttrs name inputsFrom)));
in
{
inherit name;
buildInputs = mergeInputs "buildInputs";
nativeBuildInputs = packages ++ (mergeInputs "nativeBuildInputs");
propagatedBuildInputs = mergeInputs "propagatedBuildInputs";
propagatedNativeBuildInputs = mergeInputs "propagatedNativeBuildInputs";
buildInputs = mergeInputs "buildInputs";
nativeBuildInputs = packages ++ (mergeInputs "nativeBuildInputs");
propagatedBuildInputs = mergeInputs "propagatedBuildInputs";
propagatedNativeBuildInputs = mergeInputs "propagatedNativeBuildInputs";
shellHook = lib.concatStringsSep "\n" (
lib.catAttrs "shellHook" (lib.reverseList inputsFrom ++ [ attrs ])
);
shellHook = lib.concatStringsSep "\n" (
lib.catAttrs "shellHook" (lib.reverseList inputsFrom ++ [ attrs ])
);
phases = [ "buildPhase" ];
phases = attrs.phases or [ "buildPhase" ];
buildPhase = ''
{ echo "------------------------------------------------------------";
echo " WARNING: the existence of this path is not guaranteed.";
echo " It is an internal implementation detail for pkgs.mkShell.";
echo "------------------------------------------------------------";
echo;
# Record all build inputs as runtime dependencies
export;
} >> "$out"
'';
buildPhase =
attrs.buildPhase or ''
{ echo "------------------------------------------------------------";
echo " WARNING: the existence of this path is not guaranteed.";
echo " It is an internal implementation detail for pkgs.mkShell.";
echo "------------------------------------------------------------";
echo;
# Record all build inputs as runtime dependencies
export;
} >> "$out"
'';
preferLocalBuild = true;
}
// rest
)
preferLocalBuild = attrs.preferLocalBuild or true;
};
}
@@ -0,0 +1,58 @@
From 91e2418c37fce511eeaa1d1bb34a0d7a25668d40 Mon Sep 17 00:00:00 2001
From: OPNA2608 <opna2608@protonmail.com>
Date: Tue, 20 Jan 2026 15:29:03 +0100
Subject: [PATCH] Makefile.{dmd,ldc}: Pin C standard to C99
Code is definitely not C23-compatible, and I imagine C99 is *prolly* what this was initially targeting.
---
Makefile.dmd | 4 ++--
Makefile.ldc | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.dmd b/Makefile.dmd
index 24a1d06..7c1b7c2 100644
--- a/Makefile.dmd
+++ b/Makefile.dmd
@@ -3,7 +3,7 @@ COMFLAGS=
DLINK=$(COMFLAGS)
VERSION=$(shell cat Version)
DFLAGS=$(COMFLAGS) -I./src -J./src/c64 -J./src/font -O
-CFLAGS=$(COMFLAGS) -O1
+CFLAGS=$(COMFLAGS) -O1 -std=c99
CXXFLAGS=-I./src -O3
COMPILE.d = $(DC) $(DFLAGS) -c -of$@
OUTPUT_OPTION=
@@ -21,7 +21,7 @@ $(TARGET): $(C64OBJS) $(OBJS) $(CXX_OBJS)
$(CXX) $(CXXFLAGS) -c $< -o $@
.c.o : $(C_SRCS)
- $(CC) -c $< -o $@
+ $(CC) $(CFLAGS) -c $< -o $@
ct: $(C64OBJS) $(CTOBJS)
diff --git a/Makefile.ldc b/Makefile.ldc
index b89077a..a6c4714 100644
--- a/Makefile.ldc
+++ b/Makefile.ldc
@@ -6,7 +6,7 @@ LIBS=-L-ldl -L-lstdc++
COMFLAGS=-O2
VERSION=$(shell cat Version)
DFLAGS=$(COMFLAGS) -I./src -J./src/c64 -J./src/font
-CFLAGS=$(COMFLAGS)
+CFLAGS=$(COMFLAGS) -std=c99
CXXFLAGS=$(COMFLAGS) -I./src
COMPILE.d = $(DC) $(DFLAGS) -c
DC=ldc2
@@ -28,7 +28,7 @@ ccutter:$(C64OBJS) $(OBJS) $(CXX_OBJS)
$(CXX) $(CXXFLAGS) -c $< -o $@
.c.o : $(C_SRCS)
- $(CC) -c $< -o $@
+ $(CC) $(CFLAGS) -c $< -o $@
ct: $(C64OBJS) $(CTOBJS)
--
2.51.2
+20 -4
View File
@@ -9,31 +9,44 @@
}:
stdenv.mkDerivation {
pname = "cheesecutter";
version = "unstable-2021-02-27";
version = "2.9-beta-3-unstable-2021-02-27";
src = fetchFromGitHub {
owner = "theyamo";
repo = "CheeseCutter";
rev = "84450d3614b8fb2cabda87033baab7bedd5a5c98";
sha256 = "sha256:0q4a791nayya6n01l0f4kk497rdq6kiq0n72fqdpwqy138pfwydn";
hash = "sha256-tnnuLhrBY34bduJYgOM0uOWTyJzEARqANcp7ZUM6imA=";
};
patches = [
# https://github.com/theyamo/CheeseCutter/pull/60
./1001-cheesecutter-Pin-C-standard-to-C99.patch
./0001-Drop-baked-in-build-date-for-r13y.patch
]
++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch;
++ lib.optionals stdenv.hostPlatform.isDarwin [
./0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch
];
strictDeps = true;
nativeBuildInputs = [
acme
ldc
]
++ lib.optional (!stdenv.hostPlatform.isDarwin) patchelf;
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
patchelf
];
buildInputs = [ SDL ];
enableParallelBuilding = true;
makefile = "Makefile.ldc";
installPhase = ''
runHook preInstall
for exe in {ccutter,ct2util}; do
install -D $exe $out/bin/$exe
done
@@ -45,6 +58,8 @@ stdenv.mkDerivation {
for res in $(ls icons | sed -e 's/cc//g' -e 's/.png//g'); do
install -Dm444 icons/cc$res.png $out/share/icons/hicolor/''${res}x''${res}/apps/cheesecutter.png
done
runHook postInstall
'';
postFixup =
@@ -71,5 +86,6 @@ stdenv.mkDerivation {
"x86_64-darwin"
];
maintainers = with lib.maintainers; [ OPNA2608 ];
mainProgram = "ccutter";
};
}
+1 -1
View File
@@ -40,7 +40,7 @@ buildNpmPackage (finalAttrs: {
postInstall = ''
wrapProgram $out/bin/claude \
--set DISABLE_AUTOUPDATER 1 \
--set DISABLE_INSTALLATION_CHECKS 1
--set DISABLE_INSTALLATION_CHECKS 1 \
--unset DEV \
--prefix PATH : ${
lib.makeBinPath (
+5 -5
View File
@@ -11,16 +11,16 @@ let
in
stdenv.mkDerivation (finalAttrs: {
pname = "clouddrive2";
version = "0.9.22";
version = "0.9.23";
src = fetchurl {
url = "https://github.com/cloud-fs/cloud-fs.github.io/releases/download/v${finalAttrs.version}/clouddrive-2-${os}-${arch}-${finalAttrs.version}.tgz";
hash =
{
x86_64-linux = "sha256-bkispptxOoCKon0ZjW+U5M+kjpPDWErr3TpZKPtQxNY=";
aarch64-linux = "sha256-9yRd3982L8fRowpb+Id63CUywe1l5s8/07WmlAGt0Ig=";
x86_64-darwin = "sha256-athL8VXhj/g0FwSV2gt7DdAnrKvQ3hIp3fwxTs3Ucw0=";
aarch64-darwin = "sha256-xcW56Y4WoT86vyA+XG4vZ0HDYGIdMmQ9PYz4b7X7Q/c=";
x86_64-linux = "sha256-QDNfSA9DErES1QrreQyFZpgEv0tgaMao1vsle/jHYbc=";
aarch64-linux = "sha256-3dvzFJsoKhEgmSEqTw7aK466zexUQeTDkE0XqYVYDoY=";
x86_64-darwin = "sha256-N8alWOiEUVGZY3gkTEM8eQ41U+j+leKfUdv26YqBHao=";
aarch64-darwin = "sha256-OgpmcYrIjYdE37X3KC2iCrGKUTrLCRViVsDYsVFYsXU=";
}
.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
};
+2 -2
View File
@@ -14,13 +14,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "haruna";
version = "1.7.0";
version = "1.7.1";
src = fetchFromGitLab {
owner = "multimedia";
repo = "haruna";
rev = "v${finalAttrs.finalPackage.version}";
hash = "sha256-FRYsUsZBLXhFCZslQtaD10fd3SqbJ+4TKKShIpuUkQk=";
hash = "sha256-yoYF9R4Z8W7Alw3EL3sfJYndjxCZxTu6fQrCXQzypx8=";
domain = "invent.kde.org";
};
+3 -3
View File
@@ -6,16 +6,16 @@
rustPlatform.buildRustPackage rec {
pname = "minijinja";
version = "2.14.0";
version = "2.15.1";
src = fetchFromGitHub {
owner = "mitsuhiko";
repo = "minijinja";
rev = version;
hash = "sha256-WPjhDj9Qlu38gWIX9ExwfL+OLoW8+RJZwKo1gfvUKn8=";
hash = "sha256-b9Qmst+TXGGTx1k/TnDs4m1nL8aTgNYRCreNLXHCd3I=";
};
cargoHash = "sha256-Wvlw0djiQTT/JTWdnNivbpvFVOelWdCSHT3fxy2cdwE=";
cargoHash = "sha256-Mpu4Cg3CPvTLAHUnv5pfV77c0aGPyfAeFuhM4iu6Em0=";
# The tests relies on the presence of network connection
doCheck = false;
@@ -16,14 +16,14 @@
python3.pkgs.buildPythonPackage rec {
pname = "nautilus-open-any-terminal";
version = "0.8.0";
version = "0.8.1";
pyproject = true;
src = fetchFromGitHub {
owner = "Stunkymonkey";
repo = "nautilus-open-any-terminal";
tag = version;
hash = "sha256-D67mp+ha1xdRxkWeNxyKW3ZIyD40LoqBrNjoBqw+9rE=";
hash = "sha256-SqkvQZZXSFC5WRjOn/6uPx+bDWFCz1g6OtCatUM9+0U=";
};
patches = [ ./hardcode-gsettings.patch ];
+5 -5
View File
@@ -2,7 +2,6 @@
lib,
fetchFromGitHub,
rustPlatform,
stdenvNoCC,
gitMinimal,
versionCheckHook,
nix-update-script,
@@ -10,16 +9,16 @@
rustPlatform.buildRustPackage (finalAttrs: {
pname = "rumdl";
version = "0.0.221";
version = "0.1.1";
src = fetchFromGitHub {
owner = "rvben";
repo = "rumdl";
tag = "v${finalAttrs.version}";
hash = "sha256-r9aVSllmz7fXlePRC/vS6vxmi7zhUyVPEEo6dEkokKg=";
hash = "sha256-cJRJVo/YoSst5NJXAZPJFhXFM6Fmqy/UfuOK2OGLi2o=";
};
cargoHash = "sha256-LedT/ZwDz9FBsHZdObPZc2CoBNR8gNYF/4kvefgmNq8=";
cargoHash = "sha256-Y1KqqDGEjp2+0BwdAgooBjPOQtGbNDwwuXFH97XvXb4=";
cargoBuildFlags = [
"--bin=rumdl"
@@ -27,7 +26,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
# Non-specific tests often fail on Darwin (especially aarch64-darwin),
# on both Hydra and GitHub-hosted runners, even with __darwinAllowLocalNetworking enabled.
doCheck = !stdenvNoCC.hostPlatform.isDarwin;
# proptest fails frequently
doCheck = false;
nativeCheckInputs = [
gitMinimal
+4 -1
View File
@@ -47,7 +47,10 @@ buildNpmPackage (finalAttrs: {
homepage = "https://github.com/louislam/uptime-kuma";
changelog = "https://github.com/louislam/uptime-kuma/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ julienmalka ];
maintainers = with lib.maintainers; [
julienmalka
felixsinger
];
# FileNotFoundError: [Errno 2] No such file or directory: 'xcrun'
broken = stdenv.hostPlatform.isDarwin;
};
+3 -3
View File
@@ -9,17 +9,17 @@
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "wallust";
version = "3.4.0";
version = "3.5.2";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "explosion-mental";
repo = "wallust";
rev = finalAttrs.version;
hash = "sha256-tNlSRdldzAXpM3x4XGVZeidwhplYu7xR7h7qPELaasE=";
hash = "sha256-ZgkeM9gMw9TB5NR+xyxBepKHO16bLVVFJN4IY39gllg=";
};
cargoHash = "sha256-7x217i1htwHoIc+uvYNwpefIRnPRV7RI0f4c4R2k8tU=";
cargoHash = "sha256-XrIi+8p2OZ7O6MTgqKbgN/9gLUbvB7uN9Yr2X1BYHIU=";
nativeBuildInputs = [
makeWrapper
@@ -194,6 +194,10 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
gtk3
libepoxy
]
++ lib.optionals (lib.versionAtLeast flutterVersion "3.41") [
at-spi2-atk
glib
];
dontPatch = true;
@@ -270,6 +274,11 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace src/flutter/third_party/dart/runtime/bin/process_linux.cc \
--replace-fail "(unsigned int first, unsigned int last, int flags)" "(unsigned int first, unsigned int last, int flags) noexcept(true)"
''
# src/flutter/third_party/libcxx/include/__type_traits/is_referenceable.h:33:1: error: templates must have C++ linkage
+ lib.optionalString (lib.versionAtLeast flutterVersion "3.41") ''
substituteInPlace src/flutter/shell/platform/linux/fl_view_accessible.cc \
--replace-fail "// Workaround missing C code compatibility in ATK header." "#include <glib.h>"
''
+ ''
popd
'';
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,21 @@
diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart
index df67547..eacc7c4 100644
--- a/packages/flutter_tools/lib/src/flutter_cache.dart
+++ b/packages/flutter_tools/lib/src/flutter_cache.dart
@@ -51,16 +51,6 @@ class FlutterCache extends Cache {
registerArtifact(IosUsbArtifacts(artifactName, this, platform: platform));
}
registerArtifact(FontSubsetArtifacts(this, platform: platform));
- registerArtifact(
- PubDependencies(
- logger: logger,
- // flutter root and pub must be lazily initialized to avoid accessing
- // before the version is determined.
- flutterRoot: () => Cache.flutterRoot!,
- pub: () => pub,
- projectFactory: projectFactory,
- ),
- );
}
}
@@ -0,0 +1,29 @@
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart
index e4e474ab6e..5548599802 100644
--- a/packages/flutter_tools/lib/src/runner/flutter_command.dart
+++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart
@@ -1693,7 +1693,7 @@ Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and
// Populate the cache. We call this before pub get below so that the
// sky_engine package is available in the flutter cache for pub to find.
- if (shouldUpdateCache) {
+ if (false) {
// First always update universal artifacts, as some of these (e.g.
// ios-deploy on macOS) are required to determine `requiredArtifacts`.
final bool offline;
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
index a1104da..1749d65 100644
--- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
+++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
@@ -437,11 +437,6 @@
// Required to support `flutter --version` before artifacts are cached.
await globals.cache.updateAll(<DevelopmentArtifact>{DevelopmentArtifact.informative});
- globals.flutterVersion.ensureVersionFile();
- if (await _shouldCheckForUpdates(topLevelResults)) {
- await globals.flutterVersion.checkFlutterVersionFreshness();
- }
-
// See if the user specified a specific device.
final specifiedDeviceId = topLevelResults[FlutterGlobalOptions.kDeviceIdOption] as String?;
if (specifiedDeviceId != null) {
@@ -0,0 +1,68 @@
From 6df275df3b8694daf16302b407520e3b1dee6724 Mon Sep 17 00:00:00 2001
From: Philip Hayes <philiphayes9@gmail.com>
Date: Thu, 12 Sep 2024 13:23:00 -0700
Subject: [PATCH] fix: cleanup xcode_backend.sh to fix iOS build w/
`NixOS/nixpkgs` flutter
This patch cleans up `xcode_backend.sh`. It now effectively just runs
`exec $FLUTTER_ROOT/bin/dart ./xcode_backend.dart`.
The previous `xcode_backend.sh` tries to discover `$FLUTTER_ROOT` from
argv[0], even though its presence is already guaranteed (the wrapped
`xcode_backend.dart` also relies on this env).
When using nixpkgs flutter, the flutter SDK directory is composed of several
layers, joined together using symlinks (called a `symlinkJoin`). Without this
patch, the auto-discover traverses the symlinks into the wrong layer, and so it
uses an "unwrapped" `dart` command instead of a "wrapped" dart that sets some
important envs/flags (like `$FLUTTER_ROOT`).
Using the "unwrapped" dart then manifests in this error when compiling, since
it doesn't see the ios build-support artifacts:
```
$ flutter run -d iphone
Running Xcode build...
Xcode build done. 6.4s
Failed to build iOS app
Error (Xcode): Target debug_unpack_ios failed: Error: Flutter failed to create a directory at "/<nix-store>/XXXX-flutter-3.24.1-unwrapped/bin/cache/artifacts".
```
---
packages/flutter_tools/bin/xcode_backend.sh | 25 ++++-----------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/packages/flutter_tools/bin/xcode_backend.sh b/packages/flutter_tools/bin/xcode_backend.sh
index 2889d7c8e4..48b9d06c6e 100755
--- a/packages/flutter_tools/bin/xcode_backend.sh
+++ b/packages/flutter_tools/bin/xcode_backend.sh
@@ -13,24 +13,7 @@
# exit on error, or usage of unset var
set -euo pipefail
-# Needed because if it is set, cd may print the path it changed to.
-unset CDPATH
-
-function follow_links() (
- cd -P "$(dirname -- "$1")"
- file="$PWD/$(basename -- "$1")"
- while [[ -h "$file" ]]; do
- cd -P "$(dirname -- "$file")"
- file="$(readlink -- "$file")"
- cd -P "$(dirname -- "$file")"
- file="$PWD/$(basename -- "$file")"
- done
- echo "$file"
-)
-
-PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-FLUTTER_ROOT="$BIN_DIR/../../.."
-DART="$FLUTTER_ROOT/bin/dart"
-
-"$DART" "$BIN_DIR/xcode_backend.dart" "$@" "ios"
+# Run `dart ./xcode_backend.dart` with the dart from $FLUTTER_ROOT.
+dart="${FLUTTER_ROOT}/bin/dart"
+xcode_backend_dart="${BASH_SOURCE[0]%.sh}.dart"
+exec "${dart}" "${xcode_backend_dart}" "$@" "ios"
--
2.46.0
@@ -0,0 +1,59 @@
Fix for macOS build issue in Flutter >= 3.35
Since version 3.35, the behavior of macos_assemble.sh and xcode_backend.sh
is almost identical. This caused the same error for macOS that previously
occurred for iOS.
Derived from the iOS patch: ./fix-ios-build-xcode-backend-sh.patch
Example error:
```
$ flutter run -d macos
Launching lib/main.dart on macOS in debug mode...
Target debug_unpack_macos failed: Error: Flutter failed to create a directory at "/<nix-store>/XXXX-flutter-3.35.1-unwrapped/bin/cache/artifacts".
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
Failed to copy Flutter framework.
** BUILD FAILED **
```
---
diff --git a/packages/flutter_tools/bin/macos_assemble.sh b/packages/flutter_tools/bin/macos_assemble.sh
index 28acf8842..d0f2923df 100644
--- a/packages/flutter_tools/bin/macos_assemble.sh
+++ b/packages/flutter_tools/bin/macos_assemble.sh
@@ -13,29 +13,13 @@
# exit on error, or usage of unset var
set -euo pipefail
-# Needed because if it is set, cd may print the path it changed to.
-unset CDPATH
-
-function follow_links() (
- cd -P "$(dirname -- "$1")"
- file="$PWD/$(basename -- "$1")"
- while [[ -h "$file" ]]; do
- cd -P "$(dirname -- "$file")"
- file="$(readlink -- "$file")"
- cd -P "$(dirname -- "$file")"
- file="$PWD/$(basename -- "$file")"
- done
- echo "$file"
-)
-
-PROG_NAME="$(follow_links "${BASH_SOURCE[0]}")"
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-FLUTTER_ROOT="$BIN_DIR/../../.."
-DART="$FLUTTER_ROOT/bin/dart"
+# Run `dart ./xcode_backend.dart` with the dart from $FLUTTER_ROOT.
+dart="${FLUTTER_ROOT}/bin/dart"
+xcode_backend_dart="$(dirname "${BASH_SOURCE[0]}")/xcode_backend.dart"
# Main entry point.
if [[ $# == 0 ]]; then
- "$DART" "$BIN_DIR/xcode_backend.dart" "build" "macos"
+ exec "${dart}" "${xcode_backend_dart}" "build" "macos"
else
- "$DART" "$BIN_DIR/xcode_backend.dart" "$@" "macos"
+ exec "${dart}" "${xcode_backend_dart}" "$@" "macos"
fi
@@ -0,0 +1,220 @@
This patch introduces an intermediate Gradle build step to alter the behavior
of flutter_tools' Gradle project, specifically moving the creation of `build`
and `.gradle` directories from within the Nix Store to somewhere in `$HOME/.cache/flutter/nix-flutter-tools-gradle/$engineShortRev`.
Without this patch, flutter_tools' Gradle project tries to generate `build` and `.gradle`
directories within the Nix Store. Resulting in read-only errors when trying to build a
Flutter Android app at runtime.
This patch takes advantage of the fact settings.gradle takes priority over settings.gradle.kts to build the intermediate Gradle project
when a Flutter app runs `includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")`
`rootProject.buildFileName = "/dev/null"` so that the intermediate project doesn't use `build.gradle.kts` that's in the same directory.
The intermediate project makes a `settings.gradle` file in `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/` and `includeBuild`s it.
This Gradle project will build the actual `packages/flutter_tools/gradle` project by setting
`rootProject.projectDir = new File("$settingsDir")` and `apply from: new File("$settingsDir/settings.gradle.kts")`.
To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle/<short engine rev>/`, we need to set `buildDirectory`.
To move `.gradle` as well, the `--project-cache-dir` argument must be passed to the Gradle wrapper.
Changing the `GradleUtils.getExecutable` function signature is a delibarate choice, to ensure that no new unpatched usages slip in.
--- /dev/null
+++ b/packages/flutter_tools/gradle/settings.gradle
@@ -0,0 +1,19 @@
+rootProject.buildFileName = "/dev/null"
+
+def engineShortRev = (new File("$settingsDir/../../../bin/internal/engine.version")).text.take(10)
+def dir = new File("$System.env.HOME/.cache/flutter/nix-flutter-tools-gradle/$engineShortRev")
+dir.mkdirs()
+def file = new File(dir, "settings.gradle")
+
+file.text = """
+rootProject.projectDir = new File("$settingsDir")
+apply from: new File("$settingsDir/settings.gradle.kts")
+
+gradle.allprojects { project ->
+ project.beforeEvaluate {
+ project.layout.buildDirectory = new File("$dir/build")
+ }
+}
+"""
+
+includeBuild(dir)
--- a/packages/flutter_tools/gradle/build.gradle.kts
+++ b/packages/flutter_tools/gradle/build.gradle.kts
@@ -4,6 +4,11 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
+// While flutter_tools runs Gradle with a --project-cache-dir, this startParameter
+// is not passed correctly to the Kotlin Gradle plugin for some reason, and so
+// must be set here as well.
+gradle.startParameter.projectCacheDir = layout.buildDirectory.dir("cache").get().asFile
+
plugins {
`java-gradle-plugin`
groovy
--- a/packages/flutter_tools/lib/src/android/gradle.dart
+++ b/packages/flutter_tools/lib/src/android/gradle.dart
@@ -474,9 +474,9 @@ class AndroidGradleBuilder implements AndroidBuilder {
// from the local.properties file.
updateLocalProperties(project: project, buildInfo: androidBuildInfo.buildInfo);
- final options = <String>[];
-
- final String gradleExecutablePath = _gradleUtils.getExecutable(project);
+ final [String gradleExecutablePath, ...List<String> options] = _gradleUtils.getExecutable(
+ project,
+ );
// All automatically created files should exist.
if (configOnly) {
@@ -797,7 +797,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
'aar_init_script.gradle',
);
final command = <String>[
- _gradleUtils.getExecutable(project),
+ ..._gradleUtils.getExecutable(project),
'-I=$initScript',
'-Pflutter-root=$flutterRoot',
'-Poutput-dir=${outputDirectory.path}',
@@ -912,6 +912,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
final results = <String>[];
try {
+ final [String gradleExecutablePath, ...List<String> options] = _gradleUtils.getExecutable(
+ project,
+ );
+
exitCode = await _runGradleTask(
_kBuildVariantTaskName,
preRunTask: () {
@@ -927,10 +931,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
),
);
},
- options: const <String>['-q'],
+ options: <String>[...options, '-q'],
project: project,
localGradleErrors: gradleErrors,
- gradleExecutablePath: _gradleUtils.getExecutable(project),
+ gradleExecutablePath: gradleExecutablePath,
outputParser: (String line) {
if (_kBuildVariantRegex.firstMatch(line) case final RegExpMatch match) {
results.add(match.namedGroup(_kBuildVariantRegexGroupName)!);
@@ -964,6 +968,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
late Stopwatch sw;
var exitCode = 1;
try {
+ final [String gradleExecutablePath, ...List<String> options] = _gradleUtils.getExecutable(
+ project,
+ );
+
exitCode = await _runGradleTask(
taskName,
preRunTask: () {
@@ -979,10 +987,10 @@ class AndroidGradleBuilder implements AndroidBuilder {
),
);
},
- options: <String>['-q', '-PoutputPath=$outputPath'],
+ options: <String>[...options, '-q', '-PoutputPath=$outputPath'],
project: project,
localGradleErrors: gradleErrors,
- gradleExecutablePath: _gradleUtils.getExecutable(project),
+ gradleExecutablePath: gradleExecutablePath,
);
} on Error catch (error) {
_logger.printError(error.toString());
--- a/packages/flutter_tools/lib/src/android/gradle_errors.dart
+++ b/packages/flutter_tools/lib/src/android/gradle_errors.dart
@@ -228,7 +228,12 @@ final flavorUndefinedHandler = GradleHandledError(
},
handler: ({required String line, required FlutterProject project, required bool usesAndroidX}) async {
final RunResult tasksRunResult = await globals.processUtils.run(
- <String>[globals.gradleUtils!.getExecutable(project), 'app:tasks', '--all', '--console=auto'],
+ <String>[
+ ...globals.gradleUtils!.getExecutable(project),
+ 'app:tasks',
+ '--all',
+ '--console=auto',
+ ],
throwOnError: true,
workingDirectory: project.android.hostAppGradleRoot.path,
environment: globals.java?.environment,
--- a/packages/flutter_tools/lib/src/android/gradle_utils.dart
+++ b/packages/flutter_tools/lib/src/android/gradle_utils.dart
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import 'package:meta/meta.dart';
+import 'package:path/path.dart';
import 'package:process/process.dart';
import 'package:unified_analytics/unified_analytics.dart';
@@ -197,9 +198,29 @@ class GradleUtils {
final Logger _logger;
final OperatingSystemUtils _operatingSystemUtils;
+ List<String> get _requiredArguments {
+ final String cacheDir = join(
+ switch (globals.platform.environment['XDG_CACHE_HOME']) {
+ final String cacheHome => cacheHome,
+ _ => join(
+ globals.fsUtils.homeDirPath ?? throwToolExit('No cache directory has been specified.'),
+ '.cache',
+ ),
+ },
+ 'flutter',
+ 'nix-flutter-tools-gradle',
+ globals.flutterVersion.engineRevision.substring(0, 10),
+ );
+
+ return <String>[
+ '--project-cache-dir=${join(cacheDir, 'cache')}',
+ '-Pkotlin.project.persistent.dir=${join(cacheDir, 'kotlin')}',
+ ];
+ }
+
/// Gets the Gradle executable path and prepares the Gradle project.
/// This is the `gradlew` or `gradlew.bat` script in the `android/` directory.
- String getExecutable(FlutterProject project) {
+ List<String> getExecutable(FlutterProject project) {
final Directory androidDir = project.android.hostAppGradleRoot;
injectGradleWrapperIfNeeded(androidDir);
@@ -210,7 +231,7 @@ class GradleUtils {
// If the Gradle executable doesn't have execute permission,
// then attempt to set it.
_operatingSystemUtils.makeExecutable(gradle);
- return gradle.absolute.path;
+ return <String>[gradle.absolute.path, ..._requiredArguments];
}
throwToolExit(
'Unable to locate gradlew script. Please check that ${gradle.path} '
--- a/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart
+++ b/packages/flutter_tools/test/general.shard/android/android_gradle_builder_test.dart
@@ -2606,8 +2606,8 @@ Gradle Crashed
class FakeGradleUtils extends Fake implements GradleUtils {
@override
- String getExecutable(FlutterProject project) {
- return 'gradlew';
+ List<String> getExecutable(FlutterProject project) {
+ return const <String>['gradlew'];
}
}
--- a/packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
+++ b/packages/flutter_tools/test/general.shard/android/gradle_errors_test.dart
@@ -1633,8 +1633,8 @@ Platform fakePlatform(String name) {
class FakeGradleUtils extends Fake implements GradleUtils {
@override
- String getExecutable(FlutterProject project) {
- return 'gradlew';
+ List<String> getExecutable(FlutterProject project) {
+ return const <String>['gradlew'];
}
}
@@ -47,16 +47,16 @@ let
};
in
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "osqp";
version = "1.0.5";
version = "1.1.0";
pyproject = true;
src = fetchFromGitHub {
owner = "osqp";
repo = "osqp-python";
tag = "v${version}";
hash = "sha256-i05e0GUQm9DbmF4SDZntKIssrYxC755qG3rRZjYEsiw=";
tag = "v${finalAttrs.version}";
hash = "sha256-xdxQaL794rHQmdC0cua1C/IT1qQSzzhTEf7dLrjOV9o=";
};
patches = [
@@ -107,7 +107,8 @@ buildPythonPackage rec {
'';
homepage = "https://osqp.org/";
downloadPage = "https://github.com/oxfordcontrol/osqp-python/releases";
changelog = "https://github.com/osqp/osqp-python/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = [ ];
};
}
})
@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
rustPlatform,
@@ -57,6 +58,9 @@ buildPythonPackage (finalAttrs: {
"test"
];
# Trace/BPT Trap 5 calling `pytest` on darwin.
doCheck = !stdenv.hostPlatform.isDarwin;
meta = {
description = "Python fast on-disk dictionary / RocksDB & SpeeDB Python binding";
homepage = "https://github.com/rocksdict/RocksDict";
+1
View File
@@ -4094,6 +4094,7 @@ with pkgs;
);
flutterPackages = flutterPackages-bin;
flutter = flutterPackages.stable;
flutter341 = flutterPackages.v3_41;
flutter338 = flutterPackages.v3_38;
flutter335 = flutterPackages.v3_35;
flutter332 = flutterPackages.v3_32;