From 584cbef20641d4ed7e0c31d475e717282b86903a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 17 May 2025 12:35:54 +0000 Subject: [PATCH 01/82] python3Packages.backtesting: 0.6.3 -> 0.6.4 --- pkgs/development/python-modules/backtesting/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/backtesting/default.nix b/pkgs/development/python-modules/backtesting/default.nix index 162f88ef377e..4229d9cc1229 100644 --- a/pkgs/development/python-modules/backtesting/default.nix +++ b/pkgs/development/python-modules/backtesting/default.nix @@ -12,12 +12,12 @@ buildPythonPackage rec { pname = "backtesting"; - version = "0.6.3"; + version = "0.6.4"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-xryzvjKT+FRbF4pnniHvkRA98jrZVoCyYOmjYU93Ta4="; + hash = "sha256-8Xasb7VG39XXQ/A47lgkYk5Vo4pJPE3Vghcxt0yGeq4="; }; build-system = [ From 9e5d98ae0649cfc08f58659ff7d6ea3f76c9d8dd Mon Sep 17 00:00:00 2001 From: emaryn Date: Wed, 21 May 2025 04:15:19 +0800 Subject: [PATCH 02/82] osmscout-server: 3.1.0 -> 3.1.5 Diff: https://github.com/rinigus/osmscout-server/compare/3.1.0...3.1.5 --- .../misc/osmscout-server/default.nix | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/misc/osmscout-server/default.nix b/pkgs/applications/misc/osmscout-server/default.nix index c7680b8f2dfb..00719698e9b8 100644 --- a/pkgs/applications/misc/osmscout-server/default.nix +++ b/pkgs/applications/misc/osmscout-server/default.nix @@ -1,10 +1,11 @@ { lib, - mkDerivation, + stdenv, fetchFromGitHub, pkg-config, qmake, qttools, + wrapQtAppsHook, boost, kirigami2, kyotocabinet, @@ -24,19 +25,19 @@ let date = fetchFromGitHub { owner = "HowardHinnant"; repo = "date"; - rev = "a2fdba1adcb076bf9a8343c07524afdf09aa8dcc"; - sha256 = "00sf1pbaz0g0gsa0dlm23lxk4h46xm1jv1gzbjj5rr9sf1qccyr5"; + rev = "a45ea7c17b4a7f320e199b71436074bd624c9e15"; + hash = "sha256-Mq7Yd+y8M3JNG9BEScwVEmxGWYEy6gaNNSlTGgR9LB4="; }; in -mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "osmscout-server"; - version = "3.1.0"; + version = "3.1.5"; src = fetchFromGitHub { owner = "rinigus"; repo = "osmscout-server"; - rev = version; - hash = "sha256-GqUXHn3ZK8gdDlm3TitEp/jhBpQoVeQZUCfAyiyrDEg="; + tag = finalAttrs.version; + hash = "sha256-gmAHX7Gt2oAvTSTCypAjzI5a9TWOPDAYAMD1i1fJVUY="; fetchSubmodules = true; }; @@ -44,7 +45,9 @@ mkDerivation rec { qmake pkg-config qttools + wrapQtAppsHook ]; + buildInputs = [ kirigami2 qtquickcontrols2 @@ -67,11 +70,11 @@ mkDerivation rec { "CONFIG+=disable_mapnik" # Disable the optional mapnik backend ]; - meta = with lib; { + meta = { description = "Maps server providing tiles, geocoder, and router"; homepage = "https://github.com/rinigus/osmscout-server"; - license = licenses.gpl3Only; - maintainers = [ maintainers.Thra11 ]; - platforms = platforms.linux; + license = lib.licenses.gpl3Only; + maintainers = [ lib.maintainers.Thra11 ]; + platforms = lib.platforms.linux; }; -} +}) From 87759ff72ca38b01ae579de6e3e82105712b0f7e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 25 May 2025 22:10:18 +0000 Subject: [PATCH 03/82] tesseract: 5.5.0 -> 5.5.1 --- pkgs/applications/graphics/tesseract/tesseract5.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/tesseract/tesseract5.nix b/pkgs/applications/graphics/tesseract/tesseract5.nix index 4c1442b42b96..6050f7ba94e2 100644 --- a/pkgs/applications/graphics/tesseract/tesseract5.nix +++ b/pkgs/applications/graphics/tesseract/tesseract5.nix @@ -16,13 +16,13 @@ stdenv.mkDerivation rec { pname = "tesseract"; - version = "5.5.0"; + version = "5.5.1"; src = fetchFromGitHub { owner = "tesseract-ocr"; repo = "tesseract"; rev = version; - sha256 = "sha256-qyckAQZs3gR1NBqWgE+COSKXhv3kPF+iHVQrt6OPi8s="; + sha256 = "sha256-bLTYdT9CNfgrmmjP6m0rRqJDHiSOkcuGVCFwPqT12jk="; }; enableParallelBuilding = true; From 7e9f45716da91a6040e32d9e747fa774184e0d76 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 28 May 2025 23:22:20 +0000 Subject: [PATCH 04/82] melonDS: 1.0rc-unstable-2025-05-15 -> 1.0rc-unstable-2025-05-27 --- pkgs/by-name/me/melonDS/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/me/melonDS/package.nix b/pkgs/by-name/me/melonDS/package.nix index d7d1d0e7ee07..abaf8a6089ff 100644 --- a/pkgs/by-name/me/melonDS/package.nix +++ b/pkgs/by-name/me/melonDS/package.nix @@ -27,13 +27,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "melonDS"; - version = "1.0rc-unstable-2025-05-15"; + version = "1.0rc-unstable-2025-05-27"; src = fetchFromGitHub { owner = "melonDS-emu"; repo = "melonDS"; - rev = "0e64a06c84f9b9428f8647c2aafde110c9d917f3"; - hash = "sha256-T+AcpAITNALtZbuwY+oh4RnMgjCAi7n2HPyDjFqpQPI="; + rev = "7117178c2dd56df32b6534ba6a54ad1f8547e693"; + hash = "sha256-6bwagPFIv87WtmQ3cl8cDZ/1A8Ab6itLHAr33CJy/Eo="; }; nativeBuildInputs = [ From 4ccd185ba8fb3a5c1ad8c6d0c672e638d3b365c9 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Sun, 1 Jun 2025 20:32:58 +1000 Subject: [PATCH 05/82] flutter{329,332}: Pass --project-cache-dir to Gradle --- .../gradle-flutter-tools-wrapper.patch | 164 +++++++++++++++++- .../gradle-flutter-tools-wrapper.patch | 164 +++++++++++++++++- 2 files changed, 316 insertions(+), 12 deletions(-) diff --git a/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch b/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch index b579b4b42f8e..2d72b8915282 100644 --- a/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch +++ b/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch @@ -15,11 +15,9 @@ The intermediate project makes a `settings.gradle` file in `$HOME/.cache/flutter 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")`. -Now the `.gradle` will be built in `$HOME/.cache/flutter/nix-flutter-tools-gradle//`, but `build` doesn't. -To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle//` as well, we need to set `buildDirectory`. -diff --git a/packages/flutter_tools/gradle/settings.gradle b/packages/flutter_tools/gradle/settings.gradle -new file mode 100644 -index 0000000000..b2485c94b4 +To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle//`, 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 @@ @@ -44,12 +42,166 @@ index 0000000000..b2485c94b4 +includeBuild(dir) --- a/packages/flutter_tools/gradle/build.gradle.kts +++ b/packages/flutter_tools/gradle/build.gradle.kts -@@ -4,6 +4,8 @@ +@@ -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 +@@ -456,9 +456,9 @@ class AndroidGradleBuilder implements AndroidBuilder { + // from the local.properties file. + updateLocalProperties(project: project, buildInfo: androidBuildInfo.buildInfo); + +- final List options = []; +- +- final String gradleExecutablePath = _gradleUtils.getExecutable(project); ++ final [String gradleExecutablePath, ...List options] = _gradleUtils.getExecutable( ++ project, ++ ); + + // All automatically created files should exist. + if (configOnly) { +@@ -781,7 +781,7 @@ class AndroidGradleBuilder implements AndroidBuilder { + 'aar_init_script.gradle', + ); + final List command = [ +- _gradleUtils.getExecutable(project), ++ ..._gradleUtils.getExecutable(project), + '-I=$initScript', + '-Pflutter-root=$flutterRoot', + '-Poutput-dir=${outputDirectory.path}', +@@ -896,6 +896,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + final List results = []; + + try { ++ final [String gradleExecutablePath, ...List options] = _gradleUtils.getExecutable( ++ project, ++ ); ++ + exitCode = await _runGradleTask( + _kBuildVariantTaskName, + preRunTask: () { +@@ -911,10 +915,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + ), + ); + }, +- options: const ['-q'], ++ options: [...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)!); +@@ -948,6 +952,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + late Stopwatch sw; + int exitCode = 1; + try { ++ final [String gradleExecutablePath, ...List options] = _gradleUtils.getExecutable( ++ project, ++ ); ++ + exitCode = await _runGradleTask( + taskName, + preRunTask: () { +@@ -963,10 +971,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + ), + ); + }, +- options: ['-q', '-PoutputPath=$outputPath'], ++ options: [...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 +@@ -240,7 +240,12 @@ final GradleHandledError flavorUndefinedHandler = GradleHandledError( + required bool usesAndroidX, + }) async { + final RunResult tasksRunResult = await globals.processUtils.run( +- [globals.gradleUtils!.getExecutable(project), 'app:tasks', '--all', '--console=auto'], ++ [ ++ ...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'; + +@@ -154,9 +155,16 @@ class GradleUtils { + final Logger _logger; + final OperatingSystemUtils _operatingSystemUtils; + ++ List get _requiredArguments => [ ++ '--project-cache-dir=${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), 'cache')}', ++ ]; ++ + /// 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 getExecutable(FlutterProject project) { + final Directory androidDir = project.android.hostAppGradleRoot; + injectGradleWrapperIfNeeded(androidDir); + +@@ -167,7 +175,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 [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 +@@ -2740,8 +2740,8 @@ Gradle Crashed + + class FakeGradleUtils extends Fake implements GradleUtils { + @override +- String getExecutable(FlutterProject project) { +- return 'gradlew'; ++ List getExecutable(FlutterProject project) { ++ return const ['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 +@@ -1580,8 +1580,8 @@ Platform fakePlatform(String name) { + + class FakeGradleUtils extends Fake implements GradleUtils { + @override +- String getExecutable(FlutterProject project) { +- return 'gradlew'; ++ List getExecutable(FlutterProject project) { ++ return const ['gradlew']; + } + } + diff --git a/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch b/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch index b579b4b42f8e..2d72b8915282 100644 --- a/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch +++ b/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch @@ -15,11 +15,9 @@ The intermediate project makes a `settings.gradle` file in `$HOME/.cache/flutter 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")`. -Now the `.gradle` will be built in `$HOME/.cache/flutter/nix-flutter-tools-gradle//`, but `build` doesn't. -To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle//` as well, we need to set `buildDirectory`. -diff --git a/packages/flutter_tools/gradle/settings.gradle b/packages/flutter_tools/gradle/settings.gradle -new file mode 100644 -index 0000000000..b2485c94b4 +To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle//`, 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 @@ @@ -44,12 +42,166 @@ index 0000000000..b2485c94b4 +includeBuild(dir) --- a/packages/flutter_tools/gradle/build.gradle.kts +++ b/packages/flutter_tools/gradle/build.gradle.kts -@@ -4,6 +4,8 @@ +@@ -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 +@@ -456,9 +456,9 @@ class AndroidGradleBuilder implements AndroidBuilder { + // from the local.properties file. + updateLocalProperties(project: project, buildInfo: androidBuildInfo.buildInfo); + +- final List options = []; +- +- final String gradleExecutablePath = _gradleUtils.getExecutable(project); ++ final [String gradleExecutablePath, ...List options] = _gradleUtils.getExecutable( ++ project, ++ ); + + // All automatically created files should exist. + if (configOnly) { +@@ -781,7 +781,7 @@ class AndroidGradleBuilder implements AndroidBuilder { + 'aar_init_script.gradle', + ); + final List command = [ +- _gradleUtils.getExecutable(project), ++ ..._gradleUtils.getExecutable(project), + '-I=$initScript', + '-Pflutter-root=$flutterRoot', + '-Poutput-dir=${outputDirectory.path}', +@@ -896,6 +896,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + final List results = []; + + try { ++ final [String gradleExecutablePath, ...List options] = _gradleUtils.getExecutable( ++ project, ++ ); ++ + exitCode = await _runGradleTask( + _kBuildVariantTaskName, + preRunTask: () { +@@ -911,10 +915,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + ), + ); + }, +- options: const ['-q'], ++ options: [...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)!); +@@ -948,6 +952,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + late Stopwatch sw; + int exitCode = 1; + try { ++ final [String gradleExecutablePath, ...List options] = _gradleUtils.getExecutable( ++ project, ++ ); ++ + exitCode = await _runGradleTask( + taskName, + preRunTask: () { +@@ -963,10 +971,10 @@ class AndroidGradleBuilder implements AndroidBuilder { + ), + ); + }, +- options: ['-q', '-PoutputPath=$outputPath'], ++ options: [...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 +@@ -240,7 +240,12 @@ final GradleHandledError flavorUndefinedHandler = GradleHandledError( + required bool usesAndroidX, + }) async { + final RunResult tasksRunResult = await globals.processUtils.run( +- [globals.gradleUtils!.getExecutable(project), 'app:tasks', '--all', '--console=auto'], ++ [ ++ ...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'; + +@@ -154,9 +155,16 @@ class GradleUtils { + final Logger _logger; + final OperatingSystemUtils _operatingSystemUtils; + ++ List get _requiredArguments => [ ++ '--project-cache-dir=${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), 'cache')}', ++ ]; ++ + /// 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 getExecutable(FlutterProject project) { + final Directory androidDir = project.android.hostAppGradleRoot; + injectGradleWrapperIfNeeded(androidDir); + +@@ -167,7 +175,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 [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 +@@ -2740,8 +2740,8 @@ Gradle Crashed + + class FakeGradleUtils extends Fake implements GradleUtils { + @override +- String getExecutable(FlutterProject project) { +- return 'gradlew'; ++ List getExecutable(FlutterProject project) { ++ return const ['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 +@@ -1580,8 +1580,8 @@ Platform fakePlatform(String name) { + + class FakeGradleUtils extends Fake implements GradleUtils { + @override +- String getExecutable(FlutterProject project) { +- return 'gradlew'; ++ List getExecutable(FlutterProject project) { ++ return const ['gradlew']; + } + } + From c276ee50c4c2dac4f28d5293424b3e963dcd567c Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Sun, 1 Jun 2025 21:04:25 +1000 Subject: [PATCH 06/82] flutter{329,332}: Pass -Pkotlin.project.persistent.dir as well --- .../gradle-flutter-tools-wrapper.patch | 29 ++++++++++++++----- .../gradle-flutter-tools-wrapper.patch | 29 ++++++++++++++----- 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch b/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch index 2d72b8915282..34f6a1c99a64 100644 --- a/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch +++ b/pkgs/development/compilers/flutter/versions/3_29/patches/gradle-flutter-tools-wrapper.patch @@ -152,16 +152,29 @@ Changing the `GradleUtils.getExecutable` function signature is a delibarate choi import 'package:process/process.dart'; import 'package:unified_analytics/unified_analytics.dart'; -@@ -154,9 +155,16 @@ class GradleUtils { +@@ -154,9 +155,29 @@ class GradleUtils { final Logger _logger; final OperatingSystemUtils _operatingSystemUtils; -+ List get _requiredArguments => [ -+ '--project-cache-dir=${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), 'cache')}', -+ ]; ++ List 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 [ ++ '--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. @@ -170,7 +183,7 @@ Changing the `GradleUtils.getExecutable` function signature is a delibarate choi final Directory androidDir = project.android.hostAppGradleRoot; injectGradleWrapperIfNeeded(androidDir); -@@ -167,7 +175,7 @@ class GradleUtils { +@@ -167,7 +188,7 @@ class GradleUtils { // If the Gradle executable doesn't have execute permission, // then attempt to set it. _operatingSystemUtils.makeExecutable(gradle); diff --git a/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch b/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch index 2d72b8915282..34f6a1c99a64 100644 --- a/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch +++ b/pkgs/development/compilers/flutter/versions/3_32/patches/gradle-flutter-tools-wrapper.patch @@ -152,16 +152,29 @@ Changing the `GradleUtils.getExecutable` function signature is a delibarate choi import 'package:process/process.dart'; import 'package:unified_analytics/unified_analytics.dart'; -@@ -154,9 +155,16 @@ class GradleUtils { +@@ -154,9 +155,29 @@ class GradleUtils { final Logger _logger; final OperatingSystemUtils _operatingSystemUtils; -+ List get _requiredArguments => [ -+ '--project-cache-dir=${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), 'cache')}', -+ ]; ++ List 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 [ ++ '--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. @@ -170,7 +183,7 @@ Changing the `GradleUtils.getExecutable` function signature is a delibarate choi final Directory androidDir = project.android.hostAppGradleRoot; injectGradleWrapperIfNeeded(androidDir); -@@ -167,7 +175,7 @@ class GradleUtils { +@@ -167,7 +188,7 @@ class GradleUtils { // If the Gradle executable doesn't have execute permission, // then attempt to set it. _operatingSystemUtils.makeExecutable(gradle); From b3b8c9bec1d643ed2be1f5d4c4dec4942ecb2510 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 May 2025 02:44:59 +0000 Subject: [PATCH 07/82] oxigraph: 0.4.9 -> 0.4.11 --- pkgs/by-name/ox/oxigraph/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ox/oxigraph/package.nix b/pkgs/by-name/ox/oxigraph/package.nix index 12dbd9a83c83..7a77e8b24b36 100644 --- a/pkgs/by-name/ox/oxigraph/package.nix +++ b/pkgs/by-name/ox/oxigraph/package.nix @@ -13,18 +13,18 @@ let in rustPlatform.buildRustPackage (finalAttrs: { pname = "oxigraph"; - version = "0.4.9"; + version = "0.4.11"; src = fetchFromGitHub { owner = "oxigraph"; repo = "oxigraph"; tag = "v${finalAttrs.version}"; - hash = "sha256-sv9LpAoPQ4oFrGI6j6NgVZwEwpM1wt93lHkUwnvmhIY="; + hash = "sha256-M5C+SNZYXKfcosnRe9a+Zicyjuo6wli2uWv/SJxufJc="; fetchSubmodules = true; }; useFetchCargoVendor = true; - cargoHash = "sha256-nVlvmYOxZDMLvxP8JaKTyKMgW6+48B8B+UzlwgthJS0="; + cargoHash = "sha256-TgeHmCMwXK+OlTGIyzus/N+MY29lgK+JuzUBwVFbpsI="; nativeBuildInputs = [ rustPlatform.bindgenHook From 87ee74cef46aecf0ec09b0aa5d8f04df97f2728c Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 15 May 2025 20:41:49 +0200 Subject: [PATCH 08/82] denort: init at 2.2.12 --- pkgs/by-name/de/denort/package.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pkgs/by-name/de/denort/package.nix diff --git a/pkgs/by-name/de/denort/package.nix b/pkgs/by-name/de/denort/package.nix new file mode 100644 index 000000000000..3df1f602e882 --- /dev/null +++ b/pkgs/by-name/de/denort/package.nix @@ -0,0 +1,30 @@ +{ + deno, + lib, +}: +deno.overrideAttrs ( + final: prev: { + pname = "denort"; + buildAndTestSubdir = "cli/rt"; + postInstall = ""; + installCheckPhase = ""; + passthru = { }; + meta = with lib; { + homepage = "https://deno.land/"; + changelog = "https://github.com/denoland/deno/releases/tag/v${final.version}"; + description = "Slim version of the deno runtime, used bundled with deno projects into standalone binaries"; + license = licenses.mit; + mainProgram = "denort"; + maintainers = with maintainers; [ + jk + ofalvai + ]; + platforms = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + }; + } +) From 8bd1c5a119f944fbad37a4de70ad185e1a4fd9f2 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 15 May 2025 20:43:15 +0200 Subject: [PATCH 09/82] buildDenoPackage: init --- .../deno/build-deno-package/default.nix | 166 +++++++++ .../deno/build-deno-package/hooks/default.nix | 29 ++ .../hooks/deno-build-hook.sh | 50 +++ .../hooks/deno-config-hook.sh | 108 ++++++ .../hooks/deno-install-hook.sh | 32 ++ .../deno/fetch-deno-deps/.gitignore | 4 + .../deno/fetch-deno-deps/default.nix | 178 ++++++++++ .../deno/fetch-deno-deps/deno.json | 8 + .../deno/fetch-deno-deps/deno.lock | 37 ++ .../deno/fetch-deno-deps/prune-registries.ts | 318 ++++++++++++++++++ .../deno/fetch-deno-deps/shell.nix | 7 + pkgs/test/build-deno-package/.gitignore | 3 + .../build-deno-package/binaries/.gitignore | 3 + .../build-deno-package/binaries/default.nix | 25 ++ .../build-deno-package/binaries/deno.json | 13 + .../build-deno-package/binaries/deno.lock | 217 ++++++++++++ pkgs/test/build-deno-package/binaries/main.ts | 15 + pkgs/test/build-deno-package/default.nix | 16 + .../build-deno-package/external/default.nix | 30 ++ pkgs/test/build-deno-package/shell.nix | 9 + .../build-deno-package/workspaces/.gitignore | 3 + .../build-deno-package/workspaces/default.nix | 39 +++ .../build-deno-package/workspaces/deno.json | 7 + .../build-deno-package/workspaces/deno.lock | 227 +++++++++++++ .../workspaces/sub1/deno.json | 10 + .../workspaces/sub1/main.ts | 13 + .../workspaces/sub2/deno.json | 10 + .../workspaces/sub2/main.ts | 13 + pkgs/test/default.nix | 2 + pkgs/top-level/all-packages.nix | 6 + 30 files changed, 1598 insertions(+) create mode 100644 pkgs/build-support/deno/build-deno-package/default.nix create mode 100644 pkgs/build-support/deno/build-deno-package/hooks/default.nix create mode 100644 pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh create mode 100644 pkgs/build-support/deno/build-deno-package/hooks/deno-config-hook.sh create mode 100644 pkgs/build-support/deno/build-deno-package/hooks/deno-install-hook.sh create mode 100644 pkgs/build-support/deno/fetch-deno-deps/.gitignore create mode 100644 pkgs/build-support/deno/fetch-deno-deps/default.nix create mode 100644 pkgs/build-support/deno/fetch-deno-deps/deno.json create mode 100644 pkgs/build-support/deno/fetch-deno-deps/deno.lock create mode 100644 pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts create mode 100644 pkgs/build-support/deno/fetch-deno-deps/shell.nix create mode 100644 pkgs/test/build-deno-package/.gitignore create mode 100644 pkgs/test/build-deno-package/binaries/.gitignore create mode 100644 pkgs/test/build-deno-package/binaries/default.nix create mode 100644 pkgs/test/build-deno-package/binaries/deno.json create mode 100644 pkgs/test/build-deno-package/binaries/deno.lock create mode 100644 pkgs/test/build-deno-package/binaries/main.ts create mode 100644 pkgs/test/build-deno-package/default.nix create mode 100644 pkgs/test/build-deno-package/external/default.nix create mode 100644 pkgs/test/build-deno-package/shell.nix create mode 100644 pkgs/test/build-deno-package/workspaces/.gitignore create mode 100644 pkgs/test/build-deno-package/workspaces/default.nix create mode 100644 pkgs/test/build-deno-package/workspaces/deno.json create mode 100644 pkgs/test/build-deno-package/workspaces/deno.lock create mode 100644 pkgs/test/build-deno-package/workspaces/sub1/deno.json create mode 100644 pkgs/test/build-deno-package/workspaces/sub1/main.ts create mode 100644 pkgs/test/build-deno-package/workspaces/sub2/deno.json create mode 100644 pkgs/test/build-deno-package/workspaces/sub2/main.ts diff --git a/pkgs/build-support/deno/build-deno-package/default.nix b/pkgs/build-support/deno/build-deno-package/default.nix new file mode 100644 index 000000000000..e64d7080dce4 --- /dev/null +++ b/pkgs/build-support/deno/build-deno-package/default.nix @@ -0,0 +1,166 @@ +# NOTE: much of this structure is inspired from https://github.com/NixOS/nixpkgs/tree/fff29a3e5f7991512e790617d1a693df5f3550f6/pkgs/build-support/node +{ + stdenvNoCC, + deno, + denort, + diffutils, + zip, + jq, + fetchDenoDeps, + buildPackages, + breakpointHook, + lib, +}: +{ + name ? "${args.pname}-${args.version}", + src ? null, + # The output hash of the dependencies for this project. + denoDepsHash ? "", + # The host platform, the output binary is compiled for. + hostPlatform ? builtins.currentSystem, + # A list of strings, which are names of impure env vars passed to the deps build. + # Example: + # `[ "NPM_TOKEN" ]` + # They will be forwarded to `deno install`. + # It can be used to set tokens for private NPM registries (in an `.npmrc` file). + # In multi user installations of Nix, you need to set the env vars in the daemon (probably with systemd). + # In nixos: `systemd.services.nix-daemon.environment.NPM_TOKEN = "";` + denoDepsImpureEnvVars ? [ ], + # An attr set with env vars as key value pairs. + # Example: + # `{ "NPM_TOKEN" = ""; }` + # They will be forwarded to `deno install`. + # It can be used to set tokens for private NPM registries (in an `.npmrc` file). + # You could pass these tokens from the cli with `--arg` (this can make your builds painful). + denoDepsInjectedEnvVars ? { }, + # TODO: source overrides like in buildNpmPackage, i.e. injecting nix packages into the denoDeps + # this is more involved, since they can't directly be injected into the fixed output derivation + # of fetchDenoDeps. Instead we need to patch the lock file and remove the packages we intend to + # inject, then we need to build the rest of the packages like before and in a + # second step create normal derivation with the injected packages. + # then the two need to be merged into a single denoDeps derivation and finally the lock file needs + # to be reverted back to it's original form. + # It is possible to manipulate the registry.json files of the injected packages so that deno accepts them as is. + denoDeps ? fetchDenoDeps { + inherit + src + denoDepsInjectedEnvVars + denoDepsImpureEnvVars + denoFlags + denoDir + ; + denoInstallFlags = builtins.filter (e: e != "--cached-only") denoInstallFlags; + name = "${name}-deno-deps"; + hash = denoDepsHash; + }, + # The package used for every deno command in the build + denoPackage ? deno, + # The package used as the runtime that is bundled with the the src to create the binary. + denortPackage ? denort, + # The script to run to build the project. + # You still need to specify in the installPhase, what artifacts to copy to `$out`. + denoTaskScript ? "build", + # If not null, create a binary using the specified path as the entrypoint, + # copy it to `$out/bin` in installPhase and fix it in fixupPhase. + binaryEntrypointPath ? null, + # Flags to pass to all deno commands. + denoFlags ? [ ], + # Flags to pass to `deno task ${denoTaskScript}`. + denoTaskFlags ? [ ], + # Flags to pass to `deno compile`. + denoCompileFlags ? [ ], + # Flags to pass to `deno install`. + denoInstallFlags ? [ + "--allow-scripts" + "--frozen" + "--cached-only" + ], + nativeBuildInputs ? [ ], + dontFixup ? true, + # Custom denoConfigHook + denoConfigHook ? null, + # Custom denoBuildHook + denoBuildHook ? null, + # Custom denoInstallHook + denoInstallHook ? null, + # Path to deno workspace, where the denoTaskScript should be run + denoWorkspacePath ? null, + # Unquoted string injected before `deno task` + denoTaskPrefix ? "", + # Unquoted string injected after `deno task` and all its flags + denoTaskSuffix ? "", + # Used as the name of the local DENO_DIR + denoDir ? "./.deno", + ... +}@args: +let + denoFlags_ = builtins.concatStringsSep " " denoFlags; + denoTaskFlags_ = builtins.concatStringsSep " " denoTaskFlags; + denoCompileFlags_ = builtins.concatStringsSep " " denoCompileFlags; + denoInstallFlags_ = builtins.concatStringsSep " " denoInstallFlags; + + args' = builtins.removeAttrs args [ "denoDepsInjectedEnvVars" ]; + + denoHooks = + (buildPackages.denoHooks.override { + denort = denortPackage; + }) + { + inherit denoTaskSuffix denoTaskPrefix binaryEntrypointPath; + }; + systemLookupTable = { + "x86_64-darwin" = "x86_64-apple-darwin"; + "arm64-darwin" = "aarch64-apple-darwin"; + "aarch64-darwin" = "aarch64-apple-darwin"; + "x86_64-linux" = "x86_64-unknown-linux-gnu"; + "arm64-linux" = "aarch64-unknown-linux-gnu"; + "aarch64-linux" = "aarch64-unknown-linux-gnu"; + }; + hostPlatform_ = + if builtins.hasAttr hostPlatform systemLookupTable then + systemLookupTable."${hostPlatform}" + else + (lib.systems.elaborate hostPlatform).config; +in +stdenvNoCC.mkDerivation ( + args' + // { + inherit + name + denoDeps + src + denoFlags_ + denoTaskFlags_ + denoCompileFlags_ + denoInstallFlags_ + binaryEntrypointPath + hostPlatform_ + denoWorkspacePath + denoTaskScript + ; + + nativeBuildInputs = nativeBuildInputs ++ [ + # Prefer passed hooks + (if denoConfigHook != null then denoConfigHook else denoHooks.denoConfigHook) + (if denoBuildHook != null then denoBuildHook else denoHooks.denoBuildHook) + (if denoInstallHook != null then denoInstallHook else denoHooks.denoInstallHook) + denoPackage + diffutils + zip + jq + breakpointHook + ]; + + DENO_DIR = denoDir; + + dontFixup = if binaryEntrypointPath != null then false else dontFixup; + + passthru = { + inherit denoDeps; + }; + + meta = (args.meta or { }) // { + platforms = args.meta.platforms or denoPackage.meta.platforms; + }; + } +) diff --git a/pkgs/build-support/deno/build-deno-package/hooks/default.nix b/pkgs/build-support/deno/build-deno-package/hooks/default.nix new file mode 100644 index 000000000000..e6044020e2f1 --- /dev/null +++ b/pkgs/build-support/deno/build-deno-package/hooks/default.nix @@ -0,0 +1,29 @@ +{ + makeSetupHook, + denort, + lib, +}: +{ + denoTaskSuffix, + denoTaskPrefix, + binaryEntrypointPath, +}: +{ + denoConfigHook = makeSetupHook { + name = "deno-config-hook"; + substitutions = { + denortBinary = lib.optionalString (binaryEntrypointPath != null) "${denort}/bin/denort"; + }; + } ./deno-config-hook.sh; + + denoBuildHook = makeSetupHook { + name = "deno-build-hook"; + substitutions = { + inherit denoTaskSuffix denoTaskPrefix; + }; + } ./deno-build-hook.sh; + + denoInstallHook = makeSetupHook { + name = "deno-install-hook"; + } ./deno-install-hook.sh; +} diff --git a/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh b/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh new file mode 100644 index 000000000000..cdb3051eaa6d --- /dev/null +++ b/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh @@ -0,0 +1,50 @@ +# shellcheck shell=bash + +denoBuildHook() { + echo "Executing denoBuildHook" + + runHook preBuild + + if [ -n "${binaryEntrypointPath-}" ]; then + echo "Creating binary" + + package_name=$(jq -r '.name' deno.json) + if [ "$package_name" == "null" ]; then + package_name="$name" + fi + + deno compile \ + --output "$package_name" \ + --target "$hostPlatform_" \ + "${denoWorkspacePath+$denoWorkspacePath/}$binaryEntrypointPath" \ + $denoCompileFlags \ + $denoFlags + + elif [ -n "${denoTaskScript-}" ]; then + if ! @denoTaskPrefix@ deno task ${denoWorkspacePath+--cwd=$denoWorkspacePath} "$denoTaskScript" $denoTaskFlags $denoFlags @denoTaskSuffix@; then + echo + echo 'ERROR: `deno task` failed' + echo + echo "Here are a few things you can try, depending on the error:" + echo "1. Make sure your task script ($denoTaskScript) exists" + echo + + exit 1 + fi + else + echo + echo "ERROR: nothing to do in buildPhase" + echo "Specify either 'binaryEntrypointPath' or 'denoTaskScript' or override 'buildPhase'" + echo + + exit 1 + fi + + runHook postBuild + + echo "Finished denoBuildHook" +} + +if [ -z "${buildPhase-}" ]; then + buildPhase=denoBuildHook +fi diff --git a/pkgs/build-support/deno/build-deno-package/hooks/deno-config-hook.sh b/pkgs/build-support/deno/build-deno-package/hooks/deno-config-hook.sh new file mode 100644 index 000000000000..28b6304c6ca4 --- /dev/null +++ b/pkgs/build-support/deno/build-deno-package/hooks/deno-config-hook.sh @@ -0,0 +1,108 @@ +# shellcheck shell=bash + +denoConfigHook() { + echo "Executing denoConfigHook" + + if [ -z "${denoDeps-}" ]; then + echo + echo "ERROR: no dependencies were specified" + echo 'Hint: set `denoDeps` if using these hooks individually. If this is happening with `buildDenoPackage`, please open an issue.' + echo + + exit 1 + fi + + local -r cacheLockfile="$denoDeps/deno.lock" + local -r srcLockfile="$PWD/deno.lock" + + echo "Validating consistency between $srcLockfile and $cacheLockfile" + + if ! diff "$srcLockfile" "$cacheLockfile"; then + # If the diff failed, first double-check that the file exists, so we can + # give a friendlier error msg. + if ! [ -e "$srcLockfile" ]; then + echo + echo "ERROR: Missing deno.lock from src. Expected to find it at: $srcLockfile" + echo + + exit 1 + fi + + if ! [ -e "$cacheLockfile" ]; then + echo + echo "ERROR: Missing lockfile from cache. Expected to find it at: $cacheLockfile" + echo + + exit 1 + fi + + echo + echo "ERROR: denoDepsHash is out of date" + echo + echo "The deno.lock in src is not the same as the in $denoDeps." + echo + echo "To fix the issue:" + echo '1. Use `lib.fakeHash` as the denoDepsHash value' + echo "2. Build the derivation and wait for it to fail with a hash mismatch" + echo "3. Copy the 'got: sha256-' value back into the denoDepsHash field" + echo + + exit 1 + fi + + # NOTE: we need to use vendor in the build too, since we used it for the deps + useVendor() { + jq '.vendor = true' deno.json >temp.json && + rm -f deno.json && + mv temp.json deno.json + } + echo "Adding vendor to deno.json" + useVendor + + echo "Installing dependencies" + + export DENO_DIR="$(pwd)"/"$DENO_DIR" + + installDeps() { + if [[ -d "$denoDeps/.deno" ]]; then + cp -r --no-preserve=mode "$denoDeps/.deno" "$DENO_DIR" + fi + if [[ -d "$denoDeps/vendor" ]]; then + cp -r --no-preserve=mode "$denoDeps/vendor" ./vendor + fi + if [[ -d "$denoDeps/node_modules" ]]; then + cp -r --no-preserve=mode "$denoDeps/node_modules" ./node_modules + fi + } + installDeps + + if ! deno install $denoInstallFlags_ $denoFlags_; then + echo + echo "ERROR: deno failed to install dependencies" + echo + + exit 1 + fi + + installDenort() { + version="$(deno --version | head -1 | awk '{print $2}')" + zipfile=denort-"$hostPlatform_".zip + dir="$DENO_DIR"/dl/release/v"$version" + mkdir -p "$dir" + cp "@denortBinary@" ./denort + zip "$dir"/"$zipfile" ./denort + rm ./denort + } + if [ -n "${binaryEntrypointPath-}" ]; then + echo "Installing denort for binary build" + installDenort + fi + + patchShebangs .deno + patchShebangs node_modules + patchShebangs vendor + + echo "Finished denoConfigHook" +} + +postPatchHooks+=(denoConfigHook) diff --git a/pkgs/build-support/deno/build-deno-package/hooks/deno-install-hook.sh b/pkgs/build-support/deno/build-deno-package/hooks/deno-install-hook.sh new file mode 100644 index 000000000000..969c59da5809 --- /dev/null +++ b/pkgs/build-support/deno/build-deno-package/hooks/deno-install-hook.sh @@ -0,0 +1,32 @@ +# shellcheck shell=bash + +denoInstallHook() { + echo "Executing denoInstallHook" + + runHook preInstall + + if [ -n "${binaryEntrypointPath-}" ]; then + package_name=$(jq -r '.name' deno.json) + if [ "$package_name" == "null" ]; then + package_name="$name" + fi + + mkdir -p "$out/bin" + cp "$package_name"* "$out/bin" + else + echo + echo "ERROR: nothing to do in installPhase" + echo "Specify either 'binaryEntrypointPath' or override 'installPhase'" + echo + + exit 1 + fi + + runHook postInstall + + echo "Finished denoInstallHook" +} + +if [ -z "${dontDenoInstall-}" ] && [ -z "${installPhase-}" ]; then + installPhase=denoInstallHook +fi diff --git a/pkgs/build-support/deno/fetch-deno-deps/.gitignore b/pkgs/build-support/deno/fetch-deno-deps/.gitignore new file mode 100644 index 000000000000..95aecda46ec1 --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/.gitignore @@ -0,0 +1,4 @@ +.deno/ +vendor/ +node_modules/ +.direnv diff --git a/pkgs/build-support/deno/fetch-deno-deps/default.nix b/pkgs/build-support/deno/fetch-deno-deps/default.nix new file mode 100644 index 000000000000..9d4c43c0bb08 --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/default.nix @@ -0,0 +1,178 @@ +# NOTE: much of this structure is inspired from https://github.com/NixOS/nixpkgs/tree/fff29a3e5f7991512e790617d1a693df5f3550f6/pkgs/build-support/node +{ + lib, + stdenvNoCC, + deno, + jq, + cacert, +}: +{ + fetchDenoDeps = + { + name ? "deno-deps", + src, + hash, + denoPackage ? deno, + denoFlags ? [ ], + denoInstallFlags ? [ + "--allow-scripts" + "--frozen" + ], + nativeBuildInputs ? [ ], + denoDepsImpureEnvVars ? [ ], + denoDepsInjectedEnvVars ? { }, + denoDir ? "./.deno", + ... + }@args: + let + hash_ = + if hash != "" then + { outputHash = hash; } + else + { + outputHash = ""; + outputHashAlgo = "sha256"; + }; + denoInstallFlags_ = builtins.concatStringsSep " " denoInstallFlags; + denoFlags_ = builtins.concatStringsSep " " denoFlags; + denoDepsInjectedEnvVarsString = + if denoDepsInjectedEnvVars != { } then + lib.attrsets.foldlAttrs ( + acc: name: value: + "${acc} ${name}=${value}" + ) "" denoDepsInjectedEnvVars + else + ""; + # need to remove denoDepsInjectedEnvVars, since it's an attrset and + # stdenv.mkDerivation would try to convert it to string + args' = builtins.removeAttrs args [ "denoDepsInjectedEnvVars" ]; + in + stdenvNoCC.mkDerivation ( + args' + // { + inherit name src; + + nativeBuildInputs = nativeBuildInputs ++ [ + denoPackage + jq + ]; + + DENO_DIR = denoDir; + + buildPhase = '' + runHook preBuild + + if [[ ! -e "deno.json" ]]; then + echo "" + echo "ERROR: deno.json required, but not found" + echo "" + exit 1 + fi + + if [[ ! -e "deno.lock" ]]; then + echo "" + echo "ERROR: deno.lock required, but not found" + echo "" + exit 1 + fi + + # NOTE: using vendor reduces the pruning effort a little + useVendor() { + jq '.vendor = true' deno.json >temp.json && \ + rm -f deno.json && \ + mv temp.json deno.json + } + useVendor + + # uses $DENO_DIR + ${denoDepsInjectedEnvVarsString} deno install ${denoInstallFlags_} ${denoFlags_} + + echo "pruning non reproducible files" + + # `node_modules` is used when there are install scripts in a dependencies' package.json. + # these install scripts can also require internet, so they should also be executed in this fetcher + pruneNonReproducibles() { + export tempDenoDir="$DENO_DIR" + + # `registry.json` files can't just be deleted, else deno install won't work, + # but they contain non reproducible data, + # which needs to be pruned, leaving only the necessary data behind. + # This pruning is done with a helper script written in typescript and executed with deno + DENO_DIR=./extra_deno_cache deno run \ + --lock="${./deno.lock}" \ + --config="${./deno.json}" \ + --allow-all \ + "${./prune-registries.ts}" \ + --lock-json="./deno.lock" \ + --cache-path="$tempDenoDir" \ + --vendor-path="./vendor" + + # Keys in `registry.json` files are not deterministically sorted, + # so we do it here. + for file in $(find -L "$DENO_DIR" -name registry.json -type f); do + jq --sort-keys '.' "$file" >temp.json && \ + rm -f "$file" && \ + mv temp.json "$file" + done + + # There are various small databases used by deno for caching that + # we can simply delete. + find -L ./node_modules -name '*cache_v2-shm' -type f | xargs rm -f + find -L ./node_modules -name '*cache_v2-wal' -type f | xargs rm -f + find -L ./node_modules -name 'dep_analysis_cache_v2' -type f | xargs rm -f + find -L ./node_modules -name 'node_analysis_cache_v2' -type f | xargs rm -f + find -L ./node_modules -name v8_code_cache_v2 -type f | xargs rm -f + rm -f ./node_modules/.deno/.deno.lock.poll + rm -f "$DENO_DIR"/dep_analysis_cache_v2-shm + rm -f "$DENO_DIR"/dep_analysis_cache_v2-wal + rm -f "$DENO_DIR"/dep_analysis_cache_v2 + } + pruneNonReproducibles + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + if [[ -d "$DENO_DIR" ]]; then + mkdir -p $out/$DENO_DIR + cp -r --no-preserve=mode $DENO_DIR $out + fi + if [[ -d "./vendor" ]]; then + mkdir -p $out/vendor + cp -r --no-preserve=mode ./vendor $out + fi + if [[ -d "./node_modules" ]]; then + mkdir -p $out/node_modules + cp -r --no-preserve=mode ./node_modules $out + fi + + cp ./deno.lock $out + + runHook postInstall + ''; + + dontFixup = true; + + outputHashMode = "recursive"; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ denoDepsImpureEnvVars; + + SSL_CERT_FILE = + if + ( + hash_.outputHash == "" + || hash_.outputHash == lib.fakeSha256 + || hash_.outputHash == lib.fakeSha512 + || hash_.outputHash == lib.fakeHash + ) + then + "${cacert}/etc/ssl/certs/ca-bundle.crt" + else + "/no-cert-file.crt"; + + } + // hash_ + ); +} diff --git a/pkgs/build-support/deno/fetch-deno-deps/deno.json b/pkgs/build-support/deno/fetch-deno-deps/deno.json new file mode 100644 index 000000000000..12c616d6daca --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/deno.json @@ -0,0 +1,8 @@ +{ + "imports": { + "@std/cli": "jsr:@std/cli@1.0.16", + "@std/fs": "jsr:@std/fs@1.0.16", + "@std/path": "jsr:@std/path@1.0.9", + "ini": "npm:ini@5.0.0" + } +} diff --git a/pkgs/build-support/deno/fetch-deno-deps/deno.lock b/pkgs/build-support/deno/fetch-deno-deps/deno.lock new file mode 100644 index 000000000000..0a3333e5020b --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/deno.lock @@ -0,0 +1,37 @@ +{ + "version": "4", + "specifiers": { + "jsr:@std/cli@1.0.16": "1.0.16", + "jsr:@std/fs@1.0.16": "1.0.16", + "jsr:@std/path@1.0.9": "1.0.9", + "jsr:@std/path@^1.0.8": "1.0.9", + "npm:ini@5.0.0": "5.0.0" + }, + "jsr": { + "@std/cli@1.0.16": { + "integrity": "02df293099c35b9e97d8ca05f57f54bd1ee08134f25d19a4756b3924695f4b00" + }, + "@std/fs@1.0.16": { + "integrity": "81878f62b6eeda0bf546197fc3daa5327c132fee1273f6113f940784a468b036", + "dependencies": [ + "jsr:@std/path@^1.0.8" + ] + }, + "@std/path@1.0.9": { + "integrity": "260a49f11edd3db93dd38350bf9cd1b4d1366afa98e81b86167b4e3dd750129e" + } + }, + "npm": { + "ini@5.0.0": { + "integrity": "sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@std/cli@1.0.16", + "jsr:@std/fs@1.0.16", + "jsr:@std/path@1.0.9", + "npm:ini@5.0.0" + ] + } +} diff --git a/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts new file mode 100644 index 000000000000..d0c95414d747 --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts @@ -0,0 +1,318 @@ +#!/usr/bin/env deno +import { parseArgs } from "@std/cli/parse-args"; +import { walkSync } from "@std/fs/walk"; + +/** + * NOTE: The problem this script solves, is that in every npm dependency in the deno cache + * is a registry.json file, which serves as a sort of local registry cache for the deno cli. + * Such a file looks like this (with deno v2.1.4): + * ```json + * { + * "name": "@floating-ui/core", + * "versions": { + * "0.7.0": { ... }, + * "1.6.0": { ... }, + * "0.1.2": { ... }, + * ... + * }, + * "dist-tags": { "latest": "1.7.0" } + * } + * ``` + * The deno cli will look into this file when called to look up if the required versions are there. + * The problem is that the available versions for a package change over time. The registry.json files + * need to be part of the fixed output derivation, which will eventually change the hash of the FOD, + * if all those unwanted versions aren't pruned. + * + * On top of that a similar thing happens for jsr packages in the vendor directory + * with `meta.json` files. These also need to be pruned. + * Such a file looks like this (with deno v2.1.4): + * ```json + * { + * "scope": "std", + * "name": "internal", + * "latest": "1.0.6", + * "versions": { + * "0.202.0": {}, + * "1.0.1": {}, + * "0.225.0": { + * "yanked": true + * }, + * } + * ``` + */ + +type PackageSpecifiers = { + [packageIdent: `${string}:${string}`]: string; +}; + +type LockJson = { + specifiers: PackageSpecifiers; + version: string; + workspace: any; + [registry: string]: any; +}; + +type Config = { + lockJson: LockJson; + cachePath: string; + vendorPath: string; +}; + +type PackageInfo = { + full: string; + registry: string | undefined; + scope: string | undefined; + name: string; + version: string; + suffix: string | undefined; +}; + +type PackagesByRegistry = { + [registry: string]: { + [packageName: string]: { + [version: string]: PackageInfo; + }; + }; +}; + +type PathsByRegistry = { + [packageRegistry: string]: string[]; +}; + +type RegistryJson = { + "dist-tags": any; + versions: { [version: string]: any }; + name: string; +}; + +type MetaJson = { + scope: string; + name: string; + latest: string; + versions: { + [version: string]: any; + }; +}; + +function getConfig(): Config { + const flags = parseArgs(Deno.args, { + string: ["lock-json", "cache-path", "vendor-path"], + }); + + if (!flags["lock-json"]) { + throw "--lock-json flag not set but required"; + } + if (!flags["cache-path"]) { + throw "--cache-path flag not set but required"; + } + if (!flags["vendor-path"]) { + throw "--vendor-path flag not set but required"; + } + + const lockJson = JSON.parse( + new TextDecoder("utf-8").decode(Deno.readFileSync(flags["lock-json"])) + ); + if (!lockJson) { + throw `could not parse lockJson at ${flags["lock-json"]}`; + } + + return { + lockJson, + cachePath: flags["cache-path"], + vendorPath: flags["vendor-path"], + }; +} + +function getAllPackageRegistries(specifiers: PackageSpecifiers): Set { + return Object.keys(specifiers).reduce((acc: Set, v: string) => { + const s = v.split(":"); + if (s.length !== 2) { + throw "unexpected registry format"; + } + const registry = s[0]; + acc.add(registry); + return acc; + }, new Set()); +} + +function parsePackageSpecifier(packageSpecifier: string): PackageInfo { + const match = + /^((?.*):)?((?@.*?)\/)?(?.*?)@(?.*?)(?_.*)?$/.exec( + packageSpecifier + ); + if ( + match !== null && + match.groups?.name !== undefined && + match.groups?.version !== undefined + ) { + return { + // npm:@amazn/style-dictionary@4.2.4_prettier@3.5.3 + full: match[0], + // npm + registry: match.groups?.registry, + // @amazn + scope: match.groups?.scope, + // style-dictionary + name: match.groups?.name, + // 4.2.4 + version: match.groups?.version, + // _prettier@3.5.3 + suffix: match.groups?.suffix, + }; + } + + throw "unexpected package specifier format"; +} + +function getScopedName(name: string, scope?: string): string { + if (scope !== undefined) { + return `${scope[0] === "@" ? "" : "@"}${scope}/${name}`; + } + return name; +} + +function getAllPackagesByPackageRegistry( + lockJson: LockJson, + registries: Set +): PackagesByRegistry { + const result: PackagesByRegistry = {}; + for (const registry of Array.from(registries)) { + const packageInfosOfRegistries = Object.keys(lockJson[registry]).map( + parsePackageSpecifier + ); + result[registry] = {}; + for (const packageInfo of packageInfosOfRegistries) { + const scopedName = getScopedName(packageInfo.name, packageInfo.scope); + if (result[registry][scopedName] === undefined) { + result[registry][scopedName] = {}; + } + result[registry][scopedName][packageInfo.version] = packageInfo; + } + } + return result; +} + +function findRegistryJsonPaths( + cachePath: string, + nonJsrPackages: PackagesByRegistry +): PathsByRegistry { + const result: PathsByRegistry = {}; + for (const registry of Object.keys(nonJsrPackages)) { + const path = `${cachePath}/${registry}`; + const registryJsonPaths = Array.from(walkSync(path)) + .filter((v) => v.name === "registry.json") + .map((v) => v.path); + result[registry] = registryJsonPaths; + } + return result; +} + +function pruneRegistryJsonFiles( + nonJsrPackages: PackagesByRegistry, + registryJsonPathsByRegistry: PathsByRegistry +): void { + for (const [registry, paths] of Object.entries(registryJsonPathsByRegistry)) { + for (const path of paths) { + const registryJson: RegistryJson = JSON.parse( + new TextDecoder("utf-8").decode(Deno.readFileSync(path)) + ); + + const scopedName = registryJson.name; + const packageInfoByVersion = nonJsrPackages[registry][scopedName]; + if (!packageInfoByVersion) { + throw `could not find key "${scopedName}" in\n${Object.keys( + nonJsrPackages[registry] + )}`; + } + + const newRegistryJson: RegistryJson = { + ...registryJson, + "dist-tags": {}, + versions: {}, + }; + + for (const version of Object.keys(packageInfoByVersion)) { + newRegistryJson.versions[version] = registryJson.versions[version]; + } + + Deno.writeFileSync( + path, + new TextEncoder().encode(JSON.stringify(newRegistryJson)) + ); + } + } +} + +function findMetaJsonPaths( + vendorPath: string, + jsrPackages: PackagesByRegistry +): PathsByRegistry { + const result: PathsByRegistry = {}; + for (const registry of Object.keys(jsrPackages)) { + const path = `${vendorPath}`; + const metaJsonPaths = Array.from(walkSync(path)) + .filter((v) => v.name === "meta.json") + .map((v) => v.path); + result[registry] = metaJsonPaths; + } + return result; +} + +function pruneMetaJsonFiles( + jsrPackages: PackagesByRegistry, + metaJsonPathsByRegistry: PathsByRegistry +): void { + for (const [registry, paths] of Object.entries(metaJsonPathsByRegistry)) { + for (const path of paths) { + const metaJson: MetaJson = JSON.parse( + new TextDecoder("utf-8").decode(Deno.readFileSync(path)) + ); + const scopedName = getScopedName(metaJson.name, metaJson.scope); + const packageInfoByVersion = jsrPackages[registry][scopedName]; + if (!packageInfoByVersion) { + throw `could not find key "${scopedName}" in\n${Object.keys( + jsrPackages[registry] + )}`; + } + const newMetaJson: MetaJson = { + ...metaJson, + latest: "", + versions: {}, + }; + + for (const version of Object.keys(packageInfoByVersion)) { + newMetaJson.versions[version] = metaJson.versions[version]; + } + + Deno.writeFileSync( + path, + new TextEncoder().encode(JSON.stringify(newMetaJson)) + ); + } + } +} + +function main() { + const config = getConfig(); + const registries = getAllPackageRegistries(config.lockJson.specifiers); + const packages = getAllPackagesByPackageRegistry(config.lockJson, registries); + + const jsrPackages = { + jsr: structuredClone(packages.jsr), + } satisfies PackagesByRegistry; + delete packages.jsr; + const nonJsrPackages = packages; + + const metaJsonpaths = findMetaJsonPaths(config.vendorPath, jsrPackages); + pruneMetaJsonFiles(jsrPackages, metaJsonpaths); + + const registryJsonPaths = findRegistryJsonPaths( + config.cachePath, + nonJsrPackages + ); + pruneRegistryJsonFiles(nonJsrPackages, registryJsonPaths); +} + +if (import.meta.main) { + main(); +} diff --git a/pkgs/build-support/deno/fetch-deno-deps/shell.nix b/pkgs/build-support/deno/fetch-deno-deps/shell.nix new file mode 100644 index 000000000000..c81e60e40d1e --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/shell.nix @@ -0,0 +1,7 @@ +let + pkgs = import ../../../../default.nix { }; +in +pkgs.mkShell { + buildInputs = [ pkgs.deno ]; + DENO_DIR = "./.deno"; +} diff --git a/pkgs/test/build-deno-package/.gitignore b/pkgs/test/build-deno-package/.gitignore new file mode 100644 index 000000000000..cb92b2a7589f --- /dev/null +++ b/pkgs/test/build-deno-package/.gitignore @@ -0,0 +1,3 @@ +.deno/ +node_modules/ +vendor/ diff --git a/pkgs/test/build-deno-package/binaries/.gitignore b/pkgs/test/build-deno-package/binaries/.gitignore new file mode 100644 index 000000000000..cb92b2a7589f --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/.gitignore @@ -0,0 +1,3 @@ +.deno/ +node_modules/ +vendor/ diff --git a/pkgs/test/build-deno-package/binaries/default.nix b/pkgs/test/build-deno-package/binaries/default.nix new file mode 100644 index 000000000000..dd61288bd5be --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/default.nix @@ -0,0 +1,25 @@ +{ pkgs, buildDenoPackage }: +{ + linux = buildDenoPackage rec { + pname = "test-deno-build-binaries-${targetSystem}"; + version = "0.1.0"; + denoDepsHash = "sha256-i+FKvKe1A38XBTk0YSuKshBpPXdAx+adWlXSCcmCJo8="; + src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + binaryEntrypointPath = "./main.ts"; + targetSystem = "x86_64-linux"; + }; + # mac = + # let + # targetSystem = "aarch64-darwin"; + # macpkgs = import ../../../../default.nix { crossSystem = { config = "arm64-apple-darwin"; };}; + # in + # buildDenoPackage { + # pname = "test-deno-build-binaries-${targetSystem}"; + # version = "0.1.0"; + # denoDepsHash = ""; + # src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + # binaryEntrypointPath = "./main.ts"; + # denortPackage = macpkgs.denort; + # inherit targetSystem; + # }; +} diff --git a/pkgs/test/build-deno-package/binaries/deno.json b/pkgs/test/build-deno-package/binaries/deno.json new file mode 100644 index 000000000000..5e8a1c53d6a2 --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/deno.json @@ -0,0 +1,13 @@ +{ + "name": "binary build", + "tasks": { + "build": "deno run --allow-all main.ts" + }, + "imports": { + "@luca/cases": "jsr:@luca/cases@1.0.0", + "@std/cli": "jsr:@std/cli@1.0.17", + "cowsay": "npm:cowsay@1.6.0", + "cases": "https://deno.land/x/case@2.2.0/mod.ts" + }, + "vendor": true +} diff --git a/pkgs/test/build-deno-package/binaries/deno.lock b/pkgs/test/build-deno-package/binaries/deno.lock new file mode 100644 index 000000000000..8b78a2e14575 --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/deno.lock @@ -0,0 +1,217 @@ +{ + "version": "4", + "specifiers": { + "jsr:@luca/cases@1.0.0": "1.0.0", + "jsr:@std/cli@1.0.17": "1.0.17", + "npm:cowsay@1.6.0": "1.6.0" + }, + "jsr": { + "@luca/cases@1.0.0": { + "integrity": "b5f9471f1830595e63a2b7d62821ac822a19e16899e6584799be63f17a1fbc30" + }, + "@std/cli@1.0.17": { + "integrity": "e15b9abe629e17be90cc6216327f03a29eae613365f1353837fa749aad29ce7b" + } + }, + "npm": { + "ansi-regex@3.0.1": { + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==" + }, + "ansi-regex@5.0.1": { + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles@4.3.0": { + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": [ + "color-convert" + ] + }, + "camelcase@5.3.1": { + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "cliui@6.0.0": { + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": [ + "string-width@4.2.3", + "strip-ansi@6.0.1", + "wrap-ansi" + ] + }, + "color-convert@2.0.1": { + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": [ + "color-name" + ] + }, + "color-name@1.1.4": { + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cowsay@1.6.0": { + "integrity": "sha512-8C4H1jdrgNusTQr3Yu4SCm+ZKsAlDFbpa0KS0Z3im8ueag+9pGOf3CrioruvmeaW/A5oqg9L0ar6qeftAh03jw==", + "dependencies": [ + "get-stdin", + "string-width@2.1.1", + "strip-final-newline", + "yargs" + ] + }, + "decamelize@1.2.0": { + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "emoji-regex@8.0.0": { + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up@4.1.0": { + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": [ + "locate-path", + "path-exists" + ] + }, + "get-caller-file@2.0.5": { + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-stdin@8.0.0": { + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==" + }, + "is-fullwidth-code-point@2.0.0": { + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==" + }, + "is-fullwidth-code-point@3.0.0": { + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path@5.0.0": { + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": [ + "p-locate" + ] + }, + "p-limit@2.3.0": { + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": [ + "p-try" + ] + }, + "p-locate@4.1.0": { + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": [ + "p-limit" + ] + }, + "p-try@2.2.0": { + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists@4.0.0": { + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "require-directory@2.1.1": { + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-main-filename@2.0.0": { + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "set-blocking@2.0.0": { + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "string-width@2.1.1": { + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dependencies": [ + "is-fullwidth-code-point@2.0.0", + "strip-ansi@4.0.0" + ] + }, + "string-width@4.2.3": { + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": [ + "emoji-regex", + "is-fullwidth-code-point@3.0.0", + "strip-ansi@6.0.1" + ] + }, + "strip-ansi@4.0.0": { + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dependencies": [ + "ansi-regex@3.0.1" + ] + }, + "strip-ansi@6.0.1": { + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": [ + "ansi-regex@5.0.1" + ] + }, + "strip-final-newline@2.0.0": { + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "which-module@2.0.1": { + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "wrap-ansi@6.2.0": { + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": [ + "ansi-styles", + "string-width@4.2.3", + "strip-ansi@6.0.1" + ] + }, + "y18n@4.0.3": { + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs-parser@18.1.3": { + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": [ + "camelcase", + "decamelize" + ] + }, + "yargs@15.4.1": { + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": [ + "cliui", + "decamelize", + "find-up", + "get-caller-file", + "require-directory", + "require-main-filename", + "set-blocking", + "string-width@4.2.3", + "which-module", + "y18n", + "yargs-parser" + ] + } + }, + "redirects": { + "https://deno.land/x/case/mod.ts": "https://deno.land/x/case@2.2.0/mod.ts" + }, + "remote": { + "https://deno.land/x/case@2.2.0/camelCase.ts": "b9a4cf361a7c9740ecb75e00b5e2c006bd4e5d40e442d26c5f2760286fa66796", + "https://deno.land/x/case@2.2.0/constantCase.ts": "c698fc32f00cd267c1684b1d413d784260d7e7798f2bf506803e418497d839b5", + "https://deno.land/x/case@2.2.0/dotCase.ts": "03ae55d5635e6a4ca894a003d9297cd9cd283af2e7d761dd3de13663849a9423", + "https://deno.land/x/case@2.2.0/headerCase.ts": "3f6c8ab2ab30a88147326bce28a00d1189ec98ab61c83ab72ce79e852afddc4a", + "https://deno.land/x/case@2.2.0/lowerCase.ts": "d75eb55cadfa589f9f2a973924a8a209054477d9574da669410f4d817ab25b41", + "https://deno.land/x/case@2.2.0/lowerFirstCase.ts": "b001efbf2d715b53d066b22cdbf8eda7f99aa7108e3d12fb02f80d499bae93d9", + "https://deno.land/x/case@2.2.0/mod.ts": "28b0b1329c7b18730799ac05627a433d9547c04b9bfb429116247c60edecd97b", + "https://deno.land/x/case@2.2.0/normalCase.ts": "085c8b6f9d69283c8b86f2e504d43278c2be8b7e56a3ed8d4a5f395e398bdc29", + "https://deno.land/x/case@2.2.0/paramCase.ts": "a234c9c17dfbaddee647b6571c2c90e8f6530123fed26c4546f4063d67c1609f", + "https://deno.land/x/case@2.2.0/pascalCase.ts": "4b3ef0a68173871a821d306d4067e8f72d42aeeef1eea6aeab30af6bfa3d7427", + "https://deno.land/x/case@2.2.0/pathCase.ts": "330a34b4df365b0291d8e36158235340131730aae6f6add66962ed2d0fbead4a", + "https://deno.land/x/case@2.2.0/sentenceCase.ts": "b312cef147a13b58ffdf3c36bf55b33aa8322c91f4aa9b32318f3911bb92327f", + "https://deno.land/x/case@2.2.0/snakeCase.ts": "e5ac1e08532ca397aa3150a0a3255d59f63a186d934e5094a8ffd24cbca7f955", + "https://deno.land/x/case@2.2.0/swapCase.ts": "bb03742fcf613f733890680ceca1b39b65ed290f36a317fcd47edd517c4e0e1e", + "https://deno.land/x/case@2.2.0/titleCase.ts": "c287131ea2c955e67cdd5cf604de96d31a8e2813305759922b9ed27e3be354e7", + "https://deno.land/x/case@2.2.0/types.ts": "8e2bd6edaa27c0d1972c0d5b76698564740f37b4d3787d58d1fb5f48de611e61", + "https://deno.land/x/case@2.2.0/upperCase.ts": "6cca267bb04d098bf4abf21e42e60c3e68ede89b12e525643c6b6eff3e10de34", + "https://deno.land/x/case@2.2.0/upperFirstCase.ts": "b964c2d8d3a85c78cd35f609135cbde99d84b9522a21470336b5af80a37facbd", + "https://deno.land/x/case@2.2.0/vendor/camelCaseRegexp.ts": "7d9ff02aad4ab6429eeab7c7353f7bcdd6cc5909a8bd3dda97918c8bbb7621ae", + "https://deno.land/x/case@2.2.0/vendor/camelCaseUpperRegexp.ts": "292de54a698370f90adcdf95727993d09888b7f33d17f72f8e54ba75f7791787", + "https://deno.land/x/case@2.2.0/vendor/nonWordRegexp.ts": "c1a052629a694144b48c66b0175a22a83f4d61cb40f4e45293fc5d6b123f927e" + }, + "workspace": { + "dependencies": [ + "jsr:@luca/cases@1.0.0", + "jsr:@std/cli@1.0.17", + "npm:cowsay@1.6.0" + ] + } +} diff --git a/pkgs/test/build-deno-package/binaries/main.ts b/pkgs/test/build-deno-package/binaries/main.ts new file mode 100644 index 000000000000..0d8b922bac22 --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/main.ts @@ -0,0 +1,15 @@ +import { camelCase } from "@luca/cases"; +import { say } from "cowsay"; +import { pascalCase } from "cases"; +import { parseArgs } from "@std/cli"; + +const flags = parseArgs(Deno.args, { + string: ["text"], +}); + +if (!flags.text) { + throw "--text required but not specified"; +} + +console.log(camelCase(say({ text: flags.text }))); +console.log(pascalCase(say({ text: flags.text }))); diff --git a/pkgs/test/build-deno-package/default.nix b/pkgs/test/build-deno-package/default.nix new file mode 100644 index 000000000000..3529a2ca15ee --- /dev/null +++ b/pkgs/test/build-deno-package/default.nix @@ -0,0 +1,16 @@ +{ pkgs }: +{ + inherit (pkgs.callPackage ./workspaces { }) + sub1 + sub2 + sub1Binary + ; + inherit (pkgs.callPackage ./binaries { }) + linux + # mac + ; + inherit (pkgs.callPackage ./external { }) + readma-cli-linux + fresh-init-cli-linux + ; +} diff --git a/pkgs/test/build-deno-package/external/default.nix b/pkgs/test/build-deno-package/external/default.nix new file mode 100644 index 000000000000..3a8e123d3f61 --- /dev/null +++ b/pkgs/test/build-deno-package/external/default.nix @@ -0,0 +1,30 @@ +{ fetchFromGitHub, buildDenoPackage }: +{ + readma-cli-linux = buildDenoPackage rec { + pname = "readma-cli"; + version = "2.11.0"; + denoDepsHash = "sha256-uh+yaT8oPMD0FRENH4LaoCsvbWmQ0j+xPbAL3e4Mfws="; + src = fetchFromGitHub { + owner = "elcoosp"; + repo = "readma"; + rev = "${version}"; + hash = "sha256-FVQTn+r7Ztj02vNvqFZIRIsokWeo1tPfFYffK2tvxjA="; + }; + binaryEntrypointPath = "./cli/mod.ts"; + targetSystem = "x86_64-linux"; + }; + fresh-init-cli-linux = buildDenoPackage { + pname = "fresh-init-cli"; + version = ""; + denoDepsHash = "sha256-ycSMUyY7xj+o9gIVwUWbcoN+5Gf27P2x0dFUmtWGGlQ="; + src = fetchFromGitHub { + owner = "denoland"; + repo = "fresh"; + rev = "c7c341b695bad8d0f3e3575e5fa9c82e0fa28bd4"; + hash = "sha256-bC4akr4Wt4sRqGkgjNuXztW8Q6YBLBsbuIOhsXH8NQU="; + }; + denoWorkspacePath = "./init"; + binaryEntrypointPath = "./src/mod.ts"; + targetSystem = "x86_64-linux"; + }; +} diff --git a/pkgs/test/build-deno-package/shell.nix b/pkgs/test/build-deno-package/shell.nix new file mode 100644 index 000000000000..c04bf6d5da2d --- /dev/null +++ b/pkgs/test/build-deno-package/shell.nix @@ -0,0 +1,9 @@ +let + pkgs = import { }; +in +pkgs.mkShell { + buildInputs = [ pkgs.deno ]; + DENO_DIR = "./.deno"; + + shellHook = ''''; +} diff --git a/pkgs/test/build-deno-package/workspaces/.gitignore b/pkgs/test/build-deno-package/workspaces/.gitignore new file mode 100644 index 000000000000..cb92b2a7589f --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/.gitignore @@ -0,0 +1,3 @@ +.deno/ +node_modules/ +vendor/ diff --git a/pkgs/test/build-deno-package/workspaces/default.nix b/pkgs/test/build-deno-package/workspaces/default.nix new file mode 100644 index 000000000000..8c621cf09b31 --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/default.nix @@ -0,0 +1,39 @@ +{ pkgs, buildDenoPackage }: +rec { + sub1 = buildDenoPackage { + pname = "test-deno-build-workspaces-sub1"; + version = "0.1.0"; + denoDepsHash = "sha256-Qvn3g+2NeWpNCfmfqXtPcJU4+LwrOSh1nq51xAbZZhk="; + src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + denoWorkspacePath = "./sub1"; + denoTaskFlags = [ + "--text" + "sub1" + ]; + denoTaskSuffix = ">out.txt"; + installPhase = '' + cp out.txt $out + ''; + }; + sub2 = buildDenoPackage { + pname = "test-deno-build-workspaces-sub2"; + version = "0.1.0"; + inherit (sub1) denoDeps src; + denoWorkspacePath = "./sub2"; + denoTaskFlags = [ + "--text" + "sub2" + ]; + denoTaskSuffix = ">out.txt"; + installPhase = '' + cp out.txt $out + ''; + }; + sub1Binary = buildDenoPackage { + pname = "test-deno-build-workspaces-sub1-binary"; + version = "0.1.0"; + inherit (sub1) denoDeps src; + denoWorkspacePath = "./sub1"; + binaryEntrypointPath = "./main.ts"; + }; +} diff --git a/pkgs/test/build-deno-package/workspaces/deno.json b/pkgs/test/build-deno-package/workspaces/deno.json new file mode 100644 index 000000000000..86437ea04197 --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/deno.json @@ -0,0 +1,7 @@ +{ + "workspace":[ + "./sub1", + "./sub2" + ], + "vendor": true +} diff --git a/pkgs/test/build-deno-package/workspaces/deno.lock b/pkgs/test/build-deno-package/workspaces/deno.lock new file mode 100644 index 000000000000..5bebad8a64ef --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/deno.lock @@ -0,0 +1,227 @@ +{ + "version": "4", + "specifiers": { + "jsr:@luca/cases@1.0.0": "1.0.0", + "jsr:@std/cli@1.0.17": "1.0.17", + "npm:cowsay@1.6.0": "1.6.0" + }, + "jsr": { + "@luca/cases@1.0.0": { + "integrity": "b5f9471f1830595e63a2b7d62821ac822a19e16899e6584799be63f17a1fbc30" + }, + "@std/cli@1.0.17": { + "integrity": "e15b9abe629e17be90cc6216327f03a29eae613365f1353837fa749aad29ce7b" + } + }, + "npm": { + "ansi-regex@3.0.1": { + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==" + }, + "ansi-regex@5.0.1": { + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles@4.3.0": { + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": [ + "color-convert" + ] + }, + "camelcase@5.3.1": { + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + }, + "cliui@6.0.0": { + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": [ + "string-width@4.2.3", + "strip-ansi@6.0.1", + "wrap-ansi" + ] + }, + "color-convert@2.0.1": { + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": [ + "color-name" + ] + }, + "color-name@1.1.4": { + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "cowsay@1.6.0": { + "integrity": "sha512-8C4H1jdrgNusTQr3Yu4SCm+ZKsAlDFbpa0KS0Z3im8ueag+9pGOf3CrioruvmeaW/A5oqg9L0ar6qeftAh03jw==", + "dependencies": [ + "get-stdin", + "string-width@2.1.1", + "strip-final-newline", + "yargs" + ] + }, + "decamelize@1.2.0": { + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" + }, + "emoji-regex@8.0.0": { + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "find-up@4.1.0": { + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": [ + "locate-path", + "path-exists" + ] + }, + "get-caller-file@2.0.5": { + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-stdin@8.0.0": { + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==" + }, + "is-fullwidth-code-point@2.0.0": { + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==" + }, + "is-fullwidth-code-point@3.0.0": { + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "locate-path@5.0.0": { + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": [ + "p-locate" + ] + }, + "p-limit@2.3.0": { + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": [ + "p-try" + ] + }, + "p-locate@4.1.0": { + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": [ + "p-limit" + ] + }, + "p-try@2.2.0": { + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + }, + "path-exists@4.0.0": { + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "require-directory@2.1.1": { + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-main-filename@2.0.0": { + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + }, + "set-blocking@2.0.0": { + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" + }, + "string-width@2.1.1": { + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dependencies": [ + "is-fullwidth-code-point@2.0.0", + "strip-ansi@4.0.0" + ] + }, + "string-width@4.2.3": { + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": [ + "emoji-regex", + "is-fullwidth-code-point@3.0.0", + "strip-ansi@6.0.1" + ] + }, + "strip-ansi@4.0.0": { + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dependencies": [ + "ansi-regex@3.0.1" + ] + }, + "strip-ansi@6.0.1": { + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": [ + "ansi-regex@5.0.1" + ] + }, + "strip-final-newline@2.0.0": { + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "which-module@2.0.1": { + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "wrap-ansi@6.2.0": { + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": [ + "ansi-styles", + "string-width@4.2.3", + "strip-ansi@6.0.1" + ] + }, + "y18n@4.0.3": { + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs-parser@18.1.3": { + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": [ + "camelcase", + "decamelize" + ] + }, + "yargs@15.4.1": { + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": [ + "cliui", + "decamelize", + "find-up", + "get-caller-file", + "require-directory", + "require-main-filename", + "set-blocking", + "string-width@4.2.3", + "which-module", + "y18n", + "yargs-parser" + ] + } + }, + "redirects": { + "https://deno.land/x/case/mod.ts": "https://deno.land/x/case@2.2.0/mod.ts" + }, + "remote": { + "https://deno.land/x/case@2.2.0/camelCase.ts": "b9a4cf361a7c9740ecb75e00b5e2c006bd4e5d40e442d26c5f2760286fa66796", + "https://deno.land/x/case@2.2.0/constantCase.ts": "c698fc32f00cd267c1684b1d413d784260d7e7798f2bf506803e418497d839b5", + "https://deno.land/x/case@2.2.0/dotCase.ts": "03ae55d5635e6a4ca894a003d9297cd9cd283af2e7d761dd3de13663849a9423", + "https://deno.land/x/case@2.2.0/headerCase.ts": "3f6c8ab2ab30a88147326bce28a00d1189ec98ab61c83ab72ce79e852afddc4a", + "https://deno.land/x/case@2.2.0/lowerCase.ts": "d75eb55cadfa589f9f2a973924a8a209054477d9574da669410f4d817ab25b41", + "https://deno.land/x/case@2.2.0/lowerFirstCase.ts": "b001efbf2d715b53d066b22cdbf8eda7f99aa7108e3d12fb02f80d499bae93d9", + "https://deno.land/x/case@2.2.0/mod.ts": "28b0b1329c7b18730799ac05627a433d9547c04b9bfb429116247c60edecd97b", + "https://deno.land/x/case@2.2.0/normalCase.ts": "085c8b6f9d69283c8b86f2e504d43278c2be8b7e56a3ed8d4a5f395e398bdc29", + "https://deno.land/x/case@2.2.0/paramCase.ts": "a234c9c17dfbaddee647b6571c2c90e8f6530123fed26c4546f4063d67c1609f", + "https://deno.land/x/case@2.2.0/pascalCase.ts": "4b3ef0a68173871a821d306d4067e8f72d42aeeef1eea6aeab30af6bfa3d7427", + "https://deno.land/x/case@2.2.0/pathCase.ts": "330a34b4df365b0291d8e36158235340131730aae6f6add66962ed2d0fbead4a", + "https://deno.land/x/case@2.2.0/sentenceCase.ts": "b312cef147a13b58ffdf3c36bf55b33aa8322c91f4aa9b32318f3911bb92327f", + "https://deno.land/x/case@2.2.0/snakeCase.ts": "e5ac1e08532ca397aa3150a0a3255d59f63a186d934e5094a8ffd24cbca7f955", + "https://deno.land/x/case@2.2.0/swapCase.ts": "bb03742fcf613f733890680ceca1b39b65ed290f36a317fcd47edd517c4e0e1e", + "https://deno.land/x/case@2.2.0/titleCase.ts": "c287131ea2c955e67cdd5cf604de96d31a8e2813305759922b9ed27e3be354e7", + "https://deno.land/x/case@2.2.0/types.ts": "8e2bd6edaa27c0d1972c0d5b76698564740f37b4d3787d58d1fb5f48de611e61", + "https://deno.land/x/case@2.2.0/upperCase.ts": "6cca267bb04d098bf4abf21e42e60c3e68ede89b12e525643c6b6eff3e10de34", + "https://deno.land/x/case@2.2.0/upperFirstCase.ts": "b964c2d8d3a85c78cd35f609135cbde99d84b9522a21470336b5af80a37facbd", + "https://deno.land/x/case@2.2.0/vendor/camelCaseRegexp.ts": "7d9ff02aad4ab6429eeab7c7353f7bcdd6cc5909a8bd3dda97918c8bbb7621ae", + "https://deno.land/x/case@2.2.0/vendor/camelCaseUpperRegexp.ts": "292de54a698370f90adcdf95727993d09888b7f33d17f72f8e54ba75f7791787", + "https://deno.land/x/case@2.2.0/vendor/nonWordRegexp.ts": "c1a052629a694144b48c66b0175a22a83f4d61cb40f4e45293fc5d6b123f927e" + }, + "workspace": { + "members": { + "sub1": { + "dependencies": [ + "jsr:@std/cli@1.0.17", + "npm:cowsay@1.6.0" + ] + }, + "sub2": { + "dependencies": [ + "jsr:@luca/cases@1.0.0", + "jsr:@std/cli@1.0.17", + "npm:cowsay@1.6.0" + ] + } + } + } +} diff --git a/pkgs/test/build-deno-package/workspaces/sub1/deno.json b/pkgs/test/build-deno-package/workspaces/sub1/deno.json new file mode 100644 index 000000000000..dc00086de60d --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/sub1/deno.json @@ -0,0 +1,10 @@ +{ + "tasks": { + "build": "deno run --allow-all main.ts" + }, + "imports": { + "@std/cli": "jsr:@std/cli@1.0.17", + "cowsay": "npm:cowsay@1.6.0", + "cases": "https://deno.land/x/case@2.2.0/mod.ts" + } +} diff --git a/pkgs/test/build-deno-package/workspaces/sub1/main.ts b/pkgs/test/build-deno-package/workspaces/sub1/main.ts new file mode 100644 index 000000000000..7164d1aeecba --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/sub1/main.ts @@ -0,0 +1,13 @@ +import { say } from "cowsay"; +import { pascalCase } from "cases"; +import { parseArgs } from "@std/cli"; + +const flags = parseArgs(Deno.args, { + string: ["text"], +}); + +if (!flags.text) { + throw "--text required but not specified"; +} + +console.log(pascalCase(say({ text: flags.text }))); diff --git a/pkgs/test/build-deno-package/workspaces/sub2/deno.json b/pkgs/test/build-deno-package/workspaces/sub2/deno.json new file mode 100644 index 000000000000..a7d350d391fc --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/sub2/deno.json @@ -0,0 +1,10 @@ +{ + "tasks": { + "build": "deno run --allow-all main.ts" + }, + "imports": { + "@luca/cases": "jsr:@luca/cases@1.0.0", + "@std/cli": "jsr:@std/cli@1.0.17", + "cowsay": "npm:cowsay@1.6.0" + } +} diff --git a/pkgs/test/build-deno-package/workspaces/sub2/main.ts b/pkgs/test/build-deno-package/workspaces/sub2/main.ts new file mode 100644 index 000000000000..cb1806f1bcd6 --- /dev/null +++ b/pkgs/test/build-deno-package/workspaces/sub2/main.ts @@ -0,0 +1,13 @@ +import { camelCase } from "@luca/cases"; +import { say } from "cowsay"; +import { parseArgs } from "@std/cli"; + +const flags = parseArgs(Deno.args, { + string: ["text"], +}); + +if (!flags.text) { + throw "--text required but not specified"; +} + +console.log(camelCase(say({ text: flags.text }))); diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index 7804ea23b06e..6910141bf659 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -212,4 +212,6 @@ with pkgs; build-environment-info = callPackage ./build-environment-info { }; rust-hooks = recurseIntoAttrs (callPackages ../build-support/rust/hooks/test { }); + + build-deno-package = callPackage ./build-deno-package { }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 09c32d2f97c2..6453e52fd0fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3642,6 +3642,12 @@ with pkgs; node2nix = nodePackages.node2nix; + buildDenoPackage = callPackage ../build-support/deno/build-deno-package { }; + + inherit (callPackages ../build-support/deno/fetch-deno-deps { }) fetchDenoDeps; + + denoHooks = callPackage ../build-support/deno/build-deno-package/hooks { }; + kcollectd = libsForQt5.callPackage ../tools/misc/kcollectd { }; ktailctl = kdePackages.callPackage ../applications/networking/ktailctl { }; From 486c50343010717c6bb968955ad085c6b849102f Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 15 May 2025 20:44:22 +0200 Subject: [PATCH 10/82] doc: added docs for buildDenoPackage --- .../javascript.section.md | 245 ++++++++++++++++++ doc/redirects.json | 36 +++ 2 files changed, 281 insertions(+) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index e327eb43ea40..cbefcafb426a 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -879,6 +879,251 @@ stdenv.mkDerivation (finalAttrs: { }) ``` +### buildDenoPackage {#javascript-buildDenoPackage} + +`buildDenoPackage` allows you to package Deno-based projects in Nixpkgs without the use of an auto-generated dependencies file (as used in [node2nix](#javascript-node2nix)). +It works by utilizing Deno's cache functionality -- creating a reproducible cache that contains the dependencies of a project, and pointing Deno to it. + +#### buildDenoDeps {#javascript-buildDenoPackage-buildDenoDeps} + +For every `buildDenoPackage`, first, a [fixed output derivation](https://nix.dev/manual/nix/2.18/language/advanced-attributes.html?highlight=fixed%20output#adv-attr-outputHash) is +created with all the dependencies mentioned in the `deno.lock`. +This works as follows: +1. They are installed using `deno install`. +2. All non-reproducible data is pruned. +3. The directories `.deno`, `node_modules` and `vendor` are copied to `$out`. +4. The output of the FOD is checked against the `denoDepsHash`. +5. The output is copied into the build of `buildDenoPackage`, which is not an FOD. +6. The dependencies are installed again using `deno install`, this time from the local cache only. + +The `buildDenoDeps` derivation is in `passthru`, so it can be accessed from a `buildDenoPackage` derivation with `.denoDeps` + +Related options: +* `denoDepsHash`: The output hash of the `buildDenoDeps` fixed output derivation. +* `denoInstallFlags`: Flags passed to `deno install`. +Defaults to `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` +and `[ "--allow-scripts" "--frozen" "--cached-only" ]` for `buildDenoPackage` + +#### Private registries {#javascript-buildDenoPackage-private-registries} +There are currently 2 options, which enable the use of private registries in a `buildDenoPackage` derivation. + +**`denoDepsImpureEnvVars`**: + +A list of strings, which are names of impure environment variables passed to the `buildDenoDeps` derivation. +They are forwarded to `deno install`. + +It can be used to set tokens for private NPM registries (in a `.npmrc` file). + +Example: `[ "NPM_TOKEN" ]` + +In a single-user installation of Nix, you can put the variables into the environment, when running the nix build. + +In multi-user installations of Nix, it's necessary to set the environment variables in the nix-daemon, probably with systemd. + +:::{.example} + +##### configure nix-daemon {#javascript-buildDenoPackage-private-registries-daemon-example} +In NixOS' `configuration.nix`: + +```nix +{ + systemd.services.nix-daemon.environment.NPM_TOKEN = ""; +} +``` + +In other Linux distributions use + +``` +$ sudo systemctl edit nix-daemon +$ sudo systemctl cat nix-daemon +$ sudo systemctl restart nix-daemon +``` + +::: + +**`denoDepsInjectedEnvVars`**: + +An attribute set with environment variables as key value pairs. Example: `{ "NPM_TOKEN" = ""; }` + +They are forwarded to `deno install`. +It can be used to set tokens for private NPM registries (in a `.npmrc` file). +You could pass these tokens from the Nix CLI with `--arg`, +however this can hurt the reproducibility of your builds and such an injected +token will also need to be injected in every build that depends on this build. + +:::{.example} + +##### example `.npmrc` {#javascript-buildDenoPackage-private-registries-npmrc-example} + +```ini +@:registry=https:/// +///:_authToken=${NPM_TOKEN} +``` + +::: + +::: {.note} +Neither approach is ideal. For `buildNpmPackage`, there exists a third +option called `sourceOverrides`, which allows the user to inject Nix packages into +the output `node_modules` folder. +Since a Nix build implicitly uses the SSH keys of the machine, +this offers a third option to access private packages. +But this creates the requirement, that the imported package is packaged with nix first, +and that the source code can be retrieved with SSH. +This is possible for Deno, too, albeit it not +completely analogous to `buildNpmPackage`'s solution. +However, it has not been implemented yet. +::: + +#### Compile to binary {#javascript-buildDenoPackage-compile-to-binary} + +It's possible to compile a Deno project to a single binary using `deno compile`. +The binary will be named like the `.name` property in `deno.json`, if available, +or the `name` attribute of the derivation. + +Related options: + +* `hostPlatform`: The [host platform](#ssec-cross-platform-parameters) the binary is built for. Defaults to `builtins.currentSystem`. +Supported are `"x86_64-darwin", "aarch64-darwin", "x86_64-linux", "aarch64-linux"`. +* `denoCompileFlags`: Flags passed to `deno compile`. +* `binaryEntrypointPath`: If not `null`, create a binary using the specified path as the entrypoint, +copy it to `$out/bin` in `installPhase`. It's prefixed by `denoWorkspacePath`, if using workspaces. +* `denortPackage`: The package used as the Deno runtime, which is bundled with the JavaScript code to create the binary. +Defaults to `pkgs.denort`. Don't use `pkgs.deno` for this, since that is the full Deno CLI, with all the development tooling. +If you're cross compiling, this needs to be the `denort` of the `hostPlatform`. + +::: {.note} +The binary will be dynamically linked and not executable on NixOS without [nix-ld](https://github.com/nix-community/nix-ld) +or [other methods](https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos). + +```nix +{ + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + glibc + gcc-unwrapped + ]; +} +``` + +::: + +:::{.example} + +##### example binary build {#javascript-buildDenoPackage-compile-to-binary-example} + +```nix +{ buildDenoPackage, pkgs }: +buildDenoPackage { + pname = "myPackage"; + version = "0.1.0"; + denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + binaryEntrypointPath = "main.ts"; +}; +``` + +::: + +#### Create artifacts in the build {#javascript-buildDenoPackage-artifacts-in-build} + +Instead of compiling to a binary, `deno task` can be executed inside the build +to produce some artifact, which can then be copied out in the `installPhase`. + +Related options: +* `denoTaskScript`: The task in `deno.json` that's executed with `deno task`. Defaults to `"build"`. +* `denoTaskFlags`: Flags passed to `deno task`. +* `denoTaskPrefix` & `denoTaskSuffix`: Unquoted strings surrounding `deno task`. For example to pipe stdout to a file. + +:::{.example} + +##### example artifact build {#javascript-buildDenoPackage-artifacts-in-build-example} + +`deno.json` + +```json +{ + "tasks": { + "build": "deno run --allow-all main.ts" + } +} +``` + +```nix +{ buildDenoPackage, pkgs }: +buildDenoPackage { + pname = "myPackage"; + version = "0.1.0"; + denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + denoTaskSuffix = ">out.txt"; + installPhase = '' + cp ./out.txt $out + ''; +}; +``` + +::: + +#### Workspaces {#javascript-buildDenoPackage-workspaces} + +Deno's workspaces are supported. + +To make them work, the whole project needs to added as source, since the `deno.lock` +is always in the root of the project and contains all dependencies. + +This means a build with only the required dependencies of a workspace is not possible. +Also, the `denoDepsHash` for all workspaces is the same, since they +all share the same dependencies. + +When [running a task inside the build](#javascript-buildDenoPackage-artifacts-in-build), +`denoWorkspacePath` can be used to let the task run inside a workspace. + +When [compiling to a binary](#javascript-buildDenoPackage-compile-to-binary), +`binaryEntrypointPath` is prefixed by `denoWorkspacePath`. + +Related options: + * `denoWorkspacePath`: Path to a workspace. + +:::{.example} + +##### example workspaces {#javascript-buildDenoPackage-workspaces-example} + +```nix +{ buildDenoPackage, pkgs }: +rec { + sub1 = buildDenoPackage { + pname = "sub1"; + version = "0.1.0"; + denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + denoWorkspacePath = "./sub1"; + denoTaskFlags = ["--text" "sub1"]; + denoTaskSuffix = ">out.txt"; + installPhase = '' + cp out.txt $out + ''; + }; + sub2 = buildDenoPackage { + # Note that we are reusing denoDeps and src, + # since they must be the same for both workspaces. + inherit (sub1) denoDeps src; + pname = "sub2"; + version = "0.1.0"; + denoWorkspacePath = "./sub2"; + binaryEntrypointPath = "./main.ts"; + }; +} +``` + +::: + +#### Other Options {#javascript-buildDenoPackage-other-options} + + * `denoDir`: Set `DENO_DIR` to this value and use it for all `deno` commands + * `denoFlags`: Flags passed to all `deno` commands. + * `denoPackage`: The Deno CLI used for all `deno` commands inside the build. + ## Outside Nixpkgs {#javascript-outside-nixpkgs} There are some other tools available, which are written in the Nix language. diff --git a/doc/redirects.json b/doc/redirects.json index 33bb47fbc5e5..56d7653904a2 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -3378,6 +3378,42 @@ "javascript-nix-npm-buildpackage-pitfalls": [ "index.html#javascript-nix-npm-buildpackage-pitfalls" ], + "javascript-buildDenoPackage-workspaces-example": [ + "index.html#javascript-buildDenoPackage-workspaces-example" + ], + "javascript-buildDenoPackage-private-registries": [ + "index.html#javascript-buildDenoPackage-private-registries" + ], + "javascript-buildDenoPackage-buildDenoDeps": [ + "index.html#javascript-buildDenoPackage-buildDenoDeps" + ], + "javascript-buildDenoPackage-artifacts-in-build": [ + "index.html#javascript-buildDenoPackage-artifacts-in-build" + ], + "javascript-buildDenoPackage-artifacts-in-build-example": [ + "index.html#javascript-buildDenoPackage-artifacts-in-build-example" + ], + "javascript-buildDenoPackage-private-registries-daemon-example": [ + "index.html#javascript-buildDenoPackage-private-registries-daemon-example" + ], + "javascript-buildDenoPackage-private-registries-npmrc-example": [ + "index.html#javascript-buildDenoPackage-private-registries-npmrc-example" + ], + "javascript-buildDenoPackage-compile-to-binary-example": [ + "index.html#javascript-buildDenoPackage-compile-to-binary-example" + ], + "javascript-buildDenoPackage-workspaces": [ + "index.html#javascript-buildDenoPackage-workspaces" + ], + "javascript-buildDenoPackage": [ + "index.html#javascript-buildDenoPackage" + ], + "javascript-buildDenoPackage-other-options": [ + "index.html#javascript-buildDenoPackage-other-options" + ], + "javascript-buildDenoPackage-compile-to-binary": [ + "index.html#javascript-buildDenoPackage-compile-to-binary" + ], "language-julia": [ "index.html#language-julia" ], From 55f27f2bba1472cc85aa6a63057bf6ceed5960db Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 15 May 2025 21:04:25 +0200 Subject: [PATCH 11/82] doc: mentioned in release-notes --- doc/release-notes/rl-2505.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 11d54b19159f..01d952655ad5 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -551,6 +551,8 @@ - `ddclient` was updated from 3.11.2 to 4.0.0 [Release notes](https://github.com/ddclient/ddclient/releases/tag/v4.0.0) +- `buildDenoPackage` was added [see docs](https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#avascript-buildDenoPackage) for more details + ## Nixpkgs Library {#sec-nixpkgs-release-25.05-lib} ### Breaking changes {#sec-nixpkgs-release-25.05-lib-breaking} From d1e5782bba102e9bb3aecb28800b26b7a25dcfb8 Mon Sep 17 00:00:00 2001 From: aMOPel <36712072+aMOPel@users.noreply.github.com> Date: Fri, 16 May 2025 10:33:38 +0200 Subject: [PATCH 12/82] Update doc/languages-frameworks/javascript.section.md Co-authored-by: Valentin Gagarin --- doc/languages-frameworks/javascript.section.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index cbefcafb426a..bea269a50eff 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -881,7 +881,7 @@ stdenv.mkDerivation (finalAttrs: { ### buildDenoPackage {#javascript-buildDenoPackage} -`buildDenoPackage` allows you to package Deno-based projects in Nixpkgs without the use of an auto-generated dependencies file (as used in [node2nix](#javascript-node2nix)). +`buildDenoPackage` allows you to package [Deno](https://deno.com/) projects in Nixpkgs without the use of an auto-generated dependencies file (as used in [node2nix](#javascript-node2nix)). It works by utilizing Deno's cache functionality -- creating a reproducible cache that contains the dependencies of a project, and pointing Deno to it. #### buildDenoDeps {#javascript-buildDenoPackage-buildDenoDeps} From 287b94f279aed0a73f5b53bf885566f9397b3738 Mon Sep 17 00:00:00 2001 From: aMOPel <36712072+aMOPel@users.noreply.github.com> Date: Fri, 16 May 2025 10:33:48 +0200 Subject: [PATCH 13/82] Update doc/languages-frameworks/javascript.section.md Co-authored-by: Valentin Gagarin --- doc/languages-frameworks/javascript.section.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index bea269a50eff..d8b043173dc3 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -886,7 +886,7 @@ It works by utilizing Deno's cache functionality -- creating a reproducible cach #### buildDenoDeps {#javascript-buildDenoPackage-buildDenoDeps} -For every `buildDenoPackage`, first, a [fixed output derivation](https://nix.dev/manual/nix/2.18/language/advanced-attributes.html?highlight=fixed%20output#adv-attr-outputHash) is +For every `buildDenoPackage`, first, a [fixed output derivation](https://nix.dev/manual/nix/2.18/language/advanced-attributes.html#adv-attr-outputHash) is created with all the dependencies mentioned in the `deno.lock`. This works as follows: 1. They are installed using `deno install`. From 0ffa7b88a268f141aeb765b91704f8b4c1119053 Mon Sep 17 00:00:00 2001 From: aMOPel <36712072+aMOPel@users.noreply.github.com> Date: Fri, 16 May 2025 10:34:10 +0200 Subject: [PATCH 14/82] Update doc/languages-frameworks/javascript.section.md Co-authored-by: Valentin Gagarin --- doc/languages-frameworks/javascript.section.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index d8b043173dc3..d689c37aadb5 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -890,11 +890,11 @@ For every `buildDenoPackage`, first, a [fixed output derivation](https://nix.dev created with all the dependencies mentioned in the `deno.lock`. This works as follows: 1. They are installed using `deno install`. -2. All non-reproducible data is pruned. -3. The directories `.deno`, `node_modules` and `vendor` are copied to `$out`. -4. The output of the FOD is checked against the `denoDepsHash`. -5. The output is copied into the build of `buildDenoPackage`, which is not an FOD. -6. The dependencies are installed again using `deno install`, this time from the local cache only. +1. All non-reproducible data is pruned. +1. The directories `.deno`, `node_modules` and `vendor` are copied to `$out`. +1. The output of the FOD is checked against the `denoDepsHash`. +1. The output is copied into the build of `buildDenoPackage`, which is not an FOD. +1. The dependencies are installed again using `deno install`, this time from the local cache only. The `buildDenoDeps` derivation is in `passthru`, so it can be accessed from a `buildDenoPackage` derivation with `.denoDeps` From c88d10c806788b46f69a1f63c1fa4e65087df0f4 Mon Sep 17 00:00:00 2001 From: aMOPel <36712072+aMOPel@users.noreply.github.com> Date: Fri, 16 May 2025 10:34:24 +0200 Subject: [PATCH 15/82] Update doc/languages-frameworks/javascript.section.md Co-authored-by: Valentin Gagarin --- doc/languages-frameworks/javascript.section.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index d689c37aadb5..1d6cf2fb0edf 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -984,7 +984,12 @@ or the `name` attribute of the derivation. Related options: * `hostPlatform`: The [host platform](#ssec-cross-platform-parameters) the binary is built for. Defaults to `builtins.currentSystem`. -Supported are `"x86_64-darwin", "aarch64-darwin", "x86_64-linux", "aarch64-linux"`. + + Supported values: + - `"x86_64-darwin"` + - `"aarch64-darwin"` + - `"x86_64-linux"` + - `"aarch64-linux"` * `denoCompileFlags`: Flags passed to `deno compile`. * `binaryEntrypointPath`: If not `null`, create a binary using the specified path as the entrypoint, copy it to `$out/bin` in `installPhase`. It's prefixed by `denoWorkspacePath`, if using workspaces. From 2857128ddd181ec43277c25fdf2bb0dd4ae815ea Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 16 May 2025 11:33:47 +0200 Subject: [PATCH 16/82] doc: refactored argument documention by using definition lists --- .../javascript.section.md | 155 +++++++++++++----- 1 file changed, 117 insertions(+), 38 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 1d6cf2fb0edf..2b4df6f68457 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -899,35 +899,48 @@ This works as follows: The `buildDenoDeps` derivation is in `passthru`, so it can be accessed from a `buildDenoPackage` derivation with `.denoDeps` Related options: -* `denoDepsHash`: The output hash of the `buildDenoDeps` fixed output derivation. -* `denoInstallFlags`: Flags passed to `deno install`. -Defaults to `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` -and `[ "--allow-scripts" "--frozen" "--cached-only" ]` for `buildDenoPackage` + +*`denoDepsHash`* (String) + +: The output hash of the `buildDenoDeps` fixed output derivation. + +*`denoInstallFlags`* (Array of strings; optional) + +: The Flags passed to `deno install`. + +: _Default:_ `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` +: _Default:_ `[ "--allow-scripts" "--frozen" "--cached-only" ]` for `buildDenoPackage` #### Private registries {#javascript-buildDenoPackage-private-registries} There are currently 2 options, which enable the use of private registries in a `buildDenoPackage` derivation. -**`denoDepsImpureEnvVars`**: +*`denoDepsImpureEnvVars`* (Array of strings; optional) -A list of strings, which are names of impure environment variables passed to the `buildDenoDeps` derivation. -They are forwarded to `deno install`. +: Names of impure environment variables passed to the `buildDenoDeps` derivation. They are forwarded to `deno install`. -It can be used to set tokens for private NPM registries (in a `.npmrc` file). +: _Example:_ `[ "NPM_TOKEN" ]` -Example: `[ "NPM_TOKEN" ]` +: It can be used to set tokens for private NPM registries (in a `.npmrc` file). -In a single-user installation of Nix, you can put the variables into the environment, when running the nix build. +: In a single-user installation of Nix, you can put the variables into the environment, when running the nix build. -In multi-user installations of Nix, it's necessary to set the environment variables in the nix-daemon, probably with systemd. +: In multi-user installations of Nix, it's necessary to set the environment variables in the nix-daemon, probably with systemd. :::{.example} ##### configure nix-daemon {#javascript-buildDenoPackage-private-registries-daemon-example} -In NixOS' `configuration.nix`: +In NixOS: ```nix +# configuration.nix { - systemd.services.nix-daemon.environment.NPM_TOKEN = ""; + config, + lib, + pkgs, + ... +}: +{ + systemd.services.nix-daemon.environment.NPM_TOKEN = ""; } ``` @@ -941,12 +954,13 @@ $ sudo systemctl restart nix-daemon ::: -**`denoDepsInjectedEnvVars`**: +*`denoDepsInjectedEnvVars`* (Attrset; optional) -An attribute set with environment variables as key value pairs. Example: `{ "NPM_TOKEN" = ""; }` +: Environment variables as key value pairs. They are forwarded to `deno install`. -They are forwarded to `deno install`. -It can be used to set tokens for private NPM registries (in a `.npmrc` file). +: _Example:_ `{ "NPM_TOKEN" = ""; }` + +: It can be used to set tokens for private NPM registries (in a `.npmrc` file). You could pass these tokens from the Nix CLI with `--arg`, however this can hurt the reproducibility of your builds and such an injected token will also need to be injected in every build that depends on this build. @@ -962,6 +976,12 @@ token will also need to be injected in every build that depends on this build. ::: +::: {.caution} + +Hardcoding a token into your NixOS configuration or some other nix build, will as a consequence write that token into `/nix/store`, which is considered world readable. + +::: + ::: {.note} Neither approach is ideal. For `buildNpmPackage`, there exists a third option called `sourceOverrides`, which allows the user to inject Nix packages into @@ -983,30 +1003,58 @@ or the `name` attribute of the derivation. Related options: -* `hostPlatform`: The [host platform](#ssec-cross-platform-parameters) the binary is built for. Defaults to `builtins.currentSystem`. +*`hostPlatform`* (String; optional) - Supported values: +: The [host platform](#ssec-cross-platform-parameters) the binary is built for. + +: _Default:_ `builtins.currentSystem`. + +: _Supported values:_ - `"x86_64-darwin"` - `"aarch64-darwin"` - `"x86_64-linux"` - `"aarch64-linux"` -* `denoCompileFlags`: Flags passed to `deno compile`. -* `binaryEntrypointPath`: If not `null`, create a binary using the specified path as the entrypoint, -copy it to `$out/bin` in `installPhase`. It's prefixed by `denoWorkspacePath`, if using workspaces. -* `denortPackage`: The package used as the Deno runtime, which is bundled with the JavaScript code to create the binary. -Defaults to `pkgs.denort`. Don't use `pkgs.deno` for this, since that is the full Deno CLI, with all the development tooling. -If you're cross compiling, this needs to be the `denort` of the `hostPlatform`. + +*`denoCompileFlags`* (Array of string; optional) + +: Flags passed to `deno compile`. + +*`binaryEntrypointPath`* (String or null; optional) + +: If not `null`, a binary is created using the specified path as the entry point. +The binary is copied to `$out/bin` in the `installPhase`. + +: _Default:_ `null` + +: It's prefixed by `denoWorkspacePath`. + +*`denortPackage`* (Derivation; optional) + +: The package used as the Deno runtime, which is bundled with the JavaScript code to create the binary. + +: _Default:_ `pkgs.denort` + +: Don't use `pkgs.deno` for this, since that is the full Deno CLI, with all the development tooling. + +: If you're cross compiling, this needs to be the `denort` of the `hostPlatform`. ::: {.note} The binary will be dynamically linked and not executable on NixOS without [nix-ld](https://github.com/nix-community/nix-ld) or [other methods](https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos). ```nix +# configuration.nix +{ + config, + lib, + pkgs, + ... +}: { programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ - glibc - gcc-unwrapped + glibc + gcc-unwrapped ]; } ``` @@ -1025,7 +1073,7 @@ buildDenoPackage { denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; binaryEntrypointPath = "main.ts"; -}; +} ``` ::: @@ -1036,9 +1084,24 @@ Instead of compiling to a binary, `deno task` can be executed inside the build to produce some artifact, which can then be copied out in the `installPhase`. Related options: -* `denoTaskScript`: The task in `deno.json` that's executed with `deno task`. Defaults to `"build"`. -* `denoTaskFlags`: Flags passed to `deno task`. -* `denoTaskPrefix` & `denoTaskSuffix`: Unquoted strings surrounding `deno task`. For example to pipe stdout to a file. + +*`denoTaskScript`* (String; optional) + +: The task in `deno.json` that's executed with `deno task`. + +: _Default:_ `"build"` + +*`denoTaskFlags`* (Array of strings; optional) + +: The flags passed to `deno task`. + +*`denoTaskPrefix`* (String; optional) + +: An unquoted string injected before `deno task`. + +*`denoTaskSuffix`* (String; optional) + +: An unquoted string injected after `deno task` and all its flags. For example to pipe stdout to a file. :::{.example} @@ -1065,7 +1128,7 @@ buildDenoPackage { installPhase = '' cp ./out.txt $out ''; -}; +} ``` ::: @@ -1074,7 +1137,7 @@ buildDenoPackage { Deno's workspaces are supported. -To make them work, the whole project needs to added as source, since the `deno.lock` +To make them work, the whole project needs to be added as source, since the `deno.lock` is always in the root of the project and contains all dependencies. This means a build with only the required dependencies of a workspace is not possible. @@ -1088,7 +1151,10 @@ When [compiling to a binary](#javascript-buildDenoPackage-compile-to-binary), `binaryEntrypointPath` is prefixed by `denoWorkspacePath`. Related options: - * `denoWorkspacePath`: Path to a workspace. + +*`denoWorkspacePath`* (String; optional) + +: The path to a workspace. :::{.example} @@ -1103,7 +1169,10 @@ rec { denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; denoWorkspacePath = "./sub1"; - denoTaskFlags = ["--text" "sub1"]; + denoTaskFlags = [ + "--text" + "sub1" + ]; denoTaskSuffix = ">out.txt"; installPhase = '' cp out.txt $out @@ -1125,9 +1194,19 @@ rec { #### Other Options {#javascript-buildDenoPackage-other-options} - * `denoDir`: Set `DENO_DIR` to this value and use it for all `deno` commands - * `denoFlags`: Flags passed to all `deno` commands. - * `denoPackage`: The Deno CLI used for all `deno` commands inside the build. +*`denoDir`* (String; optional) + +: `DENO_DIR` will be set to this value for all `deno` commands. + +*`denoFlags`* (Array of string; optional) + +: The flags passed to all `deno` commands. + +*`denoPackage`* (Derivation; optional) + +: The Deno CLI used for all `deno` commands inside the build. + +: _Default:_ `pkgs.deno` ## Outside Nixpkgs {#javascript-outside-nixpkgs} From 453f539af41dab3d8094ae7190804aa763bae145 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 16 May 2025 18:31:01 +0200 Subject: [PATCH 17/82] buildDenoPackage: added unit tests for prune-registries.ts --- .../deno/fetch-deno-deps/deno.json | 14 +- .../deno/fetch-deno-deps/deno.lock | 12 + .../fetch-deno-deps/prune-registries.test.ts | 1054 +++++++++++++++++ .../deno/fetch-deno-deps/prune-registries.ts | 126 +- .../build-deno-package/binaries/default.nix | 2 +- 5 files changed, 1151 insertions(+), 57 deletions(-) create mode 100644 pkgs/build-support/deno/fetch-deno-deps/prune-registries.test.ts diff --git a/pkgs/build-support/deno/fetch-deno-deps/deno.json b/pkgs/build-support/deno/fetch-deno-deps/deno.json index 12c616d6daca..967ec0fdc4e0 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/deno.json +++ b/pkgs/build-support/deno/fetch-deno-deps/deno.json @@ -1,8 +1,10 @@ { - "imports": { - "@std/cli": "jsr:@std/cli@1.0.16", - "@std/fs": "jsr:@std/fs@1.0.16", - "@std/path": "jsr:@std/path@1.0.9", - "ini": "npm:ini@5.0.0" - } + "tasks": { "test": "deno test" }, + "imports": { + "@std/assert": "jsr:@std/assert@1.0.13", + "@std/cli": "jsr:@std/cli@1.0.16", + "@std/fs": "jsr:@std/fs@1.0.16", + "@std/path": "jsr:@std/path@1.0.9", + "ini": "npm:ini@5.0.0" + } } diff --git a/pkgs/build-support/deno/fetch-deno-deps/deno.lock b/pkgs/build-support/deno/fetch-deno-deps/deno.lock index 0a3333e5020b..48d7cb9d78e4 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/deno.lock +++ b/pkgs/build-support/deno/fetch-deno-deps/deno.lock @@ -1,13 +1,21 @@ { "version": "4", "specifiers": { + "jsr:@std/assert@1.0.13": "1.0.13", "jsr:@std/cli@1.0.16": "1.0.16", "jsr:@std/fs@1.0.16": "1.0.16", + "jsr:@std/internal@^1.0.6": "1.0.7", "jsr:@std/path@1.0.9": "1.0.9", "jsr:@std/path@^1.0.8": "1.0.9", "npm:ini@5.0.0": "5.0.0" }, "jsr": { + "@std/assert@1.0.13": { + "integrity": "ae0d31e41919b12c656c742b22522c32fb26ed0cba32975cb0de2a273cb68b29", + "dependencies": [ + "jsr:@std/internal" + ] + }, "@std/cli@1.0.16": { "integrity": "02df293099c35b9e97d8ca05f57f54bd1ee08134f25d19a4756b3924695f4b00" }, @@ -17,6 +25,9 @@ "jsr:@std/path@^1.0.8" ] }, + "@std/internal@1.0.7": { + "integrity": "39eeb5265190a7bc5d5591c9ff019490bd1f2c3907c044a11b0d545796158a0f" + }, "@std/path@1.0.9": { "integrity": "260a49f11edd3db93dd38350bf9cd1b4d1366afa98e81b86167b4e3dd750129e" } @@ -28,6 +39,7 @@ }, "workspace": { "dependencies": [ + "jsr:@std/assert@1.0.13", "jsr:@std/cli@1.0.16", "jsr:@std/fs@1.0.16", "jsr:@std/path@1.0.9", diff --git a/pkgs/build-support/deno/fetch-deno-deps/prune-registries.test.ts b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.test.ts new file mode 100644 index 000000000000..42f7edac640b --- /dev/null +++ b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.test.ts @@ -0,0 +1,1054 @@ +import { assertEquals } from "@std/assert"; +import type { + LockJson, + MetaJson, + PackageInfo, + PackagesByRegistry, + PackageSpecifiers, + RegistryJson, +} from "./prune-registries.ts"; +import { + getAllPackageRegistries, + getAllPackagesByPackageRegistry, + getScopedName, + parsePackageSpecifier, + pruneMetaJson, + pruneRegistryJson, +} from "./prune-registries.ts"; + +type Fixture = { + testValue: T; + expectedValue: R; +}; + +type Fixtures = Array>; + +function testFactory( + assertFunction: (actual: R, expected: R, msg?: string) => void, + testFunction: (args: T) => R, + fixtures: Fixtures +): () => void { + return () => { + fixtures.forEach((fixture) => { + assertFunction(testFunction(fixture.testValue), fixture.expectedValue); + }); + }; +} + +Deno.test("parsePackageSpecifier", () => { + type Args = string; + type ReturnValue = PackageInfo; + const fixtures: Array> = [ + { + testValue: "jsr:@std/assert@1.0.13", + expectedValue: { + full: "jsr:@std/assert@1.0.13", + registry: "jsr", + scope: "@std", + name: "assert", + version: "1.0.13", + suffix: undefined, + }, + }, + { + testValue: "npm:ini@5.0.0", + expectedValue: { + full: "npm:ini@5.0.0", + registry: "npm", + scope: undefined, + name: "ini", + version: "5.0.0", + suffix: undefined, + }, + }, + { + testValue: "npm:@amazn/style-dictionary@4.2.4_prettier@3.5.3", + expectedValue: { + full: "npm:@amazn/style-dictionary@4.2.4_prettier@3.5.3", + registry: "npm", + scope: "@amazn", + name: "style-dictionary", + version: "4.2.4", + suffix: "_prettier@3.5.3", + }, + }, + ]; + testFactory(assertEquals, parsePackageSpecifier, fixtures)(); +}); + +Deno.test("getScopedName", () => { + type Args = { name: string; scope?: string }; + type ReturnValue = string; + const fixtures: Array> = [ + { + testValue: { name: "assert", scope: undefined }, + expectedValue: "assert", + }, + { + testValue: { name: "assert", scope: "std" }, + expectedValue: "@std/assert", + }, + { + testValue: { name: "assert", scope: "@std" }, + expectedValue: "@std/assert", + }, + ]; + testFactory( + assertEquals, + (args: Args) => getScopedName(args.name, args.scope), + fixtures + )(); +}); + +Deno.test("getAllPackageRegistries", () => { + type Args = PackageSpecifiers; + type ReturnValue = Set; + const fixtures: Array> = [ + { + testValue: { + "jsr:@std/assert@1.0.13": "1.0.13", + "jsr:@std/cli@1.0.16": "1.0.16", + "jsr:@std/fs@1.0.16": "1.0.16", + "jsr:@std/internal@^1.0.6": "1.0.7", + "jsr:@std/path@1.0.9": "1.0.9", + "jsr:@std/path@^1.0.8": "1.0.9", + "npm:ini@5.0.0": "5.0.0", + }, + expectedValue: new Set(["jsr", "npm"]), + }, + ]; + testFactory(assertEquals, getAllPackageRegistries, fixtures)(); +}); + +Deno.test("getAllPackagesByPackageRegistry", () => { + type Args = { lockJson: LockJson; registries: Set }; + type ReturnValue = PackagesByRegistry; + const fixtures: Array> = [ + { + testValue: { + lockJson: JSON.parse(` +{ + "version": "4", + "specifiers": { + "jsr:@std/assert@1.0.13": "1.0.13", + "jsr:@std/cli@1.0.16": "1.0.16", + "jsr:@std/fs@1.0.16": "1.0.16", + "jsr:@std/internal@^1.0.6": "1.0.7", + "jsr:@std/path@1.0.9": "1.0.9", + "jsr:@std/path@^1.0.8": "1.0.9", + "npm:ini@5.0.0": "5.0.0" + }, + "jsr": { + "@std/assert@1.0.13": { + "integrity": "ae0d31e41919b12c656c742b22522c32fb26ed0cba32975cb0de2a273cb68b29", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/cli@1.0.16": { + "integrity": "02df293099c35b9e97d8ca05f57f54bd1ee08134f25d19a4756b3924695f4b00" + }, + "@std/fs@1.0.16": { + "integrity": "81878f62b6eeda0bf546197fc3daa5327c132fee1273f6113f940784a468b036", + "dependencies": [ + "jsr:@std/path@^1.0.8" + ] + }, + "@std/internal@1.0.7": { + "integrity": "39eeb5265190a7bc5d5591c9ff019490bd1f2c3907c044a11b0d545796158a0f" + }, + "@std/path@1.0.9": { + "integrity": "260a49f11edd3db93dd38350bf9cd1b4d1366afa98e81b86167b4e3dd750129e" + } + }, + "npm": { + "ini@5.0.0": { + "integrity": "sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==" + } + }, + "workspace": { + "dependencies": [ + "jsr:@std/assert@1.0.13", + "jsr:@std/cli@1.0.16", + "jsr:@std/fs@1.0.16", + "jsr:@std/path@1.0.9", + "npm:ini@5.0.0" + ] + } +} +`), + registries: new Set(["npm", "jsr"]), + }, + expectedValue: { + jsr: { + "@std/assert": { + "1.0.13": { + full: "@std/assert@1.0.13", + registry: undefined, + scope: "@std", + name: "assert", + version: "1.0.13", + suffix: undefined, + }, + }, + "@std/cli": { + "1.0.16": { + full: "@std/cli@1.0.16", + registry: undefined, + scope: "@std", + name: "cli", + version: "1.0.16", + suffix: undefined, + }, + }, + "@std/fs": { + "1.0.16": { + full: "@std/fs@1.0.16", + registry: undefined, + scope: "@std", + name: "fs", + version: "1.0.16", + suffix: undefined, + }, + }, + "@std/internal": { + "1.0.7": { + full: "@std/internal@1.0.7", + registry: undefined, + scope: "@std", + name: "internal", + version: "1.0.7", + suffix: undefined, + }, + }, + "@std/path": { + "1.0.9": { + full: "@std/path@1.0.9", + registry: undefined, + scope: "@std", + name: "path", + version: "1.0.9", + suffix: undefined, + }, + }, + }, + npm: { + ini: { + "5.0.0": { + full: "ini@5.0.0", + registry: undefined, + scope: undefined, + name: "ini", + version: "5.0.0", + suffix: undefined, + }, + }, + }, + }, + }, + ]; + testFactory( + assertEquals, + (args: Args) => + getAllPackagesByPackageRegistry(args.lockJson, args.registries), + fixtures + )(); +}); + +Deno.test("pruneMetaJson", () => { + type Args = { + metaJson: MetaJson; + jsrPackages: PackagesByRegistry; + registry: string; + }; + type ReturnValue = MetaJson; + const fixtures: Array> = [ + { + testValue: { + metaJson: { + scope: "std", + name: "cli", + latest: "1.0.17", + versions: { + "0.222.0": {}, + "1.0.16": {}, + "0.218.2": {}, + "0.218.0": {}, + "1.0.10": {}, + "0.224.6": {}, + "1.0.4": {}, + "1.0.8": {}, + "1.0.2": {}, + "0.211.0": {}, + "0.213.0": {}, + "1.0.0-rc.2": {}, + "1.0.3": {}, + "1.0.0-rc.5": {}, + "0.210.0": {}, + "0.209.0": {}, + "0.212.0": {}, + "0.208.0": {}, + "1.0.7": {}, + "1.0.0": {}, + "0.220.1": {}, + "0.224.2": {}, + "1.0.17": {}, + "1.0.1": {}, + "0.221.0": {}, + "0.224.5": {}, + "0.216.0": {}, + "0.207.0": {}, + "0.224.4": {}, + "1.0.0-rc.4": {}, + "0.214.0": {}, + "0.223.0": {}, + "1.0.6": {}, + "0.224.1": {}, + "0.224.0": {}, + "1.0.15": {}, + "1.0.0-rc.3": {}, + "0.224.3": {}, + "1.0.14": {}, + "1.0.9": {}, + "0.222.1": {}, + "1.0.13": {}, + "1.0.0-rc.1": {}, + "0.219.0": {}, + "1.0.5": {}, + "1.0.11": {}, + "0.224.7": {}, + "0.215.0": {}, + "1.0.12": {}, + "0.217.0": {}, + "0.213.1": {}, + "0.219.1": {}, + "0.218.1": {}, + }, + }, + jsrPackages: { + jsr: { + "@luca/cases": { + "1.0.0": { + full: "@luca/cases@1.0.0", + registry: undefined, + scope: "@luca", + name: "cases", + version: "1.0.0", + suffix: undefined, + }, + }, + "@std/cli": { + "1.0.17": { + full: "@std/cli@1.0.17", + registry: undefined, + scope: "@std", + name: "cli", + version: "1.0.17", + suffix: undefined, + }, + }, + }, + }, + registry: "jsr", + }, + expectedValue: { + scope: "std", + name: "cli", + latest: "", + versions: { "1.0.17": {} }, + }, + }, + { + testValue: { + metaJson: { + scope: "luca", + name: "cases", + latest: "1.0.0", + versions: { "1.0.0": {} }, + }, + jsrPackages: { + jsr: { + "@luca/cases": { + "1.0.0": { + full: "@luca/cases@1.0.0", + registry: undefined, + scope: "@luca", + name: "cases", + version: "1.0.0", + suffix: undefined, + }, + }, + "@std/cli": { + "1.0.17": { + full: "@std/cli@1.0.17", + registry: undefined, + scope: "@std", + name: "cli", + version: "1.0.17", + suffix: undefined, + }, + }, + }, + }, + registry: "jsr", + }, + expectedValue: { + scope: "luca", + name: "cases", + latest: "", + versions: { "1.0.0": {} }, + }, + }, + ]; + testFactory( + assertEquals, + (args: Args) => + pruneMetaJson(args.metaJson, args.jsrPackages, args.registry), + fixtures + )(); +}); + +Deno.test("pruneRegistryJson", () => { + type Args = { + registryJson: RegistryJson; + nonJsrPackages: PackagesByRegistry; + registry: string; + }; + type ReturnValue = RegistryJson; + const fixtures: Array> = [ + { + testValue: { + registryJson: { + name: "decamelize", + versions: { + "1.1.0": { + version: "1.1.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-1.1.0.tgz", + shasum: "fe90c002a0acec1435120ce83a6945641018d0c8", + integrity: + "sha512-n7ZK2Y9+g6neJhxuH+BejddHBOZXp9vh5KcKbedUHVjl1SCU3nnO8iWTqNxLi7OCYabTpypddtlylvtecwrW1w==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "node test.js" }, + deprecated: null, + }, + "3.1.1": { + version: "3.1.1", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-3.1.1.tgz", + shasum: "ebf473c6f8607bd70fd9ed6d892da27c5eb8539e", + integrity: + "sha512-pSJTQCBDZxv8siK5p/M42ZdhThhTtx3JU/OKli0yQSKebfM9q92op6zF7krYrWVKRtsE/RwTDiZLliMV3ECkXQ==", + }, + bin: null, + dependencies: { xregexp: "^4.2.4" }, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + "3.1.0": { + version: "3.1.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-3.1.0.tgz", + shasum: "81cd3f2e9911b8874e290d249da2c366453641d4", + integrity: + "sha512-fgHaR077tSDdzV2ExQwtJ8Kx8LYOvnf1cm5JaQ1ESeGgO8CTH7wv3202zJEg1YND0Fx7WQDxeuDPdAPMERXBEg==", + }, + bin: null, + dependencies: { xregexp: "^4.2.4" }, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + "1.1.1": { + version: "1.1.1", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-1.1.1.tgz", + shasum: "8871479a6c0487f5653d48a992f1d0381ca6f031", + integrity: + "sha512-l2nWbx7Uy2MCRQjEJQm6lep1GwWzl1DHr9wTcQzLQYOSes2RwALmR87OG91eNjoMbih7xrYhZX9cPWP3U7Kxmw==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "node test.js" }, + deprecated: null, + }, + "1.2.0": { + version: "1.2.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + shasum: "f6534d15148269b20352e7bee26f501f9a191290", + integrity: + "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava" }, + deprecated: null, + }, + "2.0.0": { + version: "2.0.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", + shasum: "656d7bbc8094c4c788ea53c5840908c9c7d063c7", + integrity: + "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", + }, + bin: null, + dependencies: { xregexp: "4.0.0" }, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava" }, + deprecated: null, + }, + "3.0.0": { + version: "3.0.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-3.0.0.tgz", + shasum: "5efdacb0ff1b6e4031ccd0da71257340c1b846b7", + integrity: + "sha512-NUW7GyGP5Al0a4QIr3qj/FVzPNjpixU/HWPMJ7kuFlMpVnLcNeUrKsvOOMlywL2QPr/JG3am40S5a2G9F0REcw==", + }, + bin: null, + dependencies: { xregexp: "^4.2.4" }, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd-check" }, + deprecated: null, + }, + "5.0.0": { + version: "5.0.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-5.0.0.tgz", + shasum: "88358157b010ef133febfd27c18994bd80c6215b", + integrity: + "sha512-U75DcT5hrio3KNtvdULAWnLiAPbFUC4191ldxMmj4FA/mRuBnmDwU0boNfPyFRhnan+Jm+haLeSn3P0afcBn4w==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + "1.1.2": { + version: "1.1.2", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-1.1.2.tgz", + shasum: "dcc93727be209632e98b02718ef4cb79602322f2", + integrity: + "sha512-TzUj+sMdUozL/R01HUZfQNgHBclsYvlLLDoXpoVT//50AAuGNYj1jayRptx0gBgBWaViSim8YHnx0NgLmdx2KQ==", + }, + bin: null, + dependencies: { "escape-string-regexp": "^1.0.4" }, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava" }, + deprecated: null, + }, + "4.0.0": { + version: "4.0.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + shasum: "aa472d7bf660eb15f3494efd531cab7f2a709837", + integrity: + "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + "5.0.1": { + version: "5.0.1", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-5.0.1.tgz", + shasum: "db11a92e58c741ef339fb0a2868d8a06a9a7b1e9", + integrity: + "sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + "1.0.0": { + version: "1.0.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-1.0.0.tgz", + shasum: "5287122f71691d4505b18ff2258dc400a5b23847", + integrity: + "sha512-6OlbjTSfBWyqM8oFO7TYc6DgCIiT6vgCiZ973GDA98xVf+DOXVZvYLzRyi0HEJy5J31/69lel4AeY78OaasBLQ==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "node test.js" }, + deprecated: null, + }, + "3.2.0": { + version: "3.2.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-3.2.0.tgz", + shasum: "84b8e8f4f8c579f938e35e2cc7024907e0090851", + integrity: + "sha512-4TgkVUsmmu7oCSyGBm5FvfMoACuoh9EOidm7V5/J2X2djAwwt57qb3F2KMP2ITqODTCSwb+YRV+0Zqrv18k/hw==", + }, + bin: null, + dependencies: { xregexp: "^4.2.4" }, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + "6.0.0": { + version: "6.0.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-6.0.0.tgz", + shasum: "8cad4d916fde5c41a264a43d0ecc56fe3d31749e", + integrity: + "sha512-Fv96DCsdOgB6mdGl67MT5JaTNKRzrzill5OH5s8bjYJXVlcXyPYGyPsUkWyGV5p1TXI5esYIYMMeDJL0hEIwaA==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava && tsd" }, + deprecated: null, + }, + }, + "dist-tags": { latest: "6.0.0" }, + }, + nonJsrPackages: { + npm: { + "ansi-regex": { + "3.0.1": { + full: "ansi-regex@3.0.1", + registry: undefined, + scope: undefined, + name: "ansi-regex", + version: "3.0.1", + suffix: undefined, + }, + "5.0.1": { + full: "ansi-regex@5.0.1", + registry: undefined, + scope: undefined, + name: "ansi-regex", + version: "5.0.1", + suffix: undefined, + }, + }, + "ansi-styles": { + "4.3.0": { + full: "ansi-styles@4.3.0", + registry: undefined, + scope: undefined, + name: "ansi-styles", + version: "4.3.0", + suffix: undefined, + }, + }, + camelcase: { + "5.3.1": { + full: "camelcase@5.3.1", + registry: undefined, + scope: undefined, + name: "camelcase", + version: "5.3.1", + suffix: undefined, + }, + }, + cliui: { + "6.0.0": { + full: "cliui@6.0.0", + registry: undefined, + scope: undefined, + name: "cliui", + version: "6.0.0", + suffix: undefined, + }, + }, + "color-convert": { + "2.0.1": { + full: "color-convert@2.0.1", + registry: undefined, + scope: undefined, + name: "color-convert", + version: "2.0.1", + suffix: undefined, + }, + }, + "color-name": { + "1.1.4": { + full: "color-name@1.1.4", + registry: undefined, + scope: undefined, + name: "color-name", + version: "1.1.4", + suffix: undefined, + }, + }, + cowsay: { + "1.6.0": { + full: "cowsay@1.6.0", + registry: undefined, + scope: undefined, + name: "cowsay", + version: "1.6.0", + suffix: undefined, + }, + }, + decamelize: { + "1.2.0": { + full: "decamelize@1.2.0", + registry: undefined, + scope: undefined, + name: "decamelize", + version: "1.2.0", + suffix: undefined, + }, + }, + "emoji-regex": { + "8.0.0": { + full: "emoji-regex@8.0.0", + registry: undefined, + scope: undefined, + name: "emoji-regex", + version: "8.0.0", + suffix: undefined, + }, + }, + "find-up": { + "4.1.0": { + full: "find-up@4.1.0", + registry: undefined, + scope: undefined, + name: "find-up", + version: "4.1.0", + suffix: undefined, + }, + }, + "get-caller-file": { + "2.0.5": { + full: "get-caller-file@2.0.5", + registry: undefined, + scope: undefined, + name: "get-caller-file", + version: "2.0.5", + suffix: undefined, + }, + }, + "get-stdin": { + "8.0.0": { + full: "get-stdin@8.0.0", + registry: undefined, + scope: undefined, + name: "get-stdin", + version: "8.0.0", + suffix: undefined, + }, + }, + "is-fullwidth-code-point": { + "2.0.0": { + full: "is-fullwidth-code-point@2.0.0", + registry: undefined, + scope: undefined, + name: "is-fullwidth-code-point", + version: "2.0.0", + suffix: undefined, + }, + "3.0.0": { + full: "is-fullwidth-code-point@3.0.0", + registry: undefined, + scope: undefined, + name: "is-fullwidth-code-point", + version: "3.0.0", + suffix: undefined, + }, + }, + "locate-path": { + "5.0.0": { + full: "locate-path@5.0.0", + registry: undefined, + scope: undefined, + name: "locate-path", + version: "5.0.0", + suffix: undefined, + }, + }, + "p-limit": { + "2.3.0": { + full: "p-limit@2.3.0", + registry: undefined, + scope: undefined, + name: "p-limit", + version: "2.3.0", + suffix: undefined, + }, + }, + "p-locate": { + "4.1.0": { + full: "p-locate@4.1.0", + registry: undefined, + scope: undefined, + name: "p-locate", + version: "4.1.0", + suffix: undefined, + }, + }, + "p-try": { + "2.2.0": { + full: "p-try@2.2.0", + registry: undefined, + scope: undefined, + name: "p-try", + version: "2.2.0", + suffix: undefined, + }, + }, + "path-exists": { + "4.0.0": { + full: "path-exists@4.0.0", + registry: undefined, + scope: undefined, + name: "path-exists", + version: "4.0.0", + suffix: undefined, + }, + }, + "require-directory": { + "2.1.1": { + full: "require-directory@2.1.1", + registry: undefined, + scope: undefined, + name: "require-directory", + version: "2.1.1", + suffix: undefined, + }, + }, + "require-main-filename": { + "2.0.0": { + full: "require-main-filename@2.0.0", + registry: undefined, + scope: undefined, + name: "require-main-filename", + version: "2.0.0", + suffix: undefined, + }, + }, + "set-blocking": { + "2.0.0": { + full: "set-blocking@2.0.0", + registry: undefined, + scope: undefined, + name: "set-blocking", + version: "2.0.0", + suffix: undefined, + }, + }, + "string-width": { + "2.1.1": { + full: "string-width@2.1.1", + registry: undefined, + scope: undefined, + name: "string-width", + version: "2.1.1", + suffix: undefined, + }, + "4.2.3": { + full: "string-width@4.2.3", + registry: undefined, + scope: undefined, + name: "string-width", + version: "4.2.3", + suffix: undefined, + }, + }, + "strip-ansi": { + "4.0.0": { + full: "strip-ansi@4.0.0", + registry: undefined, + scope: undefined, + name: "strip-ansi", + version: "4.0.0", + suffix: undefined, + }, + "6.0.1": { + full: "strip-ansi@6.0.1", + registry: undefined, + scope: undefined, + name: "strip-ansi", + version: "6.0.1", + suffix: undefined, + }, + }, + "strip-final-newline": { + "2.0.0": { + full: "strip-final-newline@2.0.0", + registry: undefined, + scope: undefined, + name: "strip-final-newline", + version: "2.0.0", + suffix: undefined, + }, + }, + "which-module": { + "2.0.1": { + full: "which-module@2.0.1", + registry: undefined, + scope: undefined, + name: "which-module", + version: "2.0.1", + suffix: undefined, + }, + }, + "wrap-ansi": { + "6.2.0": { + full: "wrap-ansi@6.2.0", + registry: undefined, + scope: undefined, + name: "wrap-ansi", + version: "6.2.0", + suffix: undefined, + }, + }, + y18n: { + "4.0.3": { + full: "y18n@4.0.3", + registry: undefined, + scope: undefined, + name: "y18n", + version: "4.0.3", + suffix: undefined, + }, + }, + "yargs-parser": { + "18.1.3": { + full: "yargs-parser@18.1.3", + registry: undefined, + scope: undefined, + name: "yargs-parser", + version: "18.1.3", + suffix: undefined, + }, + }, + yargs: { + "15.4.1": { + full: "yargs@15.4.1", + registry: undefined, + scope: undefined, + name: "yargs", + version: "15.4.1", + suffix: undefined, + }, + }, + }, + }, + registry: "npm", + }, + expectedValue: { + name: "decamelize", + versions: { + "1.2.0": { + version: "1.2.0", + dist: { + tarball: + "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + shasum: "f6534d15148269b20352e7bee26f501f9a191290", + integrity: + "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + }, + bin: null, + dependencies: {}, + optionalDependencies: {}, + peerDependencies: {}, + peerDependenciesMeta: {}, + os: [], + cpu: [], + scripts: { test: "xo && ava" }, + deprecated: null, + }, + }, + "dist-tags": {}, + }, + }, + ]; + testFactory( + assertEquals, + (args: Args) => + pruneRegistryJson(args.registryJson, args.nonJsrPackages, args.registry), + fixtures + )(); +}); diff --git a/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts index d0c95414d747..02de848e71b0 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts +++ b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts @@ -41,24 +41,24 @@ import { walkSync } from "@std/fs/walk"; * ``` */ -type PackageSpecifiers = { - [packageIdent: `${string}:${string}`]: string; +export type PackageSpecifiers = { + [packageIdent: string]: string; }; -type LockJson = { +export type LockJson = { specifiers: PackageSpecifiers; version: string; workspace: any; [registry: string]: any; }; -type Config = { +export type Config = { lockJson: LockJson; cachePath: string; vendorPath: string; }; -type PackageInfo = { +export type PackageInfo = { full: string; registry: string | undefined; scope: string | undefined; @@ -67,7 +67,7 @@ type PackageInfo = { suffix: string | undefined; }; -type PackagesByRegistry = { +export type PackagesByRegistry = { [registry: string]: { [packageName: string]: { [version: string]: PackageInfo; @@ -75,17 +75,17 @@ type PackagesByRegistry = { }; }; -type PathsByRegistry = { +export type PathsByRegistry = { [packageRegistry: string]: string[]; }; -type RegistryJson = { +export type RegistryJson = { "dist-tags": any; versions: { [version: string]: any }; name: string; }; -type MetaJson = { +export type MetaJson = { scope: string; name: string; latest: string; @@ -94,7 +94,7 @@ type MetaJson = { }; }; -function getConfig(): Config { +export function getConfig(): Config { const flags = parseArgs(Deno.args, { string: ["lock-json", "cache-path", "vendor-path"], }); @@ -123,7 +123,9 @@ function getConfig(): Config { }; } -function getAllPackageRegistries(specifiers: PackageSpecifiers): Set { +export function getAllPackageRegistries( + specifiers: PackageSpecifiers +): Set { return Object.keys(specifiers).reduce((acc: Set, v: string) => { const s = v.split(":"); if (s.length !== 2) { @@ -135,7 +137,7 @@ function getAllPackageRegistries(specifiers: PackageSpecifiers): Set { }, new Set()); } -function parsePackageSpecifier(packageSpecifier: string): PackageInfo { +export function parsePackageSpecifier(packageSpecifier: string): PackageInfo { const match = /^((?.*):)?((?@.*?)\/)?(?.*?)@(?.*?)(?_.*)?$/.exec( packageSpecifier @@ -164,14 +166,14 @@ function parsePackageSpecifier(packageSpecifier: string): PackageInfo { throw "unexpected package specifier format"; } -function getScopedName(name: string, scope?: string): string { +export function getScopedName(name: string, scope?: string): string { if (scope !== undefined) { return `${scope[0] === "@" ? "" : "@"}${scope}/${name}`; } return name; } -function getAllPackagesByPackageRegistry( +export function getAllPackagesByPackageRegistry( lockJson: LockJson, registries: Set ): PackagesByRegistry { @@ -192,7 +194,7 @@ function getAllPackagesByPackageRegistry( return result; } -function findRegistryJsonPaths( +export function findRegistryJsonPaths( cachePath: string, nonJsrPackages: PackagesByRegistry ): PathsByRegistry { @@ -207,7 +209,33 @@ function findRegistryJsonPaths( return result; } -function pruneRegistryJsonFiles( +export function pruneRegistryJson( + registryJson: RegistryJson, + nonJsrPackages: PackagesByRegistry, + registry: string +) { + const scopedName = registryJson.name; + const packageInfoByVersion = nonJsrPackages[registry][scopedName]; + if (!packageInfoByVersion) { + throw `could not find key "${scopedName}" in\n${Object.keys( + nonJsrPackages[registry] + )}`; + } + + const newRegistryJson: RegistryJson = { + ...registryJson, + "dist-tags": {}, + versions: {}, + }; + + for (const version of Object.keys(packageInfoByVersion)) { + newRegistryJson.versions[version] = registryJson.versions[version]; + } + + return newRegistryJson; +} + +export function pruneRegistryJsonFiles( nonJsrPackages: PackagesByRegistry, registryJsonPathsByRegistry: PathsByRegistry ): void { @@ -217,23 +245,11 @@ function pruneRegistryJsonFiles( new TextDecoder("utf-8").decode(Deno.readFileSync(path)) ); - const scopedName = registryJson.name; - const packageInfoByVersion = nonJsrPackages[registry][scopedName]; - if (!packageInfoByVersion) { - throw `could not find key "${scopedName}" in\n${Object.keys( - nonJsrPackages[registry] - )}`; - } - - const newRegistryJson: RegistryJson = { - ...registryJson, - "dist-tags": {}, - versions: {}, - }; - - for (const version of Object.keys(packageInfoByVersion)) { - newRegistryJson.versions[version] = registryJson.versions[version]; - } + const newRegistryJson = pruneRegistryJson( + registryJson, + nonJsrPackages, + registry + ); Deno.writeFileSync( path, @@ -243,7 +259,7 @@ function pruneRegistryJsonFiles( } } -function findMetaJsonPaths( +export function findMetaJsonPaths( vendorPath: string, jsrPackages: PackagesByRegistry ): PathsByRegistry { @@ -258,7 +274,31 @@ function findMetaJsonPaths( return result; } -function pruneMetaJsonFiles( +export function pruneMetaJson( + metaJson: MetaJson, + jsrPackages: PackagesByRegistry, + registry: string +): MetaJson { + const scopedName = getScopedName(metaJson.name, metaJson.scope); + const packageInfoByVersion = jsrPackages[registry][scopedName]; + if (!packageInfoByVersion) { + throw `could not find key "${scopedName}" in\n${Object.keys( + jsrPackages[registry] + )}`; + } + const newMetaJson: MetaJson = { + ...metaJson, + latest: "", + versions: {}, + }; + + for (const version of Object.keys(packageInfoByVersion)) { + newMetaJson.versions[version] = metaJson.versions[version]; + } + return newMetaJson; +} + +export function pruneMetaJsonFiles( jsrPackages: PackagesByRegistry, metaJsonPathsByRegistry: PathsByRegistry ): void { @@ -267,22 +307,8 @@ function pruneMetaJsonFiles( const metaJson: MetaJson = JSON.parse( new TextDecoder("utf-8").decode(Deno.readFileSync(path)) ); - const scopedName = getScopedName(metaJson.name, metaJson.scope); - const packageInfoByVersion = jsrPackages[registry][scopedName]; - if (!packageInfoByVersion) { - throw `could not find key "${scopedName}" in\n${Object.keys( - jsrPackages[registry] - )}`; - } - const newMetaJson: MetaJson = { - ...metaJson, - latest: "", - versions: {}, - }; - for (const version of Object.keys(packageInfoByVersion)) { - newMetaJson.versions[version] = metaJson.versions[version]; - } + const newMetaJson = pruneMetaJson(metaJson, jsrPackages, registry); Deno.writeFileSync( path, diff --git a/pkgs/test/build-deno-package/binaries/default.nix b/pkgs/test/build-deno-package/binaries/default.nix index dd61288bd5be..d0f29f534f8d 100644 --- a/pkgs/test/build-deno-package/binaries/default.nix +++ b/pkgs/test/build-deno-package/binaries/default.nix @@ -3,7 +3,7 @@ linux = buildDenoPackage rec { pname = "test-deno-build-binaries-${targetSystem}"; version = "0.1.0"; - denoDepsHash = "sha256-i+FKvKe1A38XBTk0YSuKshBpPXdAx+adWlXSCcmCJo8="; + denoDepsHash = "sha256-oSCeCTujkOq3dRzQlMaKfcqishgAvI9+LYZx69PR48c="; src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; binaryEntrypointPath = "./main.ts"; targetSystem = "x86_64-linux"; From 2335220e54fa1e5ccfa7d237402ed63d355fcd47 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Tue, 3 Jun 2025 11:38:47 +0200 Subject: [PATCH 18/82] nits --- doc/languages-frameworks/javascript.section.md | 12 ++++++------ .../deno/build-deno-package/default.nix | 4 ++-- .../deno/build-deno-package/hooks/default.nix | 2 +- pkgs/build-support/deno/fetch-deno-deps/default.nix | 2 +- pkgs/by-name/de/denort/package.nix | 2 +- pkgs/test/build-deno-package/binaries/default.nix | 6 +++--- pkgs/test/build-deno-package/workspaces/default.nix | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 2b4df6f68457..3ec282ee737c 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -1066,12 +1066,12 @@ or [other methods](https://unix.stackexchange.com/questions/522822/different-met ##### example binary build {#javascript-buildDenoPackage-compile-to-binary-example} ```nix -{ buildDenoPackage, pkgs }: +{ buildDenoPackage, nix-gitignore }: buildDenoPackage { pname = "myPackage"; version = "0.1.0"; denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + src = nix-gitignore.gitignoreSource [ ] ./.; binaryEntrypointPath = "main.ts"; } ``` @@ -1118,12 +1118,12 @@ Related options: ``` ```nix -{ buildDenoPackage, pkgs }: +{ buildDenoPackage, nix-gitignore }: buildDenoPackage { pname = "myPackage"; version = "0.1.0"; denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; - src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + src = nix-gitignore.gitignoreSource [ ] ./.; denoTaskSuffix = ">out.txt"; installPhase = '' cp ./out.txt $out @@ -1161,13 +1161,13 @@ Related options: ##### example workspaces {#javascript-buildDenoPackage-workspaces-example} ```nix -{ buildDenoPackage, pkgs }: +{ buildDenoPackage, nix-gitignore }: rec { sub1 = buildDenoPackage { pname = "sub1"; version = "0.1.0"; denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + src = nix-gitignore.gitignoreSource [ ] ./.; denoWorkspacePath = "./sub1"; denoTaskFlags = [ "--text" diff --git a/pkgs/build-support/deno/build-deno-package/default.nix b/pkgs/build-support/deno/build-deno-package/default.nix index e64d7080dce4..358034bd735a 100644 --- a/pkgs/build-support/deno/build-deno-package/default.nix +++ b/pkgs/build-support/deno/build-deno-package/default.nix @@ -15,9 +15,9 @@ name ? "${args.pname}-${args.version}", src ? null, # The output hash of the dependencies for this project. - denoDepsHash ? "", + denoDepsHash ? lib.fakeHash, # The host platform, the output binary is compiled for. - hostPlatform ? builtins.currentSystem, + hostPlatform ? stdenvNoCC.hostPlatform.system, # A list of strings, which are names of impure env vars passed to the deps build. # Example: # `[ "NPM_TOKEN" ]` diff --git a/pkgs/build-support/deno/build-deno-package/hooks/default.nix b/pkgs/build-support/deno/build-deno-package/hooks/default.nix index e6044020e2f1..7ece1943a3cf 100644 --- a/pkgs/build-support/deno/build-deno-package/hooks/default.nix +++ b/pkgs/build-support/deno/build-deno-package/hooks/default.nix @@ -12,7 +12,7 @@ denoConfigHook = makeSetupHook { name = "deno-config-hook"; substitutions = { - denortBinary = lib.optionalString (binaryEntrypointPath != null) "${denort}/bin/denort"; + denortBinary = lib.optionalString (binaryEntrypointPath != null) (lib.getExe denort); }; } ./deno-config-hook.sh; diff --git a/pkgs/build-support/deno/fetch-deno-deps/default.nix b/pkgs/build-support/deno/fetch-deno-deps/default.nix index 9d4c43c0bb08..3b73781a43d2 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/default.nix +++ b/pkgs/build-support/deno/fetch-deno-deps/default.nix @@ -11,7 +11,7 @@ { name ? "deno-deps", src, - hash, + hash ? lib.fakeHash, denoPackage ? deno, denoFlags ? [ ], denoInstallFlags ? [ diff --git a/pkgs/by-name/de/denort/package.nix b/pkgs/by-name/de/denort/package.nix index 3df1f602e882..45069e059d11 100644 --- a/pkgs/by-name/de/denort/package.nix +++ b/pkgs/by-name/de/denort/package.nix @@ -12,7 +12,7 @@ deno.overrideAttrs ( meta = with lib; { homepage = "https://deno.land/"; changelog = "https://github.com/denoland/deno/releases/tag/v${final.version}"; - description = "Slim version of the deno runtime, used bundled with deno projects into standalone binaries"; + description = "Slim version of the deno runtime, usually bundled with deno projects into standalone binaries"; license = licenses.mit; mainProgram = "denort"; maintainers = with maintainers; [ diff --git a/pkgs/test/build-deno-package/binaries/default.nix b/pkgs/test/build-deno-package/binaries/default.nix index d0f29f534f8d..3c2f9fbf364d 100644 --- a/pkgs/test/build-deno-package/binaries/default.nix +++ b/pkgs/test/build-deno-package/binaries/default.nix @@ -1,10 +1,10 @@ -{ pkgs, buildDenoPackage }: +{ nix-gitignore, buildDenoPackage }: { linux = buildDenoPackage rec { pname = "test-deno-build-binaries-${targetSystem}"; version = "0.1.0"; denoDepsHash = "sha256-oSCeCTujkOq3dRzQlMaKfcqishgAvI9+LYZx69PR48c="; - src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + src = nix-gitignore.gitignoreSource [ ] ./.; binaryEntrypointPath = "./main.ts"; targetSystem = "x86_64-linux"; }; @@ -17,7 +17,7 @@ # pname = "test-deno-build-binaries-${targetSystem}"; # version = "0.1.0"; # denoDepsHash = ""; - # src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + # src = nix-gitignore.gitignoreSource [ ] ./.; # binaryEntrypointPath = "./main.ts"; # denortPackage = macpkgs.denort; # inherit targetSystem; diff --git a/pkgs/test/build-deno-package/workspaces/default.nix b/pkgs/test/build-deno-package/workspaces/default.nix index 8c621cf09b31..64134c388886 100644 --- a/pkgs/test/build-deno-package/workspaces/default.nix +++ b/pkgs/test/build-deno-package/workspaces/default.nix @@ -1,10 +1,10 @@ -{ pkgs, buildDenoPackage }: +{ nix-gitignore, buildDenoPackage }: rec { sub1 = buildDenoPackage { pname = "test-deno-build-workspaces-sub1"; version = "0.1.0"; denoDepsHash = "sha256-Qvn3g+2NeWpNCfmfqXtPcJU4+LwrOSh1nq51xAbZZhk="; - src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; + src = nix-gitignore.gitignoreSource [ ] ./.; denoWorkspacePath = "./sub1"; denoTaskFlags = [ "--text" From 02b2beed9e15f40fa3d68e1fcf160b7ffedacf7e Mon Sep 17 00:00:00 2001 From: aMOPel Date: Tue, 3 Jun 2025 17:39:55 +0200 Subject: [PATCH 19/82] added test case and improved api --- .../javascript.section.md | 14 +++++++-- .../deno/build-deno-package/default.nix | 14 +++++++-- .../hooks/deno-build-hook.sh | 14 +++++++-- pkgs/test/build-deno-package/default.nix | 1 + .../build-deno-package/external/default.nix | 30 +++++++++++++++++++ .../build-deno-package/workspaces/default.nix | 5 ++-- 6 files changed, 67 insertions(+), 11 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 3ec282ee737c..96865722a9b8 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -908,8 +908,8 @@ Related options: : The Flags passed to `deno install`. -: _Default:_ `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` : _Default:_ `[ "--allow-scripts" "--frozen" "--cached-only" ]` for `buildDenoPackage` +: _Default:_ `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` (`"--cached-only"` is filtered out) #### Private registries {#javascript-buildDenoPackage-private-registries} There are currently 2 options, which enable the use of private registries in a `buildDenoPackage` derivation. @@ -1017,7 +1017,11 @@ Related options: *`denoCompileFlags`* (Array of string; optional) -: Flags passed to `deno compile`. +: Flags passed to `deno compile [denoTaskFlags] ${binaryEntrypointPath} [extraCompileFlags]`. + +*`extraCompileFlags`* (Array of string; optional) + +: Flags passed to `deno compile [denoTaskFlags] ${binaryEntrypointPath} [extraCompileFlags]`. *`binaryEntrypointPath`* (String or null; optional) @@ -1093,7 +1097,11 @@ Related options: *`denoTaskFlags`* (Array of strings; optional) -: The flags passed to `deno task`. +: The flags passed to `deno task [denoTaskFlags] ${denoTaskScript} [extraTaskFlags]`. + +*`extraTaskFlags`* (Array of strings; optional) + +: The flags passed to `deno task [denoTaskFlags] ${denoTaskScript} [extraTaskFlags]`. *`denoTaskPrefix`* (String; optional) diff --git a/pkgs/build-support/deno/build-deno-package/default.nix b/pkgs/build-support/deno/build-deno-package/default.nix index 358034bd735a..d29bc07acd43 100644 --- a/pkgs/build-support/deno/build-deno-package/default.nix +++ b/pkgs/build-support/deno/build-deno-package/default.nix @@ -65,16 +65,20 @@ binaryEntrypointPath ? null, # Flags to pass to all deno commands. denoFlags ? [ ], - # Flags to pass to `deno task ${denoTaskScript}`. + # Flags to pass to `deno task [denoTaskFlags] ${denoTaskScript}`. denoTaskFlags ? [ ], - # Flags to pass to `deno compile`. + # Flags to pass to `deno compile [denoTaskFlags] ${binaryEntrypointPath}`. denoCompileFlags ? [ ], - # Flags to pass to `deno install`. + # Flags to pass to `deno install [denoInstallFlags]`. denoInstallFlags ? [ "--allow-scripts" "--frozen" "--cached-only" ], + # Flags to pass to `deno task [denoTaskFlags] ${denoTaskScript} [extraTaskFlags]`. + extraTaskFlags ? [ ], + # Flags to pass to `deno compile [denoTaskFlags] ${binaryEntrypointPath} [extraCompileFlags]`. + extraCompileFlags ? [ ], nativeBuildInputs ? [ ], dontFixup ? true, # Custom denoConfigHook @@ -98,6 +102,8 @@ let denoTaskFlags_ = builtins.concatStringsSep " " denoTaskFlags; denoCompileFlags_ = builtins.concatStringsSep " " denoCompileFlags; denoInstallFlags_ = builtins.concatStringsSep " " denoInstallFlags; + extraTaskFlags_ = builtins.concatStringsSep " " extraTaskFlags; + extraCompileFlags_ = builtins.concatStringsSep " " extraCompileFlags; args' = builtins.removeAttrs args [ "denoDepsInjectedEnvVars" ]; @@ -133,6 +139,8 @@ stdenvNoCC.mkDerivation ( denoTaskFlags_ denoCompileFlags_ denoInstallFlags_ + extraTaskFlags_ + extraCompileFlags_ binaryEntrypointPath hostPlatform_ denoWorkspacePath diff --git a/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh b/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh index cdb3051eaa6d..66ffb51d3efa 100644 --- a/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh +++ b/pkgs/build-support/deno/build-deno-package/hooks/deno-build-hook.sh @@ -16,12 +16,20 @@ denoBuildHook() { deno compile \ --output "$package_name" \ --target "$hostPlatform_" \ - "${denoWorkspacePath+$denoWorkspacePath/}$binaryEntrypointPath" \ $denoCompileFlags \ - $denoFlags + $denoFlags \ + "${denoWorkspacePath+$denoWorkspacePath/}$binaryEntrypointPath" + $extraCompileFlags \ elif [ -n "${denoTaskScript-}" ]; then - if ! @denoTaskPrefix@ deno task ${denoWorkspacePath+--cwd=$denoWorkspacePath} "$denoTaskScript" $denoTaskFlags $denoFlags @denoTaskSuffix@; then + if ! @denoTaskPrefix@ \ + deno task \ + ${denoWorkspacePath+--cwd=$denoWorkspacePath} \ + $denoTaskFlags \ + $denoFlags \ + "$denoTaskScript" \ + $extraTaskFlags \ + @denoTaskSuffix@; then echo echo 'ERROR: `deno task` failed' echo diff --git a/pkgs/test/build-deno-package/default.nix b/pkgs/test/build-deno-package/default.nix index 3529a2ca15ee..9b57c65a1a35 100644 --- a/pkgs/test/build-deno-package/default.nix +++ b/pkgs/test/build-deno-package/default.nix @@ -12,5 +12,6 @@ inherit (pkgs.callPackage ./external { }) readma-cli-linux fresh-init-cli-linux + invidious-companion-cli-linux ; } diff --git a/pkgs/test/build-deno-package/external/default.nix b/pkgs/test/build-deno-package/external/default.nix index 3a8e123d3f61..4eb0b5d9eec0 100644 --- a/pkgs/test/build-deno-package/external/default.nix +++ b/pkgs/test/build-deno-package/external/default.nix @@ -27,4 +27,34 @@ binaryEntrypointPath = "./src/mod.ts"; targetSystem = "x86_64-linux"; }; + invidious-companion-cli-linux = buildDenoPackage { + pname = "invidious-companion-cli"; + version = ""; + denoDepsHash = "sha256-z78m/Na2jvUARi4cTQvtFnD6iF7YX9Vzh2D6DBSj/HA="; + src = fetchFromGitHub { + owner = "iv-org"; + repo = "invidious-companion"; + rev = "a34c27ff63e51f9e3adc0e8647cd12382f8f1ffe"; + hash = "sha256-/S8F7G8li12k0objsdFuh+mle6p2mk8zNUUCrG9hgns="; + }; + binaryEntrypointPath = "src/main.ts"; + denoCompileFlags = [ + "--include=./src/lib/helpers/youtubePlayerReq.ts" + "--include=./src/lib/helpers/getFetchClient.ts" + "--allow-import=github.com:443,jsr.io:443,cdn.jsdelivr.net:443,esm.sh:443,deno.land:443" + "--allow-net" + "--allow-env" + "--allow-read" + "--allow-sys=hostname" + "--allow-write=/var/tmp/youtubei.js" + ]; + denoInstallFlags = [ + "--allow-scripts" + "--frozen" + "--cached-only" + "--entrypoint" + "src/main.ts" + ]; + targetSystem = "x86_64-linux"; + }; } diff --git a/pkgs/test/build-deno-package/workspaces/default.nix b/pkgs/test/build-deno-package/workspaces/default.nix index 64134c388886..59113e3bba90 100644 --- a/pkgs/test/build-deno-package/workspaces/default.nix +++ b/pkgs/test/build-deno-package/workspaces/default.nix @@ -6,11 +6,12 @@ rec { denoDepsHash = "sha256-Qvn3g+2NeWpNCfmfqXtPcJU4+LwrOSh1nq51xAbZZhk="; src = nix-gitignore.gitignoreSource [ ] ./.; denoWorkspacePath = "./sub1"; - denoTaskFlags = [ + extraTaskFlags = [ "--text" "sub1" ]; denoTaskSuffix = ">out.txt"; + installPhase = '' cp out.txt $out ''; @@ -20,7 +21,7 @@ rec { version = "0.1.0"; inherit (sub1) denoDeps src; denoWorkspacePath = "./sub2"; - denoTaskFlags = [ + extraTaskFlags = [ "--text" "sub2" ]; From 083cd0a8a5448dab2dfe9260f081634d27f662f4 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 5 Jun 2025 13:55:05 +0200 Subject: [PATCH 20/82] bumped deno.lock files to version 5 and added extra test case for binary without npm packages --- .../build-deno-package/binaries/default.nix | 16 +++++-- .../binaries/{ => with-npm}/.gitignore | 0 .../binaries/{ => with-npm}/deno.json | 0 .../binaries/{ => with-npm}/deno.lock | 8 ++-- .../binaries/{ => with-npm}/main.ts | 0 .../binaries/without-npm/.gitignore | 3 ++ .../binaries/without-npm/deno.json | 12 +++++ .../binaries/without-npm/deno.lock | 44 +++++++++++++++++++ .../binaries/without-npm/main.ts | 14 ++++++ pkgs/test/build-deno-package/default.nix | 19 ++------ .../build-deno-package/workspaces/default.nix | 2 +- .../build-deno-package/workspaces/deno.lock | 8 ++-- 12 files changed, 95 insertions(+), 31 deletions(-) rename pkgs/test/build-deno-package/binaries/{ => with-npm}/.gitignore (100%) rename pkgs/test/build-deno-package/binaries/{ => with-npm}/deno.json (100%) rename pkgs/test/build-deno-package/binaries/{ => with-npm}/deno.lock (98%) rename pkgs/test/build-deno-package/binaries/{ => with-npm}/main.ts (100%) create mode 100644 pkgs/test/build-deno-package/binaries/without-npm/.gitignore create mode 100644 pkgs/test/build-deno-package/binaries/without-npm/deno.json create mode 100644 pkgs/test/build-deno-package/binaries/without-npm/deno.lock create mode 100644 pkgs/test/build-deno-package/binaries/without-npm/main.ts diff --git a/pkgs/test/build-deno-package/binaries/default.nix b/pkgs/test/build-deno-package/binaries/default.nix index 3c2f9fbf364d..9b6203392545 100644 --- a/pkgs/test/build-deno-package/binaries/default.nix +++ b/pkgs/test/build-deno-package/binaries/default.nix @@ -1,10 +1,18 @@ { nix-gitignore, buildDenoPackage }: { - linux = buildDenoPackage rec { - pname = "test-deno-build-binaries-${targetSystem}"; + with-npm-linux = buildDenoPackage rec { + pname = "test-deno-build-binaries-with-npm-${targetSystem}"; version = "0.1.0"; - denoDepsHash = "sha256-oSCeCTujkOq3dRzQlMaKfcqishgAvI9+LYZx69PR48c="; - src = nix-gitignore.gitignoreSource [ ] ./.; + denoDepsHash = "sha256-qHnbucFuPassVF/OuL3/FKbgehXWEQ/WDbw5icxFUzI="; + src = nix-gitignore.gitignoreSource [ ] ./with-npm; + binaryEntrypointPath = "./main.ts"; + targetSystem = "x86_64-linux"; + }; + without-npm-linux = buildDenoPackage rec { + pname = "test-deno-build-binaries-without-npm-${targetSystem}"; + version = "0.1.0"; + denoDepsHash = "sha256-keshKcgawVcuSGNYAIepUrRl7iqpp0ExRJag4aiV18c="; + src = nix-gitignore.gitignoreSource [ ] ./without-npm; binaryEntrypointPath = "./main.ts"; targetSystem = "x86_64-linux"; }; diff --git a/pkgs/test/build-deno-package/binaries/.gitignore b/pkgs/test/build-deno-package/binaries/with-npm/.gitignore similarity index 100% rename from pkgs/test/build-deno-package/binaries/.gitignore rename to pkgs/test/build-deno-package/binaries/with-npm/.gitignore diff --git a/pkgs/test/build-deno-package/binaries/deno.json b/pkgs/test/build-deno-package/binaries/with-npm/deno.json similarity index 100% rename from pkgs/test/build-deno-package/binaries/deno.json rename to pkgs/test/build-deno-package/binaries/with-npm/deno.json diff --git a/pkgs/test/build-deno-package/binaries/deno.lock b/pkgs/test/build-deno-package/binaries/with-npm/deno.lock similarity index 98% rename from pkgs/test/build-deno-package/binaries/deno.lock rename to pkgs/test/build-deno-package/binaries/with-npm/deno.lock index 8b78a2e14575..56656abe3767 100644 --- a/pkgs/test/build-deno-package/binaries/deno.lock +++ b/pkgs/test/build-deno-package/binaries/with-npm/deno.lock @@ -1,5 +1,5 @@ { - "version": "4", + "version": "5", "specifiers": { "jsr:@luca/cases@1.0.0": "1.0.0", "jsr:@std/cli@1.0.17": "1.0.17", @@ -53,7 +53,8 @@ "string-width@2.1.1", "strip-final-newline", "yargs" - ] + ], + "bin": true }, "decamelize@1.2.0": { "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" @@ -181,9 +182,6 @@ ] } }, - "redirects": { - "https://deno.land/x/case/mod.ts": "https://deno.land/x/case@2.2.0/mod.ts" - }, "remote": { "https://deno.land/x/case@2.2.0/camelCase.ts": "b9a4cf361a7c9740ecb75e00b5e2c006bd4e5d40e442d26c5f2760286fa66796", "https://deno.land/x/case@2.2.0/constantCase.ts": "c698fc32f00cd267c1684b1d413d784260d7e7798f2bf506803e418497d839b5", diff --git a/pkgs/test/build-deno-package/binaries/main.ts b/pkgs/test/build-deno-package/binaries/with-npm/main.ts similarity index 100% rename from pkgs/test/build-deno-package/binaries/main.ts rename to pkgs/test/build-deno-package/binaries/with-npm/main.ts diff --git a/pkgs/test/build-deno-package/binaries/without-npm/.gitignore b/pkgs/test/build-deno-package/binaries/without-npm/.gitignore new file mode 100644 index 000000000000..cb92b2a7589f --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/without-npm/.gitignore @@ -0,0 +1,3 @@ +.deno/ +node_modules/ +vendor/ diff --git a/pkgs/test/build-deno-package/binaries/without-npm/deno.json b/pkgs/test/build-deno-package/binaries/without-npm/deno.json new file mode 100644 index 000000000000..c9a829c9c1ab --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/without-npm/deno.json @@ -0,0 +1,12 @@ +{ + "name": "binary build", + "tasks": { + "build": "deno run --allow-all main.ts" + }, + "imports": { + "@luca/cases": "jsr:@luca/cases@1.0.0", + "@std/cli": "jsr:@std/cli@1.0.17", + "cases": "https://deno.land/x/case@2.2.0/mod.ts" + }, + "vendor": true +} diff --git a/pkgs/test/build-deno-package/binaries/without-npm/deno.lock b/pkgs/test/build-deno-package/binaries/without-npm/deno.lock new file mode 100644 index 000000000000..3f40f2593aa5 --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/without-npm/deno.lock @@ -0,0 +1,44 @@ +{ + "version": "5", + "specifiers": { + "jsr:@luca/cases@1.0.0": "1.0.0", + "jsr:@std/cli@1.0.17": "1.0.17" + }, + "jsr": { + "@luca/cases@1.0.0": { + "integrity": "b5f9471f1830595e63a2b7d62821ac822a19e16899e6584799be63f17a1fbc30" + }, + "@std/cli@1.0.17": { + "integrity": "e15b9abe629e17be90cc6216327f03a29eae613365f1353837fa749aad29ce7b" + } + }, + "remote": { + "https://deno.land/x/case@2.2.0/camelCase.ts": "b9a4cf361a7c9740ecb75e00b5e2c006bd4e5d40e442d26c5f2760286fa66796", + "https://deno.land/x/case@2.2.0/constantCase.ts": "c698fc32f00cd267c1684b1d413d784260d7e7798f2bf506803e418497d839b5", + "https://deno.land/x/case@2.2.0/dotCase.ts": "03ae55d5635e6a4ca894a003d9297cd9cd283af2e7d761dd3de13663849a9423", + "https://deno.land/x/case@2.2.0/headerCase.ts": "3f6c8ab2ab30a88147326bce28a00d1189ec98ab61c83ab72ce79e852afddc4a", + "https://deno.land/x/case@2.2.0/lowerCase.ts": "d75eb55cadfa589f9f2a973924a8a209054477d9574da669410f4d817ab25b41", + "https://deno.land/x/case@2.2.0/lowerFirstCase.ts": "b001efbf2d715b53d066b22cdbf8eda7f99aa7108e3d12fb02f80d499bae93d9", + "https://deno.land/x/case@2.2.0/mod.ts": "28b0b1329c7b18730799ac05627a433d9547c04b9bfb429116247c60edecd97b", + "https://deno.land/x/case@2.2.0/normalCase.ts": "085c8b6f9d69283c8b86f2e504d43278c2be8b7e56a3ed8d4a5f395e398bdc29", + "https://deno.land/x/case@2.2.0/paramCase.ts": "a234c9c17dfbaddee647b6571c2c90e8f6530123fed26c4546f4063d67c1609f", + "https://deno.land/x/case@2.2.0/pascalCase.ts": "4b3ef0a68173871a821d306d4067e8f72d42aeeef1eea6aeab30af6bfa3d7427", + "https://deno.land/x/case@2.2.0/pathCase.ts": "330a34b4df365b0291d8e36158235340131730aae6f6add66962ed2d0fbead4a", + "https://deno.land/x/case@2.2.0/sentenceCase.ts": "b312cef147a13b58ffdf3c36bf55b33aa8322c91f4aa9b32318f3911bb92327f", + "https://deno.land/x/case@2.2.0/snakeCase.ts": "e5ac1e08532ca397aa3150a0a3255d59f63a186d934e5094a8ffd24cbca7f955", + "https://deno.land/x/case@2.2.0/swapCase.ts": "bb03742fcf613f733890680ceca1b39b65ed290f36a317fcd47edd517c4e0e1e", + "https://deno.land/x/case@2.2.0/titleCase.ts": "c287131ea2c955e67cdd5cf604de96d31a8e2813305759922b9ed27e3be354e7", + "https://deno.land/x/case@2.2.0/types.ts": "8e2bd6edaa27c0d1972c0d5b76698564740f37b4d3787d58d1fb5f48de611e61", + "https://deno.land/x/case@2.2.0/upperCase.ts": "6cca267bb04d098bf4abf21e42e60c3e68ede89b12e525643c6b6eff3e10de34", + "https://deno.land/x/case@2.2.0/upperFirstCase.ts": "b964c2d8d3a85c78cd35f609135cbde99d84b9522a21470336b5af80a37facbd", + "https://deno.land/x/case@2.2.0/vendor/camelCaseRegexp.ts": "7d9ff02aad4ab6429eeab7c7353f7bcdd6cc5909a8bd3dda97918c8bbb7621ae", + "https://deno.land/x/case@2.2.0/vendor/camelCaseUpperRegexp.ts": "292de54a698370f90adcdf95727993d09888b7f33d17f72f8e54ba75f7791787", + "https://deno.land/x/case@2.2.0/vendor/nonWordRegexp.ts": "c1a052629a694144b48c66b0175a22a83f4d61cb40f4e45293fc5d6b123f927e" + }, + "workspace": { + "dependencies": [ + "jsr:@luca/cases@1.0.0", + "jsr:@std/cli@1.0.17" + ] + } +} diff --git a/pkgs/test/build-deno-package/binaries/without-npm/main.ts b/pkgs/test/build-deno-package/binaries/without-npm/main.ts new file mode 100644 index 000000000000..2bfff532685c --- /dev/null +++ b/pkgs/test/build-deno-package/binaries/without-npm/main.ts @@ -0,0 +1,14 @@ +import { camelCase } from "@luca/cases"; +import { pascalCase } from "cases"; +import { parseArgs } from "@std/cli"; + +const flags = parseArgs(Deno.args, { + string: ["text"], +}); + +if (!flags.text) { + throw "--text required but not specified"; +} + +console.log(camelCase(flags.text)); +console.log(pascalCase(flags.text)); diff --git a/pkgs/test/build-deno-package/default.nix b/pkgs/test/build-deno-package/default.nix index 9b57c65a1a35..dd72e45292ce 100644 --- a/pkgs/test/build-deno-package/default.nix +++ b/pkgs/test/build-deno-package/default.nix @@ -1,17 +1,4 @@ { pkgs }: -{ - inherit (pkgs.callPackage ./workspaces { }) - sub1 - sub2 - sub1Binary - ; - inherit (pkgs.callPackage ./binaries { }) - linux - # mac - ; - inherit (pkgs.callPackage ./external { }) - readma-cli-linux - fresh-init-cli-linux - invidious-companion-cli-linux - ; -} +(pkgs.callPackage ./workspaces { }) +// (pkgs.callPackage ./binaries { }) +// (pkgs.callPackage ./external { }) diff --git a/pkgs/test/build-deno-package/workspaces/default.nix b/pkgs/test/build-deno-package/workspaces/default.nix index 59113e3bba90..b0ad2a9fe6a6 100644 --- a/pkgs/test/build-deno-package/workspaces/default.nix +++ b/pkgs/test/build-deno-package/workspaces/default.nix @@ -3,7 +3,7 @@ rec { sub1 = buildDenoPackage { pname = "test-deno-build-workspaces-sub1"; version = "0.1.0"; - denoDepsHash = "sha256-Qvn3g+2NeWpNCfmfqXtPcJU4+LwrOSh1nq51xAbZZhk="; + denoDepsHash = "sha256-71Gz9ALWG0VKedz3mx7QORpJnY5tzPeHDUrltCWwASE="; src = nix-gitignore.gitignoreSource [ ] ./.; denoWorkspacePath = "./sub1"; extraTaskFlags = [ diff --git a/pkgs/test/build-deno-package/workspaces/deno.lock b/pkgs/test/build-deno-package/workspaces/deno.lock index 5bebad8a64ef..e9007eb56670 100644 --- a/pkgs/test/build-deno-package/workspaces/deno.lock +++ b/pkgs/test/build-deno-package/workspaces/deno.lock @@ -1,5 +1,5 @@ { - "version": "4", + "version": "5", "specifiers": { "jsr:@luca/cases@1.0.0": "1.0.0", "jsr:@std/cli@1.0.17": "1.0.17", @@ -53,7 +53,8 @@ "string-width@2.1.1", "strip-final-newline", "yargs" - ] + ], + "bin": true }, "decamelize@1.2.0": { "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" @@ -181,9 +182,6 @@ ] } }, - "redirects": { - "https://deno.land/x/case/mod.ts": "https://deno.land/x/case@2.2.0/mod.ts" - }, "remote": { "https://deno.land/x/case@2.2.0/camelCase.ts": "b9a4cf361a7c9740ecb75e00b5e2c006bd4e5d40e442d26c5f2760286fa66796", "https://deno.land/x/case@2.2.0/constantCase.ts": "c698fc32f00cd267c1684b1d413d784260d7e7798f2bf506803e418497d839b5", From 9dae27044994944e4c343f4c77a3828fba25fa25 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 5 Jun 2025 13:56:08 +0200 Subject: [PATCH 21/82] minor fixes --- doc/languages-frameworks/javascript.section.md | 5 +++++ .../deno/fetch-deno-deps/default.nix | 15 +++++++++------ pkgs/test/build-deno-package/shell.nix | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index 96865722a9b8..a925546d3944 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -1001,6 +1001,11 @@ It's possible to compile a Deno project to a single binary using `deno compile`. The binary will be named like the `.name` property in `deno.json`, if available, or the `name` attribute of the derivation. +:::{.caution} +When using packages with a `npm:` specifier, the resulting binary will not be reproducible. +See [this issue](https://github.com/denoland/deno/issues/29619) for more information. +::: + Related options: *`hostPlatform`* (String; optional) diff --git a/pkgs/build-support/deno/fetch-deno-deps/default.nix b/pkgs/build-support/deno/fetch-deno-deps/default.nix index 3b73781a43d2..61cde63c3c20 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/default.nix +++ b/pkgs/build-support/deno/fetch-deno-deps/default.nix @@ -117,12 +117,15 @@ # There are various small databases used by deno for caching that # we can simply delete. - find -L ./node_modules -name '*cache_v2-shm' -type f | xargs rm -f - find -L ./node_modules -name '*cache_v2-wal' -type f | xargs rm -f - find -L ./node_modules -name 'dep_analysis_cache_v2' -type f | xargs rm -f - find -L ./node_modules -name 'node_analysis_cache_v2' -type f | xargs rm -f - find -L ./node_modules -name v8_code_cache_v2 -type f | xargs rm -f - rm -f ./node_modules/.deno/.deno.lock.poll + if [[ -d "./node_modules" ]]; then + find -L ./node_modules -name '*cache_v2-shm' -type f | xargs rm -f + find -L ./node_modules -name '*cache_v2-wal' -type f | xargs rm -f + find -L ./node_modules -name 'dep_analysis_cache_v2' -type f | xargs rm -f + find -L ./node_modules -name 'node_analysis_cache_v2' -type f | xargs rm -f + find -L ./node_modules -name v8_code_cache_v2 -type f | xargs rm -f + rm -f ./node_modules/.deno/.deno.lock.poll + fi + rm -f "$DENO_DIR"/dep_analysis_cache_v2-shm rm -f "$DENO_DIR"/dep_analysis_cache_v2-wal rm -f "$DENO_DIR"/dep_analysis_cache_v2 diff --git a/pkgs/test/build-deno-package/shell.nix b/pkgs/test/build-deno-package/shell.nix index c04bf6d5da2d..4f34fa2db640 100644 --- a/pkgs/test/build-deno-package/shell.nix +++ b/pkgs/test/build-deno-package/shell.nix @@ -1,5 +1,5 @@ let - pkgs = import { }; + pkgs = import ../../../default.nix { }; in pkgs.mkShell { buildInputs = [ pkgs.deno ]; From 7a2ffb98dea497b588d468b78640c2e5bb41aaac Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 5 Jun 2025 14:41:14 +0200 Subject: [PATCH 22/82] fix for fresh cli build test --- pkgs/build-support/deno/fetch-deno-deps/default.nix | 4 ++++ pkgs/test/build-deno-package/external/default.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/deno/fetch-deno-deps/default.nix b/pkgs/build-support/deno/fetch-deno-deps/default.nix index 61cde63c3c20..ccf5fdbb1dc0 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/default.nix +++ b/pkgs/build-support/deno/fetch-deno-deps/default.nix @@ -124,6 +124,10 @@ find -L ./node_modules -name 'node_analysis_cache_v2' -type f | xargs rm -f find -L ./node_modules -name v8_code_cache_v2 -type f | xargs rm -f rm -f ./node_modules/.deno/.deno.lock.poll + + # sometimes a .deno dir is slipped into a node_modules package + # it's unclear why. but it can just be deleted + rm -rf ./node_modules/*/.deno/ fi rm -f "$DENO_DIR"/dep_analysis_cache_v2-shm diff --git a/pkgs/test/build-deno-package/external/default.nix b/pkgs/test/build-deno-package/external/default.nix index 4eb0b5d9eec0..815912799a86 100644 --- a/pkgs/test/build-deno-package/external/default.nix +++ b/pkgs/test/build-deno-package/external/default.nix @@ -16,7 +16,7 @@ fresh-init-cli-linux = buildDenoPackage { pname = "fresh-init-cli"; version = ""; - denoDepsHash = "sha256-ycSMUyY7xj+o9gIVwUWbcoN+5Gf27P2x0dFUmtWGGlQ="; + denoDepsHash = "sha256-g+/W0d3PG5QJlxyhKfSUXpnk4qcrew5BwZMvRvJGDzM="; src = fetchFromGitHub { owner = "denoland"; repo = "fresh"; From 9db1e30da8c4af649f23ceb1f40a59109d82575b Mon Sep 17 00:00:00 2001 From: aMOPel Date: Thu, 5 Jun 2025 14:56:55 +0200 Subject: [PATCH 23/82] fix for the readme cli build test --- .../javascript.section.md | 28 +++++++++++++++++++ .../build-deno-package/external/default.nix | 6 +++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index a925546d3944..d3458f85b435 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -911,6 +911,34 @@ Related options: : _Default:_ `[ "--allow-scripts" "--frozen" "--cached-only" ]` for `buildDenoPackage` : _Default:_ `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` (`"--cached-only"` is filtered out) +::: {.tip} +If you receive and error like this: + +``` +error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. +``` + +This can happen due to the `deno install` command deducing different packages, than what the actual package needs. + +To fix this, add the entrypoint to the install flags: + +```nix +{ buildDenoPackage, nix-gitignore }: +buildDenoPackage { + pname = "myPackage"; + version = "0.1.0"; + denoDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + src = nix-gitignore.gitignoreSource [ ] ./.; + binaryEntrypointPath = "main.ts"; + denoInstallFlags = [ + "--entrypoint" + "" + ]; +} +``` + +::: + #### Private registries {#javascript-buildDenoPackage-private-registries} There are currently 2 options, which enable the use of private registries in a `buildDenoPackage` derivation. diff --git a/pkgs/test/build-deno-package/external/default.nix b/pkgs/test/build-deno-package/external/default.nix index 815912799a86..975da1de869d 100644 --- a/pkgs/test/build-deno-package/external/default.nix +++ b/pkgs/test/build-deno-package/external/default.nix @@ -3,13 +3,17 @@ readma-cli-linux = buildDenoPackage rec { pname = "readma-cli"; version = "2.11.0"; - denoDepsHash = "sha256-uh+yaT8oPMD0FRENH4LaoCsvbWmQ0j+xPbAL3e4Mfws="; + denoDepsHash = "sha256-xh+kP3yZvqzVXqypS3YFsIBmU/bp4YiNxvpK3/KlxAA="; src = fetchFromGitHub { owner = "elcoosp"; repo = "readma"; rev = "${version}"; hash = "sha256-FVQTn+r7Ztj02vNvqFZIRIsokWeo1tPfFYffK2tvxjA="; }; + denoInstallFlags = [ + "--entrypoint" + "./cli/mod.ts" + ]; binaryEntrypointPath = "./cli/mod.ts"; targetSystem = "x86_64-linux"; }; From 32a9eaae701b6cbe7a29cfb9f8b9d950c6feb0dd Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 6 Jun 2025 07:51:39 +0200 Subject: [PATCH 24/82] doc: added more info and fixed a bug --- .../javascript.section.md | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md index d3458f85b435..91d2ee0d551a 100644 --- a/doc/languages-frameworks/javascript.section.md +++ b/doc/languages-frameworks/javascript.section.md @@ -912,13 +912,33 @@ Related options: : _Default:_ `[ "--allow-scripts" "--frozen" ]` for `buildDenoDeps` (`"--cached-only"` is filtered out) ::: {.tip} -If you receive and error like this: +If you receive errors like these: ``` error: The lockfile is out of date. Run `deno install --frozen=false`, or rerun with `--frozen=false` to update it. ``` -This can happen due to the `deno install` command deducing different packages, than what the actual package needs. +or + +``` +error: Import '' failed. + 0: error sending request for url (): client error (Connect): dns error: failed to lookup address information: Temporary failure in name resolution: failed to lookup address information:Temporary failure in name resolution + 1: client error (Connect) + 2: dns error: failed to lookup address information: Temporary failure in name resolution + 3: failed to lookup address information: Temporary failure in name resolution + at file:///build/source/src/lib/helpers/verifyRequest.ts:2:21 +build for failed in buildPhase with exit code 1 +``` + +or + +``` +error: Specifier not found in cache: "", --cached-only is specified. + +ERROR: deno failed to install dependencies +``` + +This can happen due to the `deno install` command deducing different packages than what the actual package needs. To fix this, add the entrypoint to the install flags: @@ -931,6 +951,9 @@ buildDenoPackage { src = nix-gitignore.gitignoreSource [ ] ./.; binaryEntrypointPath = "main.ts"; denoInstallFlags = [ + "--allow-scripts" + "--frozen" + "--cached-only" "--entrypoint" "" ]; From d5a6c08a53d8c9c9f912efce4f8ab42e63bbb96a Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 6 Jun 2025 09:02:09 +0200 Subject: [PATCH 25/82] fix: prune another non reproducible --- pkgs/build-support/deno/fetch-deno-deps/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/deno/fetch-deno-deps/default.nix b/pkgs/build-support/deno/fetch-deno-deps/default.nix index ccf5fdbb1dc0..d0afad44da86 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/default.nix +++ b/pkgs/build-support/deno/fetch-deno-deps/default.nix @@ -127,7 +127,7 @@ # sometimes a .deno dir is slipped into a node_modules package # it's unclear why. but it can just be deleted - rm -rf ./node_modules/*/.deno/ + find -L ./node_modules/* -name ".deno" -type d | xargs rm -rf fi rm -f "$DENO_DIR"/dep_analysis_cache_v2-shm From 0a4b629ce671b8464b209cc74dbf48cfe918f524 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 6 Jun 2025 09:02:50 +0200 Subject: [PATCH 26/82] fix: prune etags in registry.json (since deno.lock v5?) --- pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts index 02de848e71b0..0a8b12d0a4a9 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts +++ b/pkgs/build-support/deno/fetch-deno-deps/prune-registries.ts @@ -81,6 +81,7 @@ export type PathsByRegistry = { export type RegistryJson = { "dist-tags": any; + "_deno.etag": string; versions: { [version: string]: any }; name: string; }; @@ -224,6 +225,7 @@ export function pruneRegistryJson( const newRegistryJson: RegistryJson = { ...registryJson, + "_deno.etag": "", "dist-tags": {}, versions: {}, }; From 1f70ca0adccef28d0e97c879b765a862671db5bb Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 6 Jun 2025 09:03:54 +0200 Subject: [PATCH 27/82] fix: test hashes after fixes --- pkgs/test/build-deno-package/binaries/default.nix | 2 +- pkgs/test/build-deno-package/external/default.nix | 9 ++++++--- pkgs/test/build-deno-package/workspaces/default.nix | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/test/build-deno-package/binaries/default.nix b/pkgs/test/build-deno-package/binaries/default.nix index 9b6203392545..349bf1263dec 100644 --- a/pkgs/test/build-deno-package/binaries/default.nix +++ b/pkgs/test/build-deno-package/binaries/default.nix @@ -3,7 +3,7 @@ with-npm-linux = buildDenoPackage rec { pname = "test-deno-build-binaries-with-npm-${targetSystem}"; version = "0.1.0"; - denoDepsHash = "sha256-qHnbucFuPassVF/OuL3/FKbgehXWEQ/WDbw5icxFUzI="; + denoDepsHash = "sha256-k2js/8XsxGVu83rGMJed457orraue8WUZF+JUMMfhVQ="; src = nix-gitignore.gitignoreSource [ ] ./with-npm; binaryEntrypointPath = "./main.ts"; targetSystem = "x86_64-linux"; diff --git a/pkgs/test/build-deno-package/external/default.nix b/pkgs/test/build-deno-package/external/default.nix index 975da1de869d..b8691599e784 100644 --- a/pkgs/test/build-deno-package/external/default.nix +++ b/pkgs/test/build-deno-package/external/default.nix @@ -3,7 +3,7 @@ readma-cli-linux = buildDenoPackage rec { pname = "readma-cli"; version = "2.11.0"; - denoDepsHash = "sha256-xh+kP3yZvqzVXqypS3YFsIBmU/bp4YiNxvpK3/KlxAA="; + denoDepsHash = "sha256-ixet3k6OEWfxVnN/V7vk4qDvoXjA+6bU/JjXk76aThE="; src = fetchFromGitHub { owner = "elcoosp"; repo = "readma"; @@ -11,6 +11,9 @@ hash = "sha256-FVQTn+r7Ztj02vNvqFZIRIsokWeo1tPfFYffK2tvxjA="; }; denoInstallFlags = [ + "--allow-scripts" + "--frozen" + "--cached-only" "--entrypoint" "./cli/mod.ts" ]; @@ -20,7 +23,7 @@ fresh-init-cli-linux = buildDenoPackage { pname = "fresh-init-cli"; version = ""; - denoDepsHash = "sha256-g+/W0d3PG5QJlxyhKfSUXpnk4qcrew5BwZMvRvJGDzM="; + denoDepsHash = "sha256-WlMv431qTt3gw0w/V7lG8LnLkEt8VW1fNpyclzBwMcw="; src = fetchFromGitHub { owner = "denoland"; repo = "fresh"; @@ -34,7 +37,7 @@ invidious-companion-cli-linux = buildDenoPackage { pname = "invidious-companion-cli"; version = ""; - denoDepsHash = "sha256-z78m/Na2jvUARi4cTQvtFnD6iF7YX9Vzh2D6DBSj/HA="; + denoDepsHash = "sha256-sPcvVaVb4VsLI87kiYe3Z3eoXL1uDKwTQMck91cXVnM="; src = fetchFromGitHub { owner = "iv-org"; repo = "invidious-companion"; diff --git a/pkgs/test/build-deno-package/workspaces/default.nix b/pkgs/test/build-deno-package/workspaces/default.nix index b0ad2a9fe6a6..01fe1067ae7f 100644 --- a/pkgs/test/build-deno-package/workspaces/default.nix +++ b/pkgs/test/build-deno-package/workspaces/default.nix @@ -3,7 +3,7 @@ rec { sub1 = buildDenoPackage { pname = "test-deno-build-workspaces-sub1"; version = "0.1.0"; - denoDepsHash = "sha256-71Gz9ALWG0VKedz3mx7QORpJnY5tzPeHDUrltCWwASE="; + denoDepsHash = "sha256-imraVvtIJqi31aaWv7U1ODVRmOuou1ZR++z7QqnTPr0="; src = nix-gitignore.gitignoreSource [ ] ./.; denoWorkspacePath = "./sub1"; extraTaskFlags = [ From 9d785861a7da681330159eda7296b252af3eb5e3 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 6 Jun 2025 09:04:18 +0200 Subject: [PATCH 28/82] fix: cleanup deno.lock of pruneRegistries script --- .../deno/build-deno-package/default.nix | 2 -- .../deno/fetch-deno-deps/deno.json | 4 +--- .../deno/fetch-deno-deps/deno.lock | 18 +++++++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/build-support/deno/build-deno-package/default.nix b/pkgs/build-support/deno/build-deno-package/default.nix index d29bc07acd43..4059843ac421 100644 --- a/pkgs/build-support/deno/build-deno-package/default.nix +++ b/pkgs/build-support/deno/build-deno-package/default.nix @@ -8,7 +8,6 @@ jq, fetchDenoDeps, buildPackages, - breakpointHook, lib, }: { @@ -156,7 +155,6 @@ stdenvNoCC.mkDerivation ( diffutils zip jq - breakpointHook ]; DENO_DIR = denoDir; diff --git a/pkgs/build-support/deno/fetch-deno-deps/deno.json b/pkgs/build-support/deno/fetch-deno-deps/deno.json index 967ec0fdc4e0..b658546e4b31 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/deno.json +++ b/pkgs/build-support/deno/fetch-deno-deps/deno.json @@ -3,8 +3,6 @@ "imports": { "@std/assert": "jsr:@std/assert@1.0.13", "@std/cli": "jsr:@std/cli@1.0.16", - "@std/fs": "jsr:@std/fs@1.0.16", - "@std/path": "jsr:@std/path@1.0.9", - "ini": "npm:ini@5.0.0" + "@std/fs": "jsr:@std/fs@1.0.16" } } diff --git a/pkgs/build-support/deno/fetch-deno-deps/deno.lock b/pkgs/build-support/deno/fetch-deno-deps/deno.lock index 48d7cb9d78e4..7791e3142212 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/deno.lock +++ b/pkgs/build-support/deno/fetch-deno-deps/deno.lock @@ -1,5 +1,5 @@ { - "version": "4", + "version": "5", "specifiers": { "jsr:@std/assert@1.0.13": "1.0.13", "jsr:@std/cli@1.0.16": "1.0.16", @@ -7,7 +7,7 @@ "jsr:@std/internal@^1.0.6": "1.0.7", "jsr:@std/path@1.0.9": "1.0.9", "jsr:@std/path@^1.0.8": "1.0.9", - "npm:ini@5.0.0": "5.0.0" + "npm:@types/node@*": "22.15.15" }, "jsr": { "@std/assert@1.0.13": { @@ -33,17 +33,21 @@ } }, "npm": { - "ini@5.0.0": { - "integrity": "sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==" + "@types/node@22.15.15": { + "integrity": "sha512-R5muMcZob3/Jjchn5LcO8jdKwSCbzqmPB6ruBxMcf9kbxtniZHP327s6C37iOfuw8mbKK3cAQa7sEl7afLrQ8A==", + "dependencies": [ + "undici-types" + ] + }, + "undici-types@6.21.0": { + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" } }, "workspace": { "dependencies": [ "jsr:@std/assert@1.0.13", "jsr:@std/cli@1.0.16", - "jsr:@std/fs@1.0.16", - "jsr:@std/path@1.0.9", - "npm:ini@5.0.0" + "jsr:@std/fs@1.0.16" ] } } From a2c02b2b45d098a5ffe62c2b3cbe625400762e3a Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 6 Jun 2025 09:30:56 +0000 Subject: [PATCH 29/82] nghttp3: 1.9.0 -> 1.10.1 --- pkgs/by-name/ng/nghttp3/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ng/nghttp3/package.nix b/pkgs/by-name/ng/nghttp3/package.nix index 4a2bcba514b0..6676fe825b35 100644 --- a/pkgs/by-name/ng/nghttp3/package.nix +++ b/pkgs/by-name/ng/nghttp3/package.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "nghttp3"; - version = "1.9.0"; + version = "1.10.1"; src = fetchFromGitHub { owner = "ngtcp2"; repo = "nghttp3"; rev = "v${version}"; - hash = "sha256-CTra8vmpIig8LX7RWqRzhWhX9yn0RnFrnV/kYPgZgJk="; + hash = "sha256-V4JFqi3VdblpBlZJ1uFX56AlJn894oiX86OfoxVjBbE="; fetchSubmodules = true; }; From 60f39b66f57f45ef248ac16ba72bd943bc9ba323 Mon Sep 17 00:00:00 2001 From: aMOPel Date: Fri, 6 Jun 2025 16:49:20 +0200 Subject: [PATCH 30/82] fix: delete reproducible --- pkgs/build-support/deno/fetch-deno-deps/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/deno/fetch-deno-deps/default.nix b/pkgs/build-support/deno/fetch-deno-deps/default.nix index d0afad44da86..a676deeb6d92 100644 --- a/pkgs/build-support/deno/fetch-deno-deps/default.nix +++ b/pkgs/build-support/deno/fetch-deno-deps/default.nix @@ -127,7 +127,7 @@ # sometimes a .deno dir is slipped into a node_modules package # it's unclear why. but it can just be deleted - find -L ./node_modules/* -name ".deno" -type d | xargs rm -rf + find -L ./node_modules -name ".deno" -type d | sort -r | head -n-1 | xargs rm -rf fi rm -f "$DENO_DIR"/dep_analysis_cache_v2-shm From c5dcac6cdbe1f027ebc1f484a9ca525fbd83eff8 Mon Sep 17 00:00:00 2001 From: emaryn Date: Sun, 8 Jun 2025 04:51:20 +0800 Subject: [PATCH 31/82] plant-it-frontend: pin flutter to flutter329 --- pkgs/by-name/pl/plant-it-frontend/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/pl/plant-it-frontend/package.nix b/pkgs/by-name/pl/plant-it-frontend/package.nix index 58856e6d7db9..fa79e55612e3 100644 --- a/pkgs/by-name/pl/plant-it-frontend/package.nix +++ b/pkgs/by-name/pl/plant-it-frontend/package.nix @@ -1,13 +1,14 @@ { lib, - flutter326, + flutter329, plant-it, }: -flutter326.buildFlutterApplication { +flutter329.buildFlutterApplication { pname = "plant-it-frontend"; inherit (plant-it) version src; - sourceRoot = "source/frontend"; + + sourceRoot = "${plant-it.src.name}/frontend"; targetFlutterPlatform = "web"; @@ -15,5 +16,6 @@ flutter326.buildFlutterApplication { meta = plant-it.meta // { description = "Frontend for Plant It"; + platforms = lib.platforms.linux; }; } From c8817cf8eaa81b4804d0e15f16d13f41662fa86b Mon Sep 17 00:00:00 2001 From: emaryn Date: Sun, 8 Jun 2025 04:54:03 +0800 Subject: [PATCH 32/82] flutter326: drop --- .../compilers/flutter/versions/3_26/data.json | 1056 ----------------- ...deregister-pub-dependencies-artifact.patch | 19 - .../3_26/patches/disable-auto-update.patch | 30 - .../fix-ios-build-xcode-backend-sh.patch | 69 -- .../gradle-flutter-tools-wrapper.patch | 44 - pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 1 - 7 files changed, 1 insertion(+), 1219 deletions(-) delete mode 100644 pkgs/development/compilers/flutter/versions/3_26/data.json delete mode 100644 pkgs/development/compilers/flutter/versions/3_26/patches/deregister-pub-dependencies-artifact.patch delete mode 100644 pkgs/development/compilers/flutter/versions/3_26/patches/disable-auto-update.patch delete mode 100644 pkgs/development/compilers/flutter/versions/3_26/patches/fix-ios-build-xcode-backend-sh.patch delete mode 100644 pkgs/development/compilers/flutter/versions/3_26/patches/gradle-flutter-tools-wrapper.patch diff --git a/pkgs/development/compilers/flutter/versions/3_26/data.json b/pkgs/development/compilers/flutter/versions/3_26/data.json deleted file mode 100644 index 13613d19c2ff..000000000000 --- a/pkgs/development/compilers/flutter/versions/3_26/data.json +++ /dev/null @@ -1,1056 +0,0 @@ -{ - "version": "3.26.0-0.1.pre", - "engineVersion": "059e4e6d8ff6de39c29441c53e949bfb0bf17972", - "engineSwiftShaderHash": "sha256-mRLCvhNkmHz7Rv6GzXkY7OB1opBSq+ATWZ466qZdgto=", - "engineSwiftShaderRev": "2fa7e9b99ae4e70ea5ae2cc9c8d3afb43391384f", - "channel": "beta", - "engineHashes": { - "aarch64-linux": { - "aarch64-linux": "sha256-cDXCGikGuPWxMZZ0HWcnbS7Dt22no9wwbh4wei7w8Bw=", - "x86_64-linux": "sha256-cDXCGikGuPWxMZZ0HWcnbS7Dt22no9wwbh4wei7w8Bw=" - }, - "x86_64-linux": { - "aarch64-linux": "sha256-deuArmKBZvkjjt986wAAwGArKYMW01QvbgqzQ9FLBS8=", - "x86_64-linux": "sha256-deuArmKBZvkjjt986wAAwGArKYMW01QvbgqzQ9FLBS8=" - } - }, - "dartVersion": "3.6.0-216.1.beta", - "dartHash": { - "x86_64-linux": "sha256-Vvdx4Bi7a/ySrxAv3UejlmmbNyKzdDr9RCS9tVGscDQ=", - "aarch64-linux": "sha256-SHqk1bm/5+ixOA5RHuToHQDN/NrNKZIrkkaBh9Cvl/I=", - "x86_64-darwin": "sha256-dbw0+OtjYkdRCgLDP+oNcOUgR5C8gC12NdftNAk7x0Q=", - "aarch64-darwin": "sha256-XOpBwyrMqIKutXgLEjGuta/3yhK+DpoSChNVXc9MMYA=" - }, - "flutterHash": "sha256-4YXm/MbhQsifJYpeUjmP8h6sm7pWrjBSpbCTV9p659o=", - "artifactHashes": { - "android": { - "aarch64-darwin": "sha256-CmjEq9T5gNgNKp8mik6HwVAsAfdWXBK2nHwL28L08xk=", - "aarch64-linux": "sha256-sucpfdtDzNMmCpWOZGVp48uNSrj221fOROI8huRs8Xc=", - "x86_64-darwin": "sha256-CmjEq9T5gNgNKp8mik6HwVAsAfdWXBK2nHwL28L08xk=", - "x86_64-linux": "sha256-sucpfdtDzNMmCpWOZGVp48uNSrj221fOROI8huRs8Xc=" - }, - "fuchsia": { - "aarch64-darwin": "sha256-eu0BERdz53CkSexbpu3KA7O6Q4g0s9SGD3t1Snsk3Fk=", - "aarch64-linux": "sha256-eu0BERdz53CkSexbpu3KA7O6Q4g0s9SGD3t1Snsk3Fk=", - "x86_64-darwin": "sha256-eu0BERdz53CkSexbpu3KA7O6Q4g0s9SGD3t1Snsk3Fk=", - "x86_64-linux": "sha256-eu0BERdz53CkSexbpu3KA7O6Q4g0s9SGD3t1Snsk3Fk=" - }, - "ios": { - "aarch64-darwin": "sha256-kRgyKtnMs7xefe+XmCoYbO7sa7Dz1o0ltcRdiDvSeik=", - "aarch64-linux": "sha256-kRgyKtnMs7xefe+XmCoYbO7sa7Dz1o0ltcRdiDvSeik=", - "x86_64-darwin": "sha256-kRgyKtnMs7xefe+XmCoYbO7sa7Dz1o0ltcRdiDvSeik=", - "x86_64-linux": "sha256-kRgyKtnMs7xefe+XmCoYbO7sa7Dz1o0ltcRdiDvSeik=" - }, - "linux": { - "aarch64-darwin": "sha256-tnvQp4Vdthqwgt1bFRpZVJOuTX752yJE91yJNpwSOp4=", - "aarch64-linux": "sha256-tnvQp4Vdthqwgt1bFRpZVJOuTX752yJE91yJNpwSOp4=", - "x86_64-darwin": "sha256-vIfHgLif151Ymtu/aFtwHZTk28H2feHd9cOedUmSWXY=", - "x86_64-linux": "sha256-vIfHgLif151Ymtu/aFtwHZTk28H2feHd9cOedUmSWXY=" - }, - "macos": { - "aarch64-darwin": "sha256-/4R3Wlcs6ksMkTTZJ/YzEgWWCQJBKlnWr+PNCtcL3oc=", - "aarch64-linux": "sha256-/4R3Wlcs6ksMkTTZJ/YzEgWWCQJBKlnWr+PNCtcL3oc=", - "x86_64-darwin": "sha256-/4R3Wlcs6ksMkTTZJ/YzEgWWCQJBKlnWr+PNCtcL3oc=", - "x86_64-linux": "sha256-/4R3Wlcs6ksMkTTZJ/YzEgWWCQJBKlnWr+PNCtcL3oc=" - }, - "universal": { - "aarch64-darwin": "sha256-M2Fuqfgq79+FilJ5vU0Iarn0cpV3+4AxuxFEc3fwm+4=", - "aarch64-linux": "sha256-NqlNboNjLFAeuLHu6lNnMnrEb902nwIV1b/DNfrr3h8=", - "x86_64-darwin": "sha256-tlGwnwAov1eBe54mD9Q6D86qIEBkHBODJs5SVJyP5M0=", - "x86_64-linux": "sha256-0lxLRRQq+bRDPXyxEtZVGtzzqhrcsTYx01jeFX3ejLc=" - }, - "web": { - "aarch64-darwin": "sha256-fVOuJCTciHWv+HRFtSgn8zrexspBe+MUnc/cZlOeoqM=", - "aarch64-linux": "sha256-fVOuJCTciHWv+HRFtSgn8zrexspBe+MUnc/cZlOeoqM=", - "x86_64-darwin": "sha256-fVOuJCTciHWv+HRFtSgn8zrexspBe+MUnc/cZlOeoqM=", - "x86_64-linux": "sha256-fVOuJCTciHWv+HRFtSgn8zrexspBe+MUnc/cZlOeoqM=" - }, - "windows": { - "x86_64-darwin": "sha256-mwbk0VwxsbnMjy8trtjgZZ96jF3QuQJDcc0VSs6mQxI=", - "x86_64-linux": "sha256-mwbk0VwxsbnMjy8trtjgZZ96jF3QuQJDcc0VSs6mQxI=" - } - }, - "pubspecLock": { - "packages": { - "_fe_analyzer_shared": { - "dependency": "direct main", - "description": { - "name": "_fe_analyzer_shared", - "sha256": "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "73.0.0" - }, - "_macros": { - "dependency": "transitive", - "description": "dart", - "source": "sdk", - "version": "0.3.2" - }, - "analyzer": { - "dependency": "direct main", - "description": { - "name": "analyzer", - "sha256": "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "6.8.0" - }, - "archive": { - "dependency": "direct main", - "description": { - "name": "archive", - "sha256": "cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.6.1" - }, - "args": { - "dependency": "direct main", - "description": { - "name": "args", - "sha256": "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.5.0" - }, - "async": { - "dependency": "direct main", - "description": { - "name": "async", - "sha256": "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.11.0" - }, - "boolean_selector": { - "dependency": "direct main", - "description": { - "name": "boolean_selector", - "sha256": "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.1" - }, - "browser_launcher": { - "dependency": "direct main", - "description": { - "name": "browser_launcher", - "sha256": "54a2da4d152c34760b87cbd4a9fe8a563379487e57bfcd1b387be394dfa91734", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.1.2" - }, - "built_collection": { - "dependency": "direct main", - "description": { - "name": "built_collection", - "sha256": "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "5.1.1" - }, - "built_value": { - "dependency": "direct main", - "description": { - "name": "built_value", - "sha256": "c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "8.9.2" - }, - "checked_yaml": { - "dependency": "direct dev", - "description": { - "name": "checked_yaml", - "sha256": "feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.0.3" - }, - "cli_config": { - "dependency": "direct main", - "description": { - "name": "cli_config", - "sha256": "ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.2.0" - }, - "clock": { - "dependency": "direct main", - "description": { - "name": "clock", - "sha256": "cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.1.1" - }, - "collection": { - "dependency": "direct dev", - "description": { - "name": "collection", - "sha256": "a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.19.0" - }, - "completion": { - "dependency": "direct main", - "description": { - "name": "completion", - "sha256": "f11b7a628e6c42b9edc9b0bc3aa490e2d930397546d2f794e8e1325909d11c60", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.0.1" - }, - "convert": { - "dependency": "direct main", - "description": { - "name": "convert", - "sha256": "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.1.1" - }, - "coverage": { - "dependency": "direct main", - "description": { - "name": "coverage", - "sha256": "7b594a150942e0d3be99cd45a1d0b5caff27ba5a27f292ed8e8d904ba3f167b5", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.9.1" - }, - "crypto": { - "dependency": "direct main", - "description": { - "name": "crypto", - "sha256": "ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.0.5" - }, - "csslib": { - "dependency": "direct main", - "description": { - "name": "csslib", - "sha256": "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.0.0" - }, - "dap": { - "dependency": "direct main", - "description": { - "name": "dap", - "sha256": "c0e53b52c9529d901329045afc4c5acb04304a28acde4b54ab0a08a93da546aa", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.3.0" - }, - "dds": { - "dependency": "direct main", - "description": { - "name": "dds", - "sha256": "263f8831bfe57136fd4c07cf87df9b3f65457438b8b4d237e1b1d603c6d1cdbd", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.2.6" - }, - "dds_service_extensions": { - "dependency": "direct main", - "description": { - "name": "dds_service_extensions", - "sha256": "390ae1d0128bb43ffe11f8e3c6cd3a481c1920492d1026883d379cee50bdf1a2", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.0.0" - }, - "devtools_shared": { - "dependency": "direct main", - "description": { - "name": "devtools_shared", - "sha256": "72369878105eccd563547afbad97407a2431b96bd4c04a1d6da75cb068437f50", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "10.0.2" - }, - "dtd": { - "dependency": "direct main", - "description": { - "name": "dtd", - "sha256": "6e4e508c0d03e12e2c96f21faa0e5acc191f9431ecd02adb8daee64dbfae6b86", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.3.0" - }, - "dwds": { - "dependency": "direct main", - "description": { - "name": "dwds", - "sha256": "d0cf9d18511df6b397c40527f3fd8ddb47b7efcc501e703dd94f13cabaf82ffc", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "24.1.0" - }, - "extension_discovery": { - "dependency": "direct main", - "description": { - "name": "extension_discovery", - "sha256": "20735622d0763865f9d94c3ecdce4441174530870760253e9d364fb4f3da8688", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.0.0" - }, - "fake_async": { - "dependency": "direct main", - "description": { - "name": "fake_async", - "sha256": "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.3.1" - }, - "ffi": { - "dependency": "direct main", - "description": { - "name": "ffi", - "sha256": "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.3" - }, - "file": { - "dependency": "direct main", - "description": { - "name": "file", - "sha256": "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "7.0.0" - }, - "file_testing": { - "dependency": "direct dev", - "description": { - "name": "file_testing", - "sha256": "0aaadb4025bd350403f4308ad6c4cea953278d9407814b8342558e4946840fb5", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.0.0" - }, - "fixnum": { - "dependency": "direct main", - "description": { - "name": "fixnum", - "sha256": "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.1.0" - }, - "flutter_template_images": { - "dependency": "direct main", - "description": { - "name": "flutter_template_images", - "sha256": "fd3e55af73c577b9e3f88d4080d3e366cb5c8ef3fbd50b94dfeca56bb0235df6", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.2.0" - }, - "frontend_server_client": { - "dependency": "direct main", - "description": { - "name": "frontend_server_client", - "sha256": "f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.0.0" - }, - "glob": { - "dependency": "direct main", - "description": { - "name": "glob", - "sha256": "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.2" - }, - "graphs": { - "dependency": "direct main", - "description": { - "name": "graphs", - "sha256": "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.3.2" - }, - "html": { - "dependency": "direct main", - "description": { - "name": "html", - "sha256": "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.15.4" - }, - "http": { - "dependency": "direct main", - "description": { - "name": "http", - "sha256": "b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.2.2" - }, - "http_multi_server": { - "dependency": "direct main", - "description": { - "name": "http_multi_server", - "sha256": "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.2.1" - }, - "http_parser": { - "dependency": "direct main", - "description": { - "name": "http_parser", - "sha256": "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.1.0" - }, - "intl": { - "dependency": "direct main", - "description": { - "name": "intl", - "sha256": "d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.19.0" - }, - "io": { - "dependency": "direct main", - "description": { - "name": "io", - "sha256": "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.0.4" - }, - "js": { - "dependency": "direct main", - "description": { - "name": "js", - "sha256": "c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.7.1" - }, - "json_annotation": { - "dependency": "direct dev", - "description": { - "name": "json_annotation", - "sha256": "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.9.0" - }, - "json_rpc_2": { - "dependency": "direct main", - "description": { - "name": "json_rpc_2", - "sha256": "5e469bffa23899edacb7b22787780068d650b106a21c76db3c49218ab7ca447e", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.0.2" - }, - "logging": { - "dependency": "direct main", - "description": { - "name": "logging", - "sha256": "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.2.0" - }, - "macros": { - "dependency": "transitive", - "description": { - "name": "macros", - "sha256": "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.1.2-main.4" - }, - "matcher": { - "dependency": "direct main", - "description": { - "name": "matcher", - "sha256": "d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.12.16+1" - }, - "meta": { - "dependency": "direct main", - "description": { - "name": "meta", - "sha256": "bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.15.0" - }, - "mime": { - "dependency": "direct main", - "description": { - "name": "mime", - "sha256": "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.0.6" - }, - "multicast_dns": { - "dependency": "direct main", - "description": { - "name": "multicast_dns", - "sha256": "982c4cc4cda5f98dd477bddfd623e8e4bd1014e7dbf9e7b05052e14a5b550b99", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.3.2+7" - }, - "mustache_template": { - "dependency": "direct main", - "description": { - "name": "mustache_template", - "sha256": "a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.0.0" - }, - "native_assets_builder": { - "dependency": "direct main", - "description": { - "name": "native_assets_builder", - "sha256": "3368f3eda23d59e98c8eadeafe609feb3bf6c342e5885796d6eceadc3d4581f8", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.8.2" - }, - "native_assets_cli": { - "dependency": "direct main", - "description": { - "name": "native_assets_cli", - "sha256": "1ff032c0ca050391c4c5107485f1a26e0e95cee18d1fdb2b7bdbb990efd3c188", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.7.3" - }, - "native_stack_traces": { - "dependency": "direct main", - "description": { - "name": "native_stack_traces", - "sha256": "8ba566c10ea781491c203876b04b9bdcf19dfbe17b9e486869f20eaae0ee470f", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.6.0" - }, - "node_preamble": { - "dependency": "direct main", - "description": { - "name": "node_preamble", - "sha256": "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.0.2" - }, - "package_config": { - "dependency": "direct main", - "description": { - "name": "package_config", - "sha256": "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.0" - }, - "path": { - "dependency": "direct main", - "description": { - "name": "path", - "sha256": "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.9.0" - }, - "petitparser": { - "dependency": "direct main", - "description": { - "name": "petitparser", - "sha256": "c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "6.0.2" - }, - "platform": { - "dependency": "direct main", - "description": { - "name": "platform", - "sha256": "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.1.5" - }, - "pool": { - "dependency": "direct main", - "description": { - "name": "pool", - "sha256": "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.5.1" - }, - "process": { - "dependency": "direct main", - "description": { - "name": "process", - "sha256": "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "5.0.2" - }, - "pub_semver": { - "dependency": "direct main", - "description": { - "name": "pub_semver", - "sha256": "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.4" - }, - "pubspec_parse": { - "dependency": "direct dev", - "description": { - "name": "pubspec_parse", - "sha256": "c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.3.0" - }, - "shelf": { - "dependency": "direct main", - "description": { - "name": "shelf", - "sha256": "e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.4.2" - }, - "shelf_packages_handler": { - "dependency": "direct main", - "description": { - "name": "shelf_packages_handler", - "sha256": "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.0.2" - }, - "shelf_proxy": { - "dependency": "direct main", - "description": { - "name": "shelf_proxy", - "sha256": "a71d2307f4393211930c590c3d2c00630f6c5a7a77edc1ef6436dfd85a6a7ee3", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.0.4" - }, - "shelf_static": { - "dependency": "direct main", - "description": { - "name": "shelf_static", - "sha256": "a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.1.2" - }, - "shelf_web_socket": { - "dependency": "direct main", - "description": { - "name": "shelf_web_socket", - "sha256": "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.0.0" - }, - "source_map_stack_trace": { - "dependency": "direct main", - "description": { - "name": "source_map_stack_trace", - "sha256": "c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.2" - }, - "source_maps": { - "dependency": "direct main", - "description": { - "name": "source_maps", - "sha256": "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.10.12" - }, - "source_span": { - "dependency": "direct main", - "description": { - "name": "source_span", - "sha256": "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.10.0" - }, - "sprintf": { - "dependency": "direct main", - "description": { - "name": "sprintf", - "sha256": "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "7.0.0" - }, - "sse": { - "dependency": "direct main", - "description": { - "name": "sse", - "sha256": "111a05843ea9035042975744fe61d5e8b95bc4d38656dbafc5532da77a0bb89a", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.1.6" - }, - "stack_trace": { - "dependency": "direct main", - "description": { - "name": "stack_trace", - "sha256": "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.11.1" - }, - "standard_message_codec": { - "dependency": "direct main", - "description": { - "name": "standard_message_codec", - "sha256": "fc7dd712d191b7e33196a0ecf354c4573492bb95995e7166cb6f73b047f9cae0", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.0.1+4" - }, - "stream_channel": { - "dependency": "direct main", - "description": { - "name": "stream_channel", - "sha256": "ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.1.2" - }, - "string_scanner": { - "dependency": "direct main", - "description": { - "name": "string_scanner", - "sha256": "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.3.0" - }, - "sync_http": { - "dependency": "direct main", - "description": { - "name": "sync_http", - "sha256": "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.3.1" - }, - "term_glyph": { - "dependency": "direct main", - "description": { - "name": "term_glyph", - "sha256": "a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.2.1" - }, - "test": { - "dependency": "direct main", - "description": { - "name": "test", - "sha256": "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.25.8" - }, - "test_api": { - "dependency": "direct main", - "description": { - "name": "test_api", - "sha256": "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.7.3" - }, - "test_core": { - "dependency": "direct main", - "description": { - "name": "test_core", - "sha256": "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.6.5" - }, - "typed_data": { - "dependency": "direct main", - "description": { - "name": "typed_data", - "sha256": "facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.3.2" - }, - "unified_analytics": { - "dependency": "direct main", - "description": { - "name": "unified_analytics", - "sha256": "916215af2dc2f54a204c6bfbc645ec401b6a150048764814379f42e09b557d2d", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "6.1.2" - }, - "usage": { - "dependency": "direct main", - "description": { - "name": "usage", - "sha256": "0bdbde65a6e710343d02a56552eeaefd20b735e04bfb6b3ee025b6b22e8d0e15", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.1.1" - }, - "uuid": { - "dependency": "direct main", - "description": { - "name": "uuid", - "sha256": "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "4.4.2" - }, - "vm_service": { - "dependency": "direct main", - "description": { - "name": "vm_service", - "sha256": "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "14.2.5" - }, - "vm_service_interface": { - "dependency": "direct main", - "description": { - "name": "vm_service_interface", - "sha256": "f827453d9a3f8ceae04e389810da26f9b67636bdd13aa2dd9405b110c4daf59c", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.1.0" - }, - "vm_snapshot_analysis": { - "dependency": "direct main", - "description": { - "name": "vm_snapshot_analysis", - "sha256": "5a79b9fbb6be2555090f55b03b23907e75d44c3fd7bdd88da09848aa5a1914c8", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.7.6" - }, - "watcher": { - "dependency": "direct main", - "description": { - "name": "watcher", - "sha256": "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.1.0" - }, - "web": { - "dependency": "direct main", - "description": { - "name": "web", - "sha256": "d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.0.0" - }, - "web_socket": { - "dependency": "direct main", - "description": { - "name": "web_socket", - "sha256": "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "0.1.6" - }, - "web_socket_channel": { - "dependency": "direct main", - "description": { - "name": "web_socket_channel", - "sha256": "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.0.1" - }, - "webdriver": { - "dependency": "direct main", - "description": { - "name": "webdriver", - "sha256": "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.0.3" - }, - "webkit_inspection_protocol": { - "dependency": "direct main", - "description": { - "name": "webkit_inspection_protocol", - "sha256": "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "1.2.1" - }, - "xml": { - "dependency": "direct main", - "description": { - "name": "xml", - "sha256": "b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "6.5.0" - }, - "yaml": { - "dependency": "direct main", - "description": { - "name": "yaml", - "sha256": "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "3.1.2" - }, - "yaml_edit": { - "dependency": "direct main", - "description": { - "name": "yaml_edit", - "sha256": "e9c1a3543d2da0db3e90270dbb1e4eebc985ee5e3ffe468d83224472b2194a5f", - "url": "https://pub.dev" - }, - "source": "hosted", - "version": "2.2.1" - } - }, - "sdks": { - "dart": ">=3.4.3 <4.0.0" - } - } -} diff --git a/pkgs/development/compilers/flutter/versions/3_26/patches/deregister-pub-dependencies-artifact.patch b/pkgs/development/compilers/flutter/versions/3_26/patches/deregister-pub-dependencies-artifact.patch deleted file mode 100644 index 01e34c6d292c..000000000000 --- a/pkgs/development/compilers/flutter/versions/3_26/patches/deregister-pub-dependencies-artifact.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/packages/flutter_tools/lib/src/flutter_cache.dart b/packages/flutter_tools/lib/src/flutter_cache.dart -index 252021cf78..e50ef0885d 100644 ---- a/packages/flutter_tools/lib/src/flutter_cache.dart -+++ b/packages/flutter_tools/lib/src/flutter_cache.dart -@@ -51,14 +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, -- )); - } - } - \ No newline at end of file diff --git a/pkgs/development/compilers/flutter/versions/3_26/patches/disable-auto-update.patch b/pkgs/development/compilers/flutter/versions/3_26/patches/disable-auto-update.patch deleted file mode 100644 index 2ad292efd222..000000000000 --- a/pkgs/development/compilers/flutter/versions/3_26/patches/disable-auto-update.patch +++ /dev/null @@ -1,30 +0,0 @@ -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 -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 50783f8435..db94062840 100644 ---- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart -+++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart -@@ -377,11 +377,7 @@ class FlutterCommandRunner extends CommandRunner { - globals.analytics.suppressTelemetry(); - } - -- globals.flutterVersion.ensureVersionFile(); - final bool machineFlag = topLevelResults[FlutterGlobalOptions.kMachineFlag] as bool? ?? false; -- if (await _shouldCheckForUpdates(topLevelResults, topLevelMachineFlag: machineFlag)) { -- await globals.flutterVersion.checkFlutterVersionFreshness(); -- } - - // See if the user specified a specific device. - final String? specifiedDeviceId = topLevelResults[FlutterGlobalOptions.kDeviceIdOption] as String?; - diff --git a/pkgs/development/compilers/flutter/versions/3_26/patches/fix-ios-build-xcode-backend-sh.patch b/pkgs/development/compilers/flutter/versions/3_26/patches/fix-ios-build-xcode-backend-sh.patch deleted file mode 100644 index 825d40fc6176..000000000000 --- a/pkgs/development/compilers/flutter/versions/3_26/patches/fix-ios-build-xcode-backend-sh.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 6df275df3b8694daf16302b407520e3b1dee6724 Mon Sep 17 00:00:00 2001 -From: Philip Hayes -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 "//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 -@@ -6,24 +6,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" "$@" -+# 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}" "$@" --- -2.46.0 - diff --git a/pkgs/development/compilers/flutter/versions/3_26/patches/gradle-flutter-tools-wrapper.patch b/pkgs/development/compilers/flutter/versions/3_26/patches/gradle-flutter-tools-wrapper.patch deleted file mode 100644 index de6080efbba8..000000000000 --- a/pkgs/development/compilers/flutter/versions/3_26/patches/gradle-flutter-tools-wrapper.patch +++ /dev/null @@ -1,44 +0,0 @@ -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//` 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")`. - -Now the `.gradle` will be built in `$HOME/.cache/flutter/nix-flutter-tools-gradle//`, but `build` doesn't. -To move `build` to `$HOME/.cache/flutter/nix-flutter-tools-gradle//` as well, we need to set `buildDirectory`. -diff --git a/packages/flutter_tools/gradle/settings.gradle b/packages/flutter_tools/gradle/settings.gradle -new file mode 100644 -index 0000000000..b2485c94b4 ---- /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) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5b792147b534..691033045f89 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -679,6 +679,7 @@ mapAliases { flutter319 = throw "flutter319 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2024-12-03 flutter322 = throw "flutter322 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2024-10-05 flutter323 = throw "flutter323 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2024-10-05 + flutter326 = throw "flutter326 has been removed because it isn't updated anymore, and no packages in nixpkgs use it. If you still need it, use flutter.mkFlutter to get a custom version"; # Added 2025-06-08 fluxctl = throw "fluxctl is unmaintained and has been removed. Migration to flux2 is recommended"; # Added 2025-05-11 fluxus = throw "fluxus has been removed because it hasn't been updated in 9 years and depended on insecure Racket 7.9"; # Added 2024-12-06 fmt_8 = throw "fmt_8 has been removed as it is obsolete and was no longer used in the tree"; # Added 2024-11-12 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 78cb8d022fdb..976230879bfa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5045,7 +5045,6 @@ with pkgs; flutter332 = flutterPackages.v3_32; flutter329 = flutterPackages.v3_29; flutter327 = flutterPackages.v3_27; - flutter326 = flutterPackages.v3_26; flutter324 = flutterPackages.v3_24; fpc = callPackage ../development/compilers/fpc { }; From fb698741a91cab6e39567c384024aa5a21a077c2 Mon Sep 17 00:00:00 2001 From: Defelo Date: Wed, 11 Jun 2025 21:20:14 +0200 Subject: [PATCH 33/82] anubis: format --- pkgs/by-name/an/anubis/package.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/an/anubis/package.nix b/pkgs/by-name/an/anubis/package.nix index ef79b6d9a8ee..9e87ef250247 100644 --- a/pkgs/by-name/an/anubis/package.nix +++ b/pkgs/by-name/an/anubis/package.nix @@ -31,19 +31,13 @@ buildGoModule (finalAttrs: { zstd ]; - subPackages = [ - "cmd/anubis" - ]; + subPackages = [ "cmd/anubis" ]; - ldflags = - [ - "-s" - "-w" - "-X=github.com/TecharoHQ/anubis.Version=v${finalAttrs.version}" - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "-extldflags=-static" - ]; + ldflags = [ + "-s" + "-w" + "-X=github.com/TecharoHQ/anubis.Version=v${finalAttrs.version}" + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "-extldflags=-static" ]; postPatch = '' patchShebangs ./web/build.sh From dfedad0bb5d1b467a9ab61bc44e90ef022de7ab6 Mon Sep 17 00:00:00 2001 From: Defelo Date: Wed, 11 Jun 2025 20:49:14 +0200 Subject: [PATCH 34/82] anubis-xess: move into anubis package --- pkgs/by-name/an/anubis-xess/package.nix | 35 ------------------------- pkgs/by-name/an/anubis/package.nix | 24 ++++++++++++++--- 2 files changed, 21 insertions(+), 38 deletions(-) delete mode 100644 pkgs/by-name/an/anubis-xess/package.nix diff --git a/pkgs/by-name/an/anubis-xess/package.nix b/pkgs/by-name/an/anubis-xess/package.nix deleted file mode 100644 index 8165cf1e0c37..000000000000 --- a/pkgs/by-name/an/anubis-xess/package.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ buildNpmPackage, anubis }: - -buildNpmPackage { - pname = "${anubis.pname}-xess"; - inherit (anubis) version src; - - npmDepsHash = "sha256-wI8XCUGq3aI20B++RAT3lc/nBrDMEmE9+810lewzXa0="; - - buildPhase = '' - runHook preBuild - - npx postcss ./xess/xess.css -o xess.min.css - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - install -Dm644 xess.min.css $out/xess.min.css - - runHook postInstall - ''; - - meta = anubis.meta // { - description = "Xess files for Anubis"; - longDescription = '' - This package is consumed by the main `anubis` package to render the final - styling for the bot check page. - - **It is not supposed to be used as a standalone package**, and it exists to - ensure Anubis' styling is override-able by downstreams. - ''; - }; -} diff --git a/pkgs/by-name/an/anubis/package.nix b/pkgs/by-name/an/anubis/package.nix index 9e87ef250247..b5a4aa2ed4fd 100644 --- a/pkgs/by-name/an/anubis/package.nix +++ b/pkgs/by-name/an/anubis/package.nix @@ -4,8 +4,7 @@ fetchFromGitHub, nixosTests, stdenv, - - anubis-xess, + buildNpmPackage, esbuild, brotli, @@ -31,6 +30,25 @@ buildGoModule (finalAttrs: { zstd ]; + xess = buildNpmPackage { + pname = "anubis-xess"; + inherit (finalAttrs) version src; + + npmDepsHash = "sha256-wI8XCUGq3aI20B++RAT3lc/nBrDMEmE9+810lewzXa0="; + + buildPhase = '' + runHook preBuild + npx postcss ./xess/xess.css -o xess.min.css + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + install -Dm644 xess.min.css $out/xess.min.css + runHook postInstall + ''; + }; + subPackages = [ "cmd/anubis" ]; ldflags = [ @@ -44,7 +62,7 @@ buildGoModule (finalAttrs: { ''; preBuild = '' - go generate ./... && ./web/build.sh && cp -r ${anubis-xess}/xess.min.css ./xess + go generate ./... && ./web/build.sh && cp -r ${finalAttrs.xess}/xess.min.css ./xess ''; preCheck = '' From 27dddb6876894c5ed13b689858dad5b1bbb72dde Mon Sep 17 00:00:00 2001 From: Defelo Date: Wed, 11 Jun 2025 20:59:06 +0200 Subject: [PATCH 35/82] anubis: add meta.downloadPage --- pkgs/by-name/an/anubis/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/an/anubis/package.nix b/pkgs/by-name/an/anubis/package.nix index b5a4aa2ed4fd..c91b81bd394c 100644 --- a/pkgs/by-name/an/anubis/package.nix +++ b/pkgs/by-name/an/anubis/package.nix @@ -74,6 +74,7 @@ buildGoModule (finalAttrs: { meta = { description = "Weighs the soul of incoming HTTP requests using proof-of-work to stop AI crawlers"; homepage = "https://anubis.techaro.lol/"; + downloadPage = "https://github.com/TecharoHQ/anubis"; changelog = "https://github.com/TecharoHQ/anubis/releases/tag/v${finalAttrs.version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ From 252c081da08a66104913d3262bd922b3074fd05a Mon Sep 17 00:00:00 2001 From: Defelo Date: Wed, 11 Jun 2025 20:47:38 +0200 Subject: [PATCH 36/82] anubis: add updateScript --- pkgs/by-name/an/anubis/package.nix | 1 + pkgs/by-name/an/anubis/update.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100755 pkgs/by-name/an/anubis/update.sh diff --git a/pkgs/by-name/an/anubis/package.nix b/pkgs/by-name/an/anubis/package.nix index c91b81bd394c..c5976c41a4ab 100644 --- a/pkgs/by-name/an/anubis/package.nix +++ b/pkgs/by-name/an/anubis/package.nix @@ -70,6 +70,7 @@ buildGoModule (finalAttrs: { ''; passthru.tests = { inherit (nixosTests) anubis; }; + passthru.updateScript = ./update.sh; meta = { description = "Weighs the soul of incoming HTTP requests using proof-of-work to stop AI crawlers"; diff --git a/pkgs/by-name/an/anubis/update.sh b/pkgs/by-name/an/anubis/update.sh new file mode 100755 index 000000000000..62f67a857d0c --- /dev/null +++ b/pkgs/by-name/an/anubis/update.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p nix-update + +set -euo pipefail + +nix-update anubis --src-only +nix-update anubis.xess --version=skip +nix-update anubis --version=skip From 588af0fe4d01cc3fabd27e1df47e252e2fdf38db Mon Sep 17 00:00:00 2001 From: Defelo Date: Wed, 11 Jun 2025 20:48:16 +0200 Subject: [PATCH 37/82] anubis: add defelo as maintainer --- pkgs/by-name/an/anubis/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/an/anubis/package.nix b/pkgs/by-name/an/anubis/package.nix index c5976c41a4ab..50ca02b7ad17 100644 --- a/pkgs/by-name/an/anubis/package.nix +++ b/pkgs/by-name/an/anubis/package.nix @@ -83,6 +83,7 @@ buildGoModule (finalAttrs: { soopyc ryand56 sigmasquadron + defelo ]; mainProgram = "anubis"; }; From 9592011964bc316a82dd63147e6dcc15931acf46 Mon Sep 17 00:00:00 2001 From: "Berk D. Demir" Date: Wed, 4 Jun 2025 16:11:03 -0700 Subject: [PATCH 38/82] _1password-gui: Add passthru.updateScript For Linux updates we use Repology API to observe 1Password's Arch User Repository. For Darwin updates, 1Password for Mac 8's autoupdate feed URL. --- pkgs/by-name/_1/_1password-gui/darwin.nix | 2 + pkgs/by-name/_1/_1password-gui/linux.nix | 2 + pkgs/by-name/_1/_1password-gui/package.nix | 25 ++- pkgs/by-name/_1/_1password-gui/sources.json | 76 +++++--- .../_1/_1password-gui/update-sources.py | 122 ++++++++++++ pkgs/by-name/_1/_1password-gui/update.sh | 182 +++++++++++------- pkgs/by-name/_1/_1password-gui/versions.json | 6 - 7 files changed, 297 insertions(+), 118 deletions(-) create mode 100755 pkgs/by-name/_1/_1password-gui/update-sources.py delete mode 100644 pkgs/by-name/_1/_1password-gui/versions.json diff --git a/pkgs/by-name/_1/_1password-gui/darwin.nix b/pkgs/by-name/_1/_1password-gui/darwin.nix index 66af74630c34..7c2f24f98be4 100644 --- a/pkgs/by-name/_1/_1password-gui/darwin.nix +++ b/pkgs/by-name/_1/_1password-gui/darwin.nix @@ -30,4 +30,6 @@ stdenv.mkDerivation { # 1Password is notarized. dontFixup = true; + + passthru.updateScript = ./update.sh; } diff --git a/pkgs/by-name/_1/_1password-gui/linux.nix b/pkgs/by-name/_1/_1password-gui/linux.nix index 9998860829a8..03fec5bd4922 100644 --- a/pkgs/by-name/_1/_1password-gui/linux.nix +++ b/pkgs/by-name/_1/_1password-gui/linux.nix @@ -153,4 +153,6 @@ stdenv.mkDerivation { # https://1password.community/discussion/comment/624011/#Comment_624011 #--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" ''; + + passthru.updateScript = ./update.sh; } diff --git a/pkgs/by-name/_1/_1password-gui/package.nix b/pkgs/by-name/_1/_1password-gui/package.nix index e4a9866ff3f2..b1f68bf68035 100644 --- a/pkgs/by-name/_1/_1password-gui/package.nix +++ b/pkgs/by-name/_1/_1password-gui/package.nix @@ -11,18 +11,18 @@ let pname = "1password"; - versions = builtins.fromJSON (builtins.readFile ./versions.json); - hostOs = if stdenv.hostPlatform.isLinux then "linux" else "darwin"; - version = versions."${channel}-${hostOs}" or (throw "unknown channel-os ${channel}-${hostOs}"); - + hostOs = stdenv.hostPlatform.parsed.kernel.name; + hostArch = stdenv.hostPlatform.parsed.cpu.name; sources = builtins.fromJSON (builtins.readFile ./sources.json); + sourcesChan = sources.${channel} or (throw "unsupported channel ${channel}"); + sourcesChanOs = sourcesChan.${hostOs} or (throw "unsupported OS ${hostOs}"); + sourcesChanOsArch = + sourcesChanOs.sources.${hostArch} or (throw "unsupported architecture ${hostArch}"); + + inherit (sourcesChanOs) version; src = fetchurl { - inherit - (sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}")) - url - hash - ; + inherit (sourcesChanOsArch) url hash; }; meta = { @@ -37,7 +37,12 @@ let sebtm bdd ]; - platforms = builtins.attrNames sources.${channel}; + platforms = [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-linux" + "aarch64-darwin" + ]; mainProgram = "1password"; }; diff --git a/pkgs/by-name/_1/_1password-gui/sources.json b/pkgs/by-name/_1/_1password-gui/sources.json index ef4f2c8ee395..60b0a7e93b46 100644 --- a/pkgs/by-name/_1/_1password-gui/sources.json +++ b/pkgs/by-name/_1/_1password-gui/sources.json @@ -1,38 +1,58 @@ { "stable": { - "x86_64-linux": { - "url": "https://downloads.1password.com/linux/tar/stable/x86_64/1password-8.10.78.x64.tar.gz", - "hash": "sha256-COmXSjbCetPsbm40OrWGVtULPheEgnHEO0ZcIgWaG1w=" + "linux": { + "version": "8.10.78", + "sources": { + "x86_64": { + "url": "https://downloads.1password.com/linux/tar/stable/x86_64/1password-8.10.78.x64.tar.gz", + "hash": "sha256-COmXSjbCetPsbm40OrWGVtULPheEgnHEO0ZcIgWaG1w=" + }, + "aarch64": { + "url": "https://downloads.1password.com/linux/tar/stable/aarch64/1password-8.10.78.arm64.tar.gz", + "hash": "sha256-diy7VhKRluSnVSR35Ogamf9RDHdqxSJifLOOYmMrJHE=" + } + } }, - "aarch64-linux": { - "url": "https://downloads.1password.com/linux/tar/stable/aarch64/1password-8.10.78.arm64.tar.gz", - "hash": "sha256-diy7VhKRluSnVSR35Ogamf9RDHdqxSJifLOOYmMrJHE=" - }, - "x86_64-darwin": { - "url": "https://downloads.1password.com/mac/1Password-8.10.78-x86_64.zip", - "hash": "sha256-8fbjEc/Z0xCdXq/uHp4bQE5Js5hNLbVCRZxnepUdLUs=" - }, - "aarch64-darwin": { - "url": "https://downloads.1password.com/mac/1Password-8.10.78-aarch64.zip", - "hash": "sha256-x03dZ/eVrvFcbese1cBAvyJKwtWe6rOcgytn0OsEFDQ=" + "darwin": { + "version": "8.10.78", + "sources": { + "x86_64": { + "url": "https://downloads.1password.com/mac/1Password-8.10.78-x86_64.zip", + "hash": "sha256-8fbjEc/Z0xCdXq/uHp4bQE5Js5hNLbVCRZxnepUdLUs=" + }, + "aarch64": { + "url": "https://downloads.1password.com/mac/1Password-8.10.78-aarch64.zip", + "hash": "sha256-x03dZ/eVrvFcbese1cBAvyJKwtWe6rOcgytn0OsEFDQ=" + } + } } }, "beta": { - "x86_64-linux": { - "url": "https://downloads.1password.com/linux/tar/beta/x86_64/1password-8.10.80-18.BETA.x64.tar.gz", - "hash": "sha256-X2Wu/dQQ7fv+tTAU2/70S38wL6WdJuc/DXWoiHZvSP4=" + "linux": { + "version": "8.10.80-18.BETA", + "sources": { + "x86_64": { + "url": "https://downloads.1password.com/linux/tar/beta/x86_64/1password-8.10.80-18.BETA.x64.tar.gz", + "hash": "sha256-X2Wu/dQQ7fv+tTAU2/70S38wL6WdJuc/DXWoiHZvSP4=" + }, + "aarch64": { + "url": "https://downloads.1password.com/linux/tar/beta/aarch64/1password-8.10.80-18.BETA.arm64.tar.gz", + "hash": "sha256-52aRg6QD/fKOzOHoG88q8VNJIizxnISFnpxek7bJ05w=" + } + } }, - "aarch64-linux": { - "url": "https://downloads.1password.com/linux/tar/beta/aarch64/1password-8.10.80-18.BETA.arm64.tar.gz", - "hash": "sha256-52aRg6QD/fKOzOHoG88q8VNJIizxnISFnpxek7bJ05w=" - }, - "x86_64-darwin": { - "url": "https://downloads.1password.com/mac/1Password-8.10.80-18.BETA-x86_64.zip", - "hash": "sha256-kUU+nm19DmdY8ZG6d+EJFQXcCy/BOauXh83suQLSvz0=" - }, - "aarch64-darwin": { - "url": "https://downloads.1password.com/mac/1Password-8.10.80-18.BETA-aarch64.zip", - "hash": "sha256-eZG0QaB5NRwRCYcmlfZA/HTceLq7eUzR+AvzDeOrzAY=" + "darwin": { + "version": "8.10.80-18.BETA", + "sources": { + "x86_64": { + "url": "https://downloads.1password.com/mac/1Password-8.10.80-18.BETA-x86_64.zip", + "hash": "sha256-kUU+nm19DmdY8ZG6d+EJFQXcCy/BOauXh83suQLSvz0=" + }, + "aarch64": { + "url": "https://downloads.1password.com/mac/1Password-8.10.80-18.BETA-aarch64.zip", + "hash": "sha256-eZG0QaB5NRwRCYcmlfZA/HTceLq7eUzR+AvzDeOrzAY=" + } + } } } } diff --git a/pkgs/by-name/_1/_1password-gui/update-sources.py b/pkgs/by-name/_1/_1password-gui/update-sources.py new file mode 100755 index 000000000000..f987d3fa3c5c --- /dev/null +++ b/pkgs/by-name/_1/_1password-gui/update-sources.py @@ -0,0 +1,122 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python3 -p python3 gnupg +import json +import os +import shutil +import subprocess +import sys +import tempfile +from collections import OrderedDict + +DOWNLOADS_BASE_URL = "https://downloads.1password.com" +OP_PGP_KEYID = "3FEF9748469ADBE15DA7CA80AC2D62742012EA22" + + +class Sources(OrderedDict): + def __init__(self): + self._jsonfp = open("sources.json", "r+") + self.update(json.load(self._jsonfp)) + self._jsonfp.seek(0, os.SEEK_SET) + + def persist(self): + json.dump(self, self._jsonfp, indent=2) + self._jsonfp.write("\n") # keep fmt.check happy + + +class GPG: + def __new__(cls): + if not hasattr(cls, "_instance"): + cls._instance = super().__new__(cls) + return cls._instance + + def __init__(self): + if hasattr(self, "gnupghome"): + return + + self.gpg = shutil.which("gpg") + self.gpgv = shutil.which("gpgv") + self.gnupghome = tempfile.mkdtemp(prefix="1password-gui-gnupghome.") + self.env = {"GNUPGHOME": self.gnupghome} + self._run( + self.gpg, + "--no-default-keyring", + "--keyring", + "trustedkeys.kbx", + "--keyserver", + "keyserver.ubuntu.com", + "--receive-keys", + OP_PGP_KEYID, + ) + + def __del__(self): + shutil.rmtree(self.gnupghome) + + def _run(self, *args): + try: + subprocess.run(args, env=self.env, check=True, capture_output=True) + except subprocess.CalledProcessError as cpe: + print(cpe.stderr, file=sys.stderr) + raise SystemExit(f"gpg error: {cpe.cmd}") + + def verify(self, sigfile, datafile): + return self._run(self.gpgv, sigfile, datafile) + + +def nix_store_prefetch(url): + nix = shutil.which("nix") + cp = subprocess.run( + [nix, "store", "prefetch-file", "--json", url], check=True, capture_output=True + ) + out = json.loads(cp.stdout) + + return out["storePath"], out["hash"] + + +def mk_url(channel, os, version, arch): + if os == "linux": + arch_alias = {"x86_64": "x64", "aarch64": "arm64"}[arch] + path = f"linux/tar/{channel}/{arch}/1password-{version}.{arch_alias}.tar.gz" + elif os == "darwin": + path = f"mac/1Password-{version}-{arch}.zip" + else: + raise SystemExit(f"update-sources.py: unsupported OS {os}") + + return f"{DOWNLOADS_BASE_URL}/{path}" + + +def download(channel, os, version, arch): + url = mk_url(channel, os, version, arch) + store_path_tarball, hash = nix_store_prefetch(url) + + # Linux release tarballs come with detached PGP signatures. + if os == "linux": + store_path_sig, _ = nix_store_prefetch(url + ".sig") + GPG().verify(store_path_sig, store_path_tarball) + + return url, hash + + +def main(args): + """Gets called with args in `channel/os/version` format. + + e.g.: + update-sources.py stable/linux/8.10.80 beta/linux/8.10.82-12.BETA + """ + sources = Sources() + + for triplet in args[1:]: + channel, os, version = triplet.split("/") + release = sources[channel][os] + if release["version"] == version: + continue + + release["version"] = version + for arch in release["sources"]: + url, hash = download(channel, os, version, arch) + release["sources"][arch].update({"url": url, "hash": hash}) + + sources.persist() + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/pkgs/by-name/_1/_1password-gui/update.sh b/pkgs/by-name/_1/_1password-gui/update.sh index 1d31ef972f76..07fc726e2f74 100755 --- a/pkgs/by-name/_1/_1password-gui/update.sh +++ b/pkgs/by-name/_1/_1password-gui/update.sh @@ -1,84 +1,118 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p jq gnupg +#!nix-shell -i bash -p jq curl #shellcheck shell=bash - set -euo pipefail +# For Linux version checks we rely on Repology API to check 1Password managed Arch User Repository. +REPOLOGY_PROJECT_URI="https://repology.org/api/v1/project/1password" + +# For Darwin version checks we query the same endpoint 1Password 8 for Mac queries. +# This is the base URI. For stable channel an additional path of "N", for beta channel, "Y" is required. +APP_UPDATES_URI_BASE="https://app-updates.agilebits.com/check/2/99/aarch64/OPM8/en/0/A1" + +CURL=( + "curl" "--silent" "--show-error" "--fail" + "--proto" "=https" # enforce https + "--tlsv1.2" # do not accept anything below tls 1.2 + "-H" "user-agent: nixpkgs#_1password-gui update.sh" # repology requires a descriptive user-agent +) + +JQ=( + "jq" + "--raw-output" + "--exit-status" # exit non-zero if no output is produced +) + + +read_local_versions() { + local channel="$1" + + while IFS='=' read -r key value; do + local_versions["${key}"]="${value}" + done < <(jq -r --arg channel "${channel}" ' + .[$channel] | to_entries[] | .key as $os | .value.version as $version | + "\($channel)/\($os)=\($version)" + ' sources.json) +} + +read_remote_versions() { + local channel="$1" + + if [[ ${channel} == "stable" ]]; then + remote_versions["stable/linux"]=$( + "${CURL[@]}" "${REPOLOGY_PROJECT_URI}" \ + | "${JQ[@]}" '.[] | select(.repo == "aur" and .srcname == "1password" and .status == "newest") | .version' + ) + + remote_versions["stable/darwin"]=$( + "${CURL[@]}" "${APP_UPDATES_URI_BASE}/N" \ + | "${JQ[@]}" 'select(.available == "1") | .version' + ) + else + remote_versions["beta/linux"]=$( + # AUR version string uses underscores instead of dashes for betas. + # We fix that with a `sub` in jq query. + "${CURL[@]}" "${REPOLOGY_PROJECT_URI}" \ + | "${JQ[@]}" '.[] | select(.repo == "aur" and .srcname == "1password-beta") | .version | sub("_"; "-")' + ) + + remote_versions["beta/darwin"]=$( + "${CURL[@]}" "${APP_UPDATES_URI_BASE}/Y" \ + | "${JQ[@]}" 'select(.available == "1") | .version' + ) + fi +} + +render_versions_json() { + local key value + + for key in "${!local_versions[@]}"; do + value="${local_versions[${key}]}" + echo "${key}" + echo "${value}" + done \ + | jq -nR 'reduce inputs as $i ({}; . + { $i: input })' +} + + cd -- "$(dirname "${BASH_SOURCE[0]}")" -mk_url() { - local \ - base_url="https://downloads.1password.com" \ - os="$1" \ - channel="$2" \ - arch="$3" \ - version="$4" +attr_path=${UPDATE_NIX_ATTR_PATH} +case "${attr_path}" in + _1password-gui) channel="stable" ;; + _1password-gui-beta) channel="beta" ;; + *) + echo "Unknown attribute path ${attr_path}" >&2 + exit 1 +esac - if [[ ${os} == "linux" ]]; then - if [[ ${arch} == "x86_64" ]]; then - ext="x64.tar.gz" - else - ext="arm64.tar.gz" - fi - url="${base_url}/${os}/tar/${channel}/${arch}/1password-${version}.${ext}" - else - ext="${arch}.zip" - url="${base_url}/mac/1Password-${version}-${ext}" +declare -A local_versions remote_versions +declare -a new_version_available=() +read_local_versions "${channel}" +read_remote_versions "${channel}" +for i in "${!remote_versions[@]}"; do + if [[ "${local_versions[$i]}" != "${remote_versions[$i]}" ]]; then + old_version="${local_versions[$i]}" + new_version="${remote_versions[$i]}" + new_version_available+=("$i/$new_version") fi - - echo "${url}" -} - -cleanup() { - if [[ -d ${TMP_GNUPGHOME-} ]]; then - rm -r "${TMP_GNUPGHOME}" - fi - - if [[ -f ${JSON_HEAP-} ]]; then - rm "${JSON_HEAP}" - fi -} - -trap cleanup EXIT - -# Get channel versions from versions.json -declare -A versions -while IFS='=' read -r key value; do - versions["${key}"]="${value}" -done < <(jq -r 'to_entries[] | "\(.key)=\(.value)"' versions.json) - -TMP_GNUPGHOME=$(mktemp -dt 1password-gui.gnupghome.XXXXXX) -export GNUPGHOME="${TMP_GNUPGHOME}" -gpg --no-default-keyring --keyring trustedkeys.kbx \ - --keyserver keyserver.ubuntu.com \ - --receive-keys 3FEF9748469ADBE15DA7CA80AC2D62742012EA22 - -JSON_HEAP=$(mktemp -t 1password-gui.jsonheap.XXXXXX) -for channel in stable beta; do - for os in linux darwin; do - for arch in x86_64 aarch64; do - version="${versions[${channel}-${os}]}" - url=$(mk_url ${os} ${channel} ${arch} ${version}) - nix store prefetch-file --json "${url}" | jq " - { - \"${channel}\": { - \"${arch}-${os}\": { - \"url\": \"${url}\", - \"hash\": .hash, - \"storePath\": .storePath - } - } - }" >> "${JSON_HEAP}" - - # For some reason 1Password PGP signs only Linux binaries. - if [[ ${os} == "linux" ]]; then - gpgv \ - $(nix store prefetch-file --json "${url}.sig" | jq -r .storePath) \ - $(jq -r --slurp ".[-1].[].[].storePath" "${JSON_HEAP}") - fi - done - done done -# Combine heap of hash+url objects into a single JSON object. -jq --slurp 'reduce .[] as $x ({}; . * $x) | del (.[].[].storePath)' "${JSON_HEAP}" > sources.json +if [[ ${#new_version_available[@]} -eq 0 ]]; then + # up to date + exit +fi + +./update-sources.py "${new_version_available[@]}" +cat < Date: Sat, 14 Jun 2025 21:16:09 +0000 Subject: [PATCH 39/82] dotnet-ef: 9.0.5 -> 9.0.6 --- pkgs/by-name/do/dotnet-ef/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/do/dotnet-ef/package.nix b/pkgs/by-name/do/dotnet-ef/package.nix index 2d7a01bd194e..dc871ddcf096 100644 --- a/pkgs/by-name/do/dotnet-ef/package.nix +++ b/pkgs/by-name/do/dotnet-ef/package.nix @@ -2,9 +2,9 @@ buildDotnetGlobalTool { pname = "dotnet-ef"; - version = "9.0.5"; + version = "9.0.6"; - nugetHash = "sha256-Mu+MlsjH/qa4kMb7z/TuG1lSVSKPX9j9S4mJLVRZ2+E="; + nugetHash = "sha256-dHOGvqdIfYhuAz7JwQoG/4uJNE9wpfI/dnL4zj3lD6A="; meta = { description = "Tools to help with design-time development tasks"; From f16b695b987debbb70f7007ce1ca42b0f8cf685d Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 15 Jun 2025 08:34:43 +0200 Subject: [PATCH 40/82] smplayer: fix hash after upstream replaced their git tag Our smplayer package received a normal update with commit https://github.com/NixOS/nixpkgs/commit/8d99101d35fdfbbff0465dd899334321eee61363 . After that commit and a corresponding pull request got created with https://github.com/NixOS/nixpkgs/pull/415020 , upstream apparently added a new commit https://github.com/smplayer-dev/smplayer/commit/b62faa90efb6c6be8e0938a42e70fbfb3916feb6 to their repository, and replaced the git tag (release tag) https://github.com/smplayer-dev/smplayer/releases/tag/v25.6.0 . This tag previously pointed to https://github.com/smplayer-dev/smplayer/commit/4a27de33a4cab71215002f138daab1e3c69ca7ef for which the old nixpkgs hash is valid. Due to the invalidation of the old git tag, we have to adapt our source hash. --- pkgs/by-name/sm/smplayer/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/sm/smplayer/package.nix b/pkgs/by-name/sm/smplayer/package.nix index 8df2beda185c..437f21ab0239 100644 --- a/pkgs/by-name/sm/smplayer/package.nix +++ b/pkgs/by-name/sm/smplayer/package.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "smplayer-dev"; repo = "smplayer"; rev = "v${finalAttrs.version}"; - hash = "sha256-dyUT8PdvsFZsEZQNSsC2TQd90KOrY9FIb9Do+JKdUHs="; + hash = "sha256-txGz6v9hkvnrmVmBHsi1B2eC/iNT1tg4dU5AcMsSCic="; }; nativeBuildInputs = [ From 3420cab114a9c49a792b7103c3c1bcee7d64b0bc Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 15 Jun 2025 08:46:37 +0200 Subject: [PATCH 41/82] smplayer: fetchFromGitHub: rev -> tag Inspired by https://github.com/NixOS/nixpkgs/commit/cb9f9a1e5a51a87d59b373db7016cee1608debd5 --- pkgs/by-name/sm/smplayer/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/sm/smplayer/package.nix b/pkgs/by-name/sm/smplayer/package.nix index 437f21ab0239..6c4489332716 100644 --- a/pkgs/by-name/sm/smplayer/package.nix +++ b/pkgs/by-name/sm/smplayer/package.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "smplayer-dev"; repo = "smplayer"; - rev = "v${finalAttrs.version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-txGz6v9hkvnrmVmBHsi1B2eC/iNT1tg4dU5AcMsSCic="; }; @@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: { options of MPlayer, SMPlayer adds other interesting features like the possibility to play Youtube videos or download subtitles. ''; - changelog = "https://github.com/smplayer-dev/smplayer/releases/tag/${finalAttrs.src.rev}"; + changelog = "https://github.com/smplayer-dev/smplayer/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.gpl3Plus; maintainers = with lib.maintainers; [ ]; platforms = lib.platforms.linux; From 73a2a011949cd6f206038487089a4fcdc2b5e073 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 26 May 2025 17:26:21 +0000 Subject: [PATCH 42/82] python3Packages.tree-sitter-markdown: 0.4.1 -> 0.5.0 --- .../python-modules/tree-sitter-markdown/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/tree-sitter-markdown/default.nix b/pkgs/development/python-modules/tree-sitter-markdown/default.nix index 394b5467a537..eacbdcaf2675 100644 --- a/pkgs/development/python-modules/tree-sitter-markdown/default.nix +++ b/pkgs/development/python-modules/tree-sitter-markdown/default.nix @@ -9,14 +9,14 @@ buildPythonPackage rec { pname = "tree-sitter-markdown"; - version = "0.4.1"; + version = "0.5.0"; pyproject = true; src = fetchFromGitHub { owner = "tree-sitter-grammars"; repo = "tree-sitter-markdown"; tag = "v${version}"; - hash = "sha256-Oe2iL5b1Cyv+dK0nQYFNLCCOCe+93nojxt6ukH2lEmU="; + hash = "sha256-I9KDE1yZce8KIGPLG5tmv5r/NCWwN95R6fIyvGdx+So="; }; build-system = [ @@ -39,7 +39,7 @@ buildPythonPackage rec { meta = { description = "Markdown grammar for tree-sitter"; homepage = "https://github.com/tree-sitter-grammars/tree-sitter-markdown"; - changelog = "https://github.com/tree-sitter-grammars/tree-sitter-markdown/releases/tag/v${version}"; + changelog = "https://github.com/tree-sitter-grammars/tree-sitter-markdown/releases/tag/${src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ GaetanLepage ]; }; From 0f5571ff272416ec1839fb3ebf8dfde29b84c05d Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 15 Jun 2025 09:32:18 +0200 Subject: [PATCH 43/82] python3Packages.textual: Skip failing tests https://github.com/Textualize/textual/issues/5868 --- pkgs/development/python-modules/textual/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/python-modules/textual/default.nix b/pkgs/development/python-modules/textual/default.nix index 30396df98ae1..4642d29e4d94 100644 --- a/pkgs/development/python-modules/textual/default.nix +++ b/pkgs/development/python-modules/textual/default.nix @@ -77,6 +77,12 @@ buildPythonPackage rec { disabledTests = [ # Assertion issues "test_textual_env_var" + + # Fail since tree-sitter-markdown was updated to 0.5.0 + # ValueError: Incompatible Language version 15. Must be between 13 and 14 + # https://github.com/Textualize/textual/issues/5868 + "test_setting_builtin_language_via_attribute" + "test_setting_builtin_language_via_constructor" ]; pytestFlagsArray = [ From 32a1bd9f490abdc5a9f56a23f4b40a7132b7feae Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 15 Jun 2025 11:58:34 +0000 Subject: [PATCH 44/82] vscode-extensions.cweijan.dbclient-jdbc: 1.4.4 -> 1.4.6 --- pkgs/applications/editors/vscode/extensions/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix index 0f798603007c..d7481932e116 100644 --- a/pkgs/applications/editors/vscode/extensions/default.nix +++ b/pkgs/applications/editors/vscode/extensions/default.nix @@ -1165,8 +1165,8 @@ let mktplcRef = { name = "dbclient-jdbc"; publisher = "cweijan"; - version = "1.4.4"; - hash = "sha256-hrymsnprfrRQeS/WRGqdV3MNPw+C+iJCcXF1IfNjGWE="; + version = "1.4.6"; + hash = "sha256-989egeJlpJ2AfZra9VSQDQ8e+nQCa2sfoUeti674ecA="; }; meta = { description = "JDBC Adapter For Database Client"; From a913e1fa86c348cd590b736e9957c0f1660a7bf1 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 15 Jun 2025 13:33:43 +0000 Subject: [PATCH 45/82] vscode-extensions.stylelint.vscode-stylelint: 1.5.1 -> 1.5.3 --- pkgs/applications/editors/vscode/extensions/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix index e0ba1ade18cd..b4a3db1daf47 100644 --- a/pkgs/applications/editors/vscode/extensions/default.nix +++ b/pkgs/applications/editors/vscode/extensions/default.nix @@ -4621,8 +4621,8 @@ let mktplcRef = { name = "vscode-stylelint"; publisher = "stylelint"; - version = "1.5.1"; - hash = "sha256-Sbp2zy/6PcsMlUPe94spm3JrWxBYHfd7py3f4rb+0G4="; + version = "1.5.3"; + hash = "sha256-fgMs9/gYhhHCkiKJX5rDRbiXy6gxvmLhU6blNxEoNc8="; }; meta = { description = "Official Stylelint extension for Visual Studio Code"; From 5b6dfa92a9b7ca0ad937e8cb215ca4bd4fcc6406 Mon Sep 17 00:00:00 2001 From: Oscar Le Dauphin Date: Sun, 15 Jun 2025 13:26:05 +0200 Subject: [PATCH 46/82] steel: fix update script make it update the cargoHash too --- pkgs/by-name/st/steel/package.nix | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/st/steel/package.nix b/pkgs/by-name/st/steel/package.nix index 2fe3359669a1..56b11cd23d81 100644 --- a/pkgs/by-name/st/steel/package.nix +++ b/pkgs/by-name/st/steel/package.nix @@ -11,10 +11,7 @@ sqlite, zlib, - unstableGitUpdater, - writeShellScript, - yq, - + nix-update-script, includeLSP ? true, includeForge ? true, }: @@ -95,20 +92,8 @@ rustPlatform.buildRustPackage { STEEL_HOME = "${placeholder "out"}/lib/steel"; }; - passthru.updateScript = unstableGitUpdater { - tagConverter = writeShellScript "steel-tagConverter.sh" '' - export PATH="${ - lib.makeBinPath [ - curl - yq - ] - }:$PATH" - - version=$(curl -s https://raw.githubusercontent.com/mattwparas/steel/refs/heads/master/Cargo.toml | tomlq -r .workspace.package.version) - - read -r tag - test "$tag" = "0" && tag="$version"; echo "$tag" - ''; + passthru.updateScript = nix-update-script { + extraArgs = [ "--version=branch" ]; }; meta = { From 82f877b9fe30cb542a390fb05328b72e28bd1b80 Mon Sep 17 00:00:00 2001 From: Tom Herbers Date: Sun, 15 Jun 2025 22:08:12 +0200 Subject: [PATCH 47/82] garage: 1.1.0 -> 1.2.0 --- pkgs/tools/filesystems/garage/default.nix | 10 +++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/filesystems/garage/default.nix b/pkgs/tools/filesystems/garage/default.nix index 2a7e4d5e5710..a33b3587185e 100644 --- a/pkgs/tools/filesystems/garage/default.nix +++ b/pkgs/tools/filesystems/garage/default.nix @@ -131,17 +131,17 @@ rec { cargoPatches = [ ./update-time.patch ]; }; - garage_1_1_0 = generic { - version = "1.1.0"; - hash = "sha256-ysf/GYR39trXTPRdw8uB6E4YDp4nAR8dbU9k9rQTxz0="; - cargoHash = "sha256-SkDr/e9YZ3raTGucaiv/RV2zF9tEDIeqZeri6Xk3xEU="; + garage_1_2_0 = generic { + version = "1.2.0"; + hash = "sha256-JoOwCbChSL7mjegnLHOH2Abfmsnw9BwNsjFj7nqBN6o="; + cargoHash = "sha256-vcvD0Fn/etnAuXrM3+rj16cqpEmW2nzRmrjXsftKTFE="; }; garage_0_8 = garage_0_8_7; garage_0_9 = garage_0_9_4; - garage_1_x = garage_1_1_0; + garage_1_x = garage_1_2_0; garage = garage_1_x; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e1ab19c26110..610e28922e1c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3433,7 +3433,7 @@ with pkgs; garage_0_9 garage_0_8_7 garage_0_9_4 - garage_1_1_0 + garage_1_2_0 garage_1_x ; From 4d81e28f3ac536d6b68834ef0bfae1b3d9a52157 Mon Sep 17 00:00:00 2001 From: Oscar Le Dauphin Date: Sun, 15 Jun 2025 14:43:30 +0200 Subject: [PATCH 48/82] steel: 0.6.0-unstable-2025-04-17 -> 0-unstable-2025-06-15 --- pkgs/by-name/st/steel/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/st/steel/package.nix b/pkgs/by-name/st/steel/package.nix index 56b11cd23d81..103eea30bb3b 100644 --- a/pkgs/by-name/st/steel/package.nix +++ b/pkgs/by-name/st/steel/package.nix @@ -17,17 +17,17 @@ }: rustPlatform.buildRustPackage { pname = "steel"; - version = "0.6.0-unstable-2025-04-17"; + version = "0-unstable-2025-06-15"; src = fetchFromGitHub { owner = "mattwparas"; repo = "steel"; - rev = "2f28ab10523198726d343257d29d892864e897b0"; - hash = "sha256-GcbuuaevPK5EOh0/IVgoL2MPC9ukDc8VXkdgbPX4quE="; + rev = "123adb314702d6520f8ab04115e79308d2400c38"; + hash = "sha256-o1RZBlAGUht0Q7UVF+yPlrWW7B016fpBBcoaxuzRQo4="; }; useFetchCargoVendor = true; - cargoHash = "sha256-PWE64CwHCQWvOGeOqdsqX6rAruWlnCwsQpcxS221M3g="; + cargoHash = "sha256-/vPDVVOhLO7mnULyU8QLW+YHh+kGd+BSiPi55jrOWps="; nativeBuildInputs = [ curl From 2b9c445c75e9952f4c285215f41de9d004ab9c6e Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 15 Jun 2025 20:13:44 +0000 Subject: [PATCH 49/82] vscode-extensions.rooveterinaryinc.roo-cline: 3.19.3 -> 3.20.3 --- .../vscode/extensions/rooveterinaryinc.roo-cline/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/vscode/extensions/rooveterinaryinc.roo-cline/default.nix b/pkgs/applications/editors/vscode/extensions/rooveterinaryinc.roo-cline/default.nix index 9cf7d817b7b6..4b3b1556c561 100644 --- a/pkgs/applications/editors/vscode/extensions/rooveterinaryinc.roo-cline/default.nix +++ b/pkgs/applications/editors/vscode/extensions/rooveterinaryinc.roo-cline/default.nix @@ -8,8 +8,8 @@ vscode-utils.buildVscodeMarketplaceExtension { mktplcRef = { publisher = "RooVeterinaryInc"; name = "roo-cline"; - version = "3.19.3"; - hash = "sha256-7GZD7oCrkGcG7B/pgXK92hL0QyyodmqyxOcRhTt5LMs="; + version = "3.20.3"; + hash = "sha256-YCO8TjUZ2IpjTkDYf/4wQgsqGEvn2bt4+yVwWlb2eUQ="; }; passthru.updateScript = vscode-extension-update-script { }; From c66d31a70a4764eecb1236da6174bbd38eac2822 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 26 May 2025 12:19:01 +0200 Subject: [PATCH 50/82] ccextractor: 0.94-unstable-2024-08-12 -> 0.94-unstable-2025-05-20 --- pkgs/by-name/cc/ccextractor/package.nix | 8 ++++---- pkgs/by-name/cc/ccextractor/use-rsmpeg-0.15.patch | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/cc/ccextractor/package.nix b/pkgs/by-name/cc/ccextractor/package.nix index 7c8fbb886b86..923490264df7 100644 --- a/pkgs/by-name/cc/ccextractor/package.nix +++ b/pkgs/by-name/cc/ccextractor/package.nix @@ -30,13 +30,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "ccextractor"; - version = "0.94-unstable-2024-08-12"; + version = "0.94-unstable-2025-05-20"; src = fetchFromGitHub { owner = "CCExtractor"; repo = "ccextractor"; - rev = "92f2ce0fa026b01fb07db6751210e6bd8c8944d3"; - hash = "sha256-bp7T9uJK4bauR2Co4lKqqnM6oGa3WZ+1toEKmzOx4mI="; + rev = "407d0f4e93611c5b0ceb14b7fc01d4a4c2e90433"; + hash = "sha256-BfsQmCNB4HRafqJ3pC2ECiwhOgwKuIqiLjr2/bvHr7Q="; }; patches = [ @@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: { cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) src cargoRoot; patches = [ ./use-rsmpeg-0.15.patch ]; - hash = "sha256-7v3gQghByUDWZLJRRGa/7X2ivUumirq6BbexNQcCXCk="; + hash = "sha256-68Y8nzPHxhVIRHoPXOy9tc71177lCBuOf//z3cqyDGQ="; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/cc/ccextractor/use-rsmpeg-0.15.patch b/pkgs/by-name/cc/ccextractor/use-rsmpeg-0.15.patch index 89af3884639d..2f5fe1eac532 100644 --- a/pkgs/by-name/cc/ccextractor/use-rsmpeg-0.15.patch +++ b/pkgs/by-name/cc/ccextractor/use-rsmpeg-0.15.patch @@ -34,10 +34,9 @@ index 4c1e73dcf0..68502915dc 100644 +++ b/src/rust/Cargo.toml @@ -15,7 +15,7 @@ env_logger = "0.8.4" - iconv = "0.1.1" - palette = "0.6.0" --rsmpeg = { version = "0.14.1", optional = true, features = [ + palette = "0.6.1" +-rsmpeg = { version = "0.14.2", optional = true, features = [ +rsmpeg = { version = "0.15.1", optional = true, features = [ "link_system_ffmpeg", ] } - tesseract-sys = { version = "0.5.14", optional = true, default-features = false } + tesseract-sys = { version = "0.5.15", optional = true, default-features = false } From d768d6deac1e9f951cf3142017dcb7f4a0cc7384 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 30 Jan 2025 14:55:13 +0100 Subject: [PATCH 51/82] python312Packages.torchao: init at 0.11.0 --- .../python-modules/torchao/default.nix | 100 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 102 insertions(+) create mode 100644 pkgs/development/python-modules/torchao/default.nix diff --git a/pkgs/development/python-modules/torchao/default.nix b/pkgs/development/python-modules/torchao/default.nix new file mode 100644 index 000000000000..66d95e175d9b --- /dev/null +++ b/pkgs/development/python-modules/torchao/default.nix @@ -0,0 +1,100 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + torch, + + # tests + bitsandbytes, + expecttest, + fire, + pytest-xdist, + pytestCheckHook, + parameterized, + tabulate, + transformers, + unittest-xml-reporting, +}: + +buildPythonPackage rec { + pname = "ao"; + version = "0.11.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pytorch"; + repo = "ao"; + tag = "v${version}"; + hash = "sha256-CNb9xaubOmIRanLq3TM4sBbszTcVK/WFpcq/sWpof44="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + torch + ]; + + env = { + USE_SYSTEM_LIBS = true; + }; + + # Otherwise, the tests are loading the python module from the source instead of the installed one + preCheck = '' + rm -rf torchao + ''; + + pythonImportsCheck = [ + "torchao" + ]; + + nativeCheckInputs = [ + bitsandbytes + expecttest + fire + parameterized + pytest-xdist + pytestCheckHook + tabulate + transformers + unittest-xml-reporting + ]; + + disabledTests = + [ + # Requires internet access + "test_on_dummy_distilbert" + + # FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/meta-llama/Llama-2-7b-chat-hf/model.pth' + "test_gptq_mt" + ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ + # RuntimeError: failed to initialize QNNPACK + "test_smooth_linear_cpu" + + # torch._inductor.exc.InductorError: LoweringException: AssertionError: Expect L1_cache_size > 0 but got 0 + "test_int8_weight_only_quant_with_freeze_0_cpu" + "test_int8_weight_only_quant_with_freeze_1_cpu" + "test_int8_weight_only_quant_with_freeze_2_cpu" + + # FileNotFoundError: [Errno 2] No such file or directory: 'test.pth' + "test_save_load_int4woqtensors_2_cpu" + "test_save_load_int8woqtensors_0_cpu" + "test_save_load_int8woqtensors_1_cpu" + ]; + + meta = { + description = "PyTorch native quantization and sparsity for training and inference"; + homepage = "https://github.com/pytorch/ao"; + changelog = "https://github.com/pytorch/ao/releases/tag/v${version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 366ee388f55b..3b3d10934b38 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17793,6 +17793,8 @@ self: super: with self; { torchWithoutRocm = self.torch.override { rocmSupport = false; }; + torchao = callPackage ../development/python-modules/torchao { }; + torchaudio = callPackage ../development/python-modules/torchaudio { }; torchaudio-bin = callPackage ../development/python-modules/torchaudio/bin.nix { }; From 232f4cd18de51765ea4044115c6bac38656c945f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sun, 15 Jun 2025 23:10:27 +0000 Subject: [PATCH 52/82] spicedb: 1.44.0 -> 1.44.3 --- pkgs/servers/spicedb/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/spicedb/default.nix b/pkgs/servers/spicedb/default.nix index f79111b56fad..eb4f9dfe2160 100644 --- a/pkgs/servers/spicedb/default.nix +++ b/pkgs/servers/spicedb/default.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "spicedb"; - version = "1.44.0"; + version = "1.44.3"; src = fetchFromGitHub { owner = "authzed"; repo = "spicedb"; rev = "v${version}"; - hash = "sha256-7QWYqMAX3K16ITkDaVlrEzTH7uIaKDtZom04mBhPZS8="; + hash = "sha256-V/uUfysSHDtkZjRoJMI4qbfl1PuCE6pbwRhk6D14s60="; }; - vendorHash = "sha256-X+AQgn5aVIFOV+F8H8Byf1tsu7CVb0PwjzS8x5xn3l0="; + vendorHash = "sha256-Tdg9HOzH7N465QX7m65S7+HfT+sdgVpdTnHjhart1ec="; ldflags = [ "-X 'github.com/jzelinskie/cobrautil/v2.Version=${src.rev}'" From c862093d0de5e1066c80110927fc9aa925b2cbc6 Mon Sep 17 00:00:00 2001 From: Robbie Buxton <138501839+rbpdt@users.noreply.github.com> Date: Sun, 15 Jun 2025 21:36:14 -0400 Subject: [PATCH 53/82] python3Packages.torch: use addr2line from nix --- pkgs/development/python-modules/torch/source/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/python-modules/torch/source/default.nix b/pkgs/development/python-modules/torch/source/default.nix index b4a414b48d9d..6effc9ff55ca 100644 --- a/pkgs/development/python-modules/torch/source/default.nix +++ b/pkgs/development/python-modules/torch/source/default.nix @@ -46,6 +46,7 @@ # dependencies astunparse, + binutils, expecttest, filelock, fsspec, @@ -331,6 +332,10 @@ buildPythonPackage rec { # flag from cmakeFlags doesn't work, not clear why # setting it at the top of NNPACK's own CMakeLists does sed -i '2s;^;set(PYTHON_SIX_SOURCE_DIR ${six.src})\n;' third_party/NNPACK/CMakeLists.txt + + # Ensure that torch profiler unwind uses addr2line from nix + substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \ + --replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"' '' + lib.optionalString rocmSupport '' # https://github.com/facebookincubator/gloo/pull/297 From d6d28d68460756a66d5fbc32f198b9cbf7b03c96 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 04:47:57 +0000 Subject: [PATCH 54/82] pocketbase: 0.28.2 -> 0.28.3 --- pkgs/by-name/po/pocketbase/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/po/pocketbase/package.nix b/pkgs/by-name/po/pocketbase/package.nix index 62e002705757..25aee3b0b74d 100644 --- a/pkgs/by-name/po/pocketbase/package.nix +++ b/pkgs/by-name/po/pocketbase/package.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "pocketbase"; - version = "0.28.2"; + version = "0.28.3"; src = fetchFromGitHub { owner = "pocketbase"; repo = "pocketbase"; rev = "v${version}"; - hash = "sha256-R8sXa3Cs7GFRAs8/+wAoWteFYBUVsgVA+eJDKACb0k8="; + hash = "sha256-oFM2QcMxW+1iVUy7GzpNBtMQznq0vL7eeDiUhVPYCOM="; }; - vendorHash = "sha256-bTXxhHibKiu+btHhnktTpNycMJSzGekRJ+w9b1IwAQs="; + vendorHash = "sha256-hOB8MOfG+RHDJEP5DSDvSiphb+c86QySNEmRr8633cM="; # This is the released subpackage from upstream repo subPackages = [ "examples/base" ]; From da7ad28528291915719977847a63ceaf26619bb0 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 05:47:57 +0000 Subject: [PATCH 55/82] python3Packages.genie-partner-sdk: 1.0.4 -> 1.0.5 --- pkgs/development/python-modules/genie-partner-sdk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/genie-partner-sdk/default.nix b/pkgs/development/python-modules/genie-partner-sdk/default.nix index f55cff75cd6e..c61bd3a74a9c 100644 --- a/pkgs/development/python-modules/genie-partner-sdk/default.nix +++ b/pkgs/development/python-modules/genie-partner-sdk/default.nix @@ -9,7 +9,7 @@ buildPythonPackage rec { pname = "genie-partner-sdk"; - version = "1.0.4"; + version = "1.0.5"; pyproject = true; disabled = pythonOlder "3.11"; @@ -17,7 +17,7 @@ buildPythonPackage rec { src = fetchPypi { inherit version; pname = "genie_partner_sdk"; - hash = "sha256-DwbIe1pq1YKAA3hRlhYCVJ9xtvfxvoqLLjDSQicUKuw="; + hash = "sha256-JxsUaC7WgspUU9ngIc4GOjFr/lHjD2+5YlcLXtJH6LE="; }; nativeBuildInputs = [ hatchling ]; From eecf6d7895cf1a2c8fcd73a91685429306452cbc Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 06:27:21 +0000 Subject: [PATCH 56/82] alistral: 0.5.10 -> 0.5.11 --- pkgs/by-name/al/alistral/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/al/alistral/package.nix b/pkgs/by-name/al/alistral/package.nix index 1199b8f73079..1d587518d628 100644 --- a/pkgs/by-name/al/alistral/package.nix +++ b/pkgs/by-name/al/alistral/package.nix @@ -10,17 +10,17 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "alistral"; - version = "0.5.10"; + version = "0.5.11"; src = fetchFromGitHub { owner = "RustyNova016"; repo = "Alistral"; tag = "v${finalAttrs.version}"; - hash = "sha256-O19Btz6jLJJnCbAusRHKfUa6II8mofzifW+cbPOaHVI="; + hash = "sha256-wiNXwg6mC24nWwakA9cX8OYDOhghoEgm0yVR3Tmtod4="; }; useFetchCargoVendor = true; - cargoHash = "sha256-zQvPgigUQW9dpyLe7fgW8i9I4nm38bQKDLwezeSYx9Q="; + cargoHash = "sha256-M3nwa93vzVm+GtCdmBn/jqIvgJRcULw+8FFFLPmfbyg="; nativeBuildInputs = [ pkg-config From c31da5ac45e243bdfe6320a6c1d75da69ec17fa6 Mon Sep 17 00:00:00 2001 From: Muhammad Falak R Wani Date: Mon, 16 Jun 2025 12:02:05 +0530 Subject: [PATCH 57/82] difftastic: 0.63.0 -> 0.64.0 Diff: https://github.com/wilfred/difftastic/compare/refs/tags/0.63.0...0.64.0 Changelog: https://github.com/Wilfred/difftastic/blob/refs/tags/0.64.0/CHANGELOG.md Signed-off-by: Muhammad Falak R Wani --- pkgs/by-name/di/difftastic/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/di/difftastic/package.nix b/pkgs/by-name/di/difftastic/package.nix index b5753e0713f0..5f51ce0129d0 100644 --- a/pkgs/by-name/di/difftastic/package.nix +++ b/pkgs/by-name/di/difftastic/package.nix @@ -8,17 +8,17 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "difftastic"; - version = "0.63.0"; + version = "0.64.0"; src = fetchFromGitHub { owner = "wilfred"; repo = "difftastic"; tag = finalAttrs.version; - hash = "sha256-BxWCSkSeDyiiGBY2u0ahPrIhYq2lbujoPPtZGq/OkI0="; + hash = "sha256-XMvysYO6Kji9cbfGayB6wPVuNp0j2uXLHfZ9H+dBLt0="; }; useFetchCargoVendor = true; - cargoHash = "sha256-kIqaZ8truDivMV6uo1+j9bmXQReREZjHSr89ZvVDWCw="; + cargoHash = "sha256-1u3oUbqhwHXD90ld70pjK2XPJe5hpUbJtU78QpIjAE8="; # skip flaky tests checkFlags = [ "--skip=options::tests::test_detect_display_width" ]; From 6f12f662ae0945d734bac9d5bcc13709f66623ad Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sat, 14 Jun 2025 19:42:55 +0200 Subject: [PATCH 58/82] workflow/labels: switch to a scheduled trigger Instead of relying on workflow_run events, we now trigger the labeling workflow by schedule. This avoids all permission/secrets problems of running in the pull_request_review context - and also gets rid of the "waiting for approval to run workflows" button for new contributors that sometimes comes up right now. Also, it's more efficient. Previously, the labeling workflow would run on *any* pull_request_review event, which happens for all comments, too. So quite a few runs. This will cause a delay of up to 1 hour with the current settings until approval labels are set. Depending on how long the job normally runs we can adjust the frequency. The workflow is written in a way that will work no matter what the frequency ends up being, even when it's interrupted by transient GHA failures: It will always look at all PRs which were updated since the last time the workflow ran successfully. We also add the ability to run it manually via UI. This is useful: - When fixing bugs in the labeler workflow to run it all the way back to where the bug was introduced. - When introducing new labels, to get a head start for a reasonable amount of PRs immediately. Of course, the workflow is also still run directly after Eval itself. This is also the only case that the actions/labeler steps will run, since they depend on the `pull_request` context. --- .github/workflows/labels.yml | 167 +++++++++++++++++-------- .github/workflows/review-submitted.yml | 17 --- 2 files changed, 114 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/review-submitted.yml diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index a7e34775d6ea..f15d8b4a6dcb 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -6,16 +6,23 @@ name: "Label PR" on: + schedule: + - cron: '37 * * * *' workflow_call: - workflow_run: - workflows: - - Review dismissed - - Review submitted - types: [completed] + workflow_dispatch: + inputs: + updatedWithin: + description: 'Updated within [hours]' + type: number + required: false + default: 0 # everything since last run concurrency: - group: labels-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }} - cancel-in-progress: true + # This explicitly avoids using `run_id` for the concurrency key to make sure that only + # *one* non-PR run can run at a time. + group: labels-${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number }} + # PR- and manually-triggered runs will be cancelled, but scheduled runs will be queued. + cancel-in-progress: ${{ github.event_name != 'schedule' }} permissions: issues: write # needed to create *new* labels @@ -31,57 +38,111 @@ jobs: runs-on: ubuntu-24.04-arm if: "!contains(github.event.pull_request.title, '[skip treewide]')" steps: - - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - id: eval - with: - script: | - const run_id = (await github.rest.actions.listWorkflowRuns({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'eval.yml', - event: 'pull_request_target', - head_sha: context.payload.pull_request?.head.sha ?? context.payload.workflow_run.head_sha - })).data.workflow_runs[0]?.id - core.setOutput('run-id', run_id) + - name: Install dependencies + run: npm install @actions/artifact - - name: Download the comparison results - if: steps.eval.outputs.run-id - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 - with: - run-id: ${{ steps.eval.outputs.run-id }} - github-token: ${{ github.token }} - pattern: comparison - path: comparison - merge-multiple: true - - - name: Labels from eval - if: steps.eval.outputs.run-id && github.event_name != 'pull_request' + - name: Labels from API data and Eval results uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + env: + UPDATED_WITHIN: ${{ inputs.updatedWithin }} with: script: | + const path = require('node:path') + const { DefaultArtifactClient } = require('@actions/artifact') const { readFile } = require('node:fs/promises') - let pull_requests - if (context.payload.workflow_run) { - // PRs from forks don't have any PRs associated by default. - // Thus, we request the PR number with an API call *to* the fork's repo. - // Multiple pull requests can be open from the same head commit, either via - // different base branches or head branches. - const { head_repository, head_sha, repository } = context.payload.workflow_run - pull_requests = (await github.paginate(github.rest.repos.listPullRequestsAssociatedWithCommit, { - owner: head_repository.owner.login, - repo: head_repository.name, - commit_sha: head_sha - })).filter(pull_request => pull_request.base.repo.id == repository.id) - } else { - pull_requests = [ context.payload.pull_request ] + const artifactClient = new DefaultArtifactClient() + + if (process.env.UPDATED_WITHIN && !/^\d+$/.test(process.env.UPDATED_WITHIN)) + throw new Error('Please enter "updated within" as integer in hours.') + + const cutoff = new Date(await (async () => { + // Always run for Pull Request triggers, no cutoff since there will be a single + // response only anyway. 0 is the Unix epoch, so always smaller. + if (context.payload.pull_request?.number) return 0 + + // Manually triggered via UI when updatedWithin is set. Will fallthrough to the last + // option if the updatedWithin parameter is set to 0, which is the default. + const updatedWithin = Number.parseInt(process.env.UPDATED_WITHIN, 10) + if (updatedWithin) return new Date().getTime() - updatedWithin * 60 * 60 * 1000 + + // Normally a scheduled run, but could be workflow_dispatch, see above. Go back as far + // as the last successful run of this workflow to make sure we are not leaving anyone + // behind on GHA failures. + return (await github.rest.actions.listWorkflowRuns({ + ...context.repo, + workflow_id: 'labels.yml', + event: 'schedule', + status: 'success', + exclude_pull_requests: true + })).data.workflow_runs[0]?.created_at + })()) + core.info('cutoff timestamp: ' + cutoff.toISOString()) + + // To simplify this action's logic we fetch the pull_request data again below, even if + // we are already in a pull_request event's context and would have the data readily + // available. We do this by filtering the list of pull requests with head and base + // branch - there can only be a single open Pull Request for any such combination. + const prEventCondition = !context.payload.pull_request ? undefined : { + // "label" is in the format of `user:branch` or `org:branch` + head: context.payload.pull_request.head.label, + base: context.payload.pull_request.base.ref } - await Promise.all( - pull_requests.map(async (pull_request) => { + await github.paginate( + github.rest.pulls.list, + { + ...context.repo, + state: 'open', + sort: 'updated', + direction: 'desc', + ...prEventCondition + }, + async (response, done) => await Promise.all(response.data.map(async (pull_request) => { + const log = (k,v) => core.info(`PR #${pull_request.number} - ${k}: ${v}`) + + log('Last updated at', pull_request.updated_at) + if (new Date(pull_request.updated_at) < cutoff) return done() + + const run_id = (await github.rest.actions.listWorkflowRuns({ + ...context.repo, + workflow_id: 'eval.yml', + event: 'pull_request_target', + // For PR events, the workflow run is still in progress with this job itself. + status: prEventCondition ? 'in_progress' : 'success', + exclude_pull_requests: true, + head_sha: pull_request.head.sha + })).data.workflow_runs[0]?.id + + // Newer PRs might not have run Eval to completion, yet. We can skip them, because this + // job will be run as part of that Eval run anyway. + log('Last eval run', run_id) + if (!run_id) return; + + const artifact = (await github.rest.actions.listWorkflowRunArtifacts({ + ...context.repo, + run_id, + name: 'comparison' + })).data.artifacts[0] + + // Instead of checking the boolean artifact.expired, we will give us a minute to + // actually download the artifact in the next step and avoid that race condition. + log('Artifact expires at', artifact.expires_at) + if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return; + + await artifactClient.downloadArtifact(artifact.id, { + findBy: { + repositoryName: context.repo.repo, + repositoryOwner: context.repo.owner, + token: core.getInput('github-token') + }, + path: path.resolve('comparison'), + expectedHash: artifact.digest + }) + + // Shortcut for all issue endpoints related to labels const pr = { - owner: context.repo.owner, - repo: context.repo.repo, + ...context.repo, issue_number: pull_request.number } @@ -132,13 +193,13 @@ jobs: labels: added }) } - }) + })) ) - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 name: Labels from touched files if: | - github.event_name != 'workflow_run' && + github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.owner.login != 'NixOS' || !( github.head_ref == 'haskell-updates' || github.head_ref == 'python-updates' || @@ -153,7 +214,7 @@ jobs: - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 name: Labels from touched files (no sync) if: | - github.event_name != 'workflow_run' && + github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.owner.login != 'NixOS' || !( github.head_ref == 'haskell-updates' || github.head_ref == 'python-updates' || @@ -171,7 +232,7 @@ jobs: # This is to avoid the mass of labels there, which is mostly useless - and really annoying for # the backport labels. if: | - github.event_name != 'workflow_run' && + github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.owner.login == 'NixOS' && ( github.head_ref == 'haskell-updates' || github.head_ref == 'python-updates' || diff --git a/.github/workflows/review-submitted.yml b/.github/workflows/review-submitted.yml deleted file mode 100644 index 69663054f15b..000000000000 --- a/.github/workflows/review-submitted.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Review submitted - -on: - pull_request_review: - types: [submitted] - -permissions: {} - -defaults: - run: - shell: bash - -jobs: - trigger: - runs-on: ubuntu-24.04-arm - steps: - - run: echo This is a no-op only used as a trigger for workflow_run. From 4d537009c6d2bf00f7177571909f61debff796c4 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 15 Jun 2025 11:08:48 +0200 Subject: [PATCH 59/82] workflow/labels: save an API request With the previous commit we now have the `before` labels available already, which allows some simplification. --- .github/workflows/labels.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index f15d8b4a6dcb..2b487dc00407 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -140,16 +140,9 @@ jobs: expectedHash: artifact.digest }) - // Shortcut for all issue endpoints related to labels - const pr = { - ...context.repo, - issue_number: pull_request.number - } - // Get all currently set labels that we manage const before = - (await github.paginate(github.rest.issues.listLabelsOnIssue, pr)) - .map(({ name }) => name) + pull_request.labels.map(({ name }) => name) .filter(name => name.startsWith('10.rebuild') || name == '11.by: package-maintainer' || @@ -159,8 +152,7 @@ jobs: const approvals = new Set( (await github.paginate(github.rest.pulls.listReviews, { - owner: context.repo.owner, - repo: context.repo.repo, + ...context.repo, pull_number: pull_request.number })) .filter(review => review.state == 'APPROVED') @@ -180,7 +172,8 @@ jobs: await Promise.all( before.filter(name => !after.includes(name)) .map(name => github.rest.issues.removeLabel({ - ...pr, + ...context.repo, + issue_number: pull_request.number name })) ) @@ -189,7 +182,8 @@ jobs: const added = after.filter(name => !before.includes(name)) if (added.length > 0) { await github.rest.issues.addLabels({ - ...pr, + ...context.repo, + issue_number: pull_request.number labels: added }) } From 94084c4140a90c23eab8ab7ef32c1010674c796a Mon Sep 17 00:00:00 2001 From: Lach Date: Sat, 15 Mar 2025 20:27:33 +0100 Subject: [PATCH 60/82] libbgcode: 2023-11-16 -> 0-unstable-2025-02-19 Co-authored-by: Lach --- pkgs/by-name/li/libbgcode/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/li/libbgcode/package.nix b/pkgs/by-name/li/libbgcode/package.nix index ddfd37c773e2..5ad44220d625 100644 --- a/pkgs/by-name/li/libbgcode/package.nix +++ b/pkgs/by-name/li/libbgcode/package.nix @@ -7,17 +7,17 @@ heatshrink, zlib, boost, - catch2, + catch2_3, }: stdenv.mkDerivation { pname = "libbgcode"; - version = "2023-11-16"; + version = "0-unstable-2025-02-19"; src = fetchFromGitHub { owner = "prusa3d"; repo = "libbgcode"; - rev = "bc390aab4427589a6402b4c7f65cf4d0a8f987ec"; - hash = "sha256-TZShYeDAh+fNdmTr1Xqctji9f0vEGpNZv1ba/IY5EoY="; + rev = "5041c093b33e2748e76d6b326f2251310823f3df"; + hash = "sha256-EaxVZerH2v8b1Yqk+RW/r3BvnJvrAelkKf8Bd+EHbEc="; }; nativeBuildInputs = [ @@ -29,7 +29,7 @@ stdenv.mkDerivation { heatshrink zlib boost - catch2 + catch2_3 ]; meta = with lib; { From 2d05b9f5827204eb01586a9ad7d3679fe6241239 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Sun, 15 Jun 2025 19:22:38 +0200 Subject: [PATCH 61/82] prusa-slicer: 2.9.0 -> 2.9.2 Diff: https://github.com/prusa3d/PrusaSlicer/compare/version_2.9.0...version_2.9.2 --- .../misc/prusa-slicer/default.nix | 53 +++++++++---------- .../fix-ambiguous-constructors.patch | 37 ------------- 2 files changed, 25 insertions(+), 65 deletions(-) delete mode 100644 pkgs/applications/misc/prusa-slicer/fix-ambiguous-constructors.patch diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix index e075bf766c1f..b3cd5adf5068 100644 --- a/pkgs/applications/misc/prusa-slicer/default.nix +++ b/pkgs/applications/misc/prusa-slicer/default.nix @@ -3,7 +3,6 @@ lib, binutils, fetchFromGitHub, - fetchpatch, cmake, pkg-config, wrapGAppsHook3, @@ -33,11 +32,12 @@ xorg, libbgcode, heatshrink, - catch2, + catch2_3, webkitgtk_4_1, ctestCheckHook, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd, + z3, wxGTK-override ? null, opencascade-override ? null, }: @@ -60,36 +60,30 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "prusa-slicer"; - version = "2.9.0"; + version = "2.9.2"; src = fetchFromGitHub { owner = "prusa3d"; repo = "PrusaSlicer"; - hash = "sha256-6BrmTNIiu6oI/CbKPKoFQIh1aHEVfJPIkxomQou0xKk="; + hash = "sha256-j/fdEgcFq0nWBLpyapwZIbBIXCnqEWV6Tk+6sTHk/Bc="; rev = "version_${finalAttrs.version}"; }; - # https://github.com/prusa3d/PrusaSlicer/pull/14010 - patches = [ - (fetchpatch { - url = "https://github.com/prusa3d/PrusaSlicer/commit/cdc3db58f9002778a0ca74517865527f50ade4c3.patch"; - hash = "sha256-zgpGg1jtdnCBaWjR6oUcHo5sGuZx5oEzpux3dpRdMAM="; - }) - # https://github.com/prusa3d/PrusaSlicer/pull/11769 - ./fix-ambiguous-constructors.patch - ]; - - # Patch required for GCC 14. # (not applicable to super-slicer fork) - # Make Gcode viewer open newer bgcode files. - postPatch = lib.optionalString (finalAttrs.pname == "prusa-slicer") '' - substituteInPlace src/slic3r-arrange/include/arrange/DataStoreTraits.hpp \ - --replace-fail \ - "WritableDataStoreTraits::template set" \ - "WritableDataStoreTraits::set" - substituteInPlace src/platform/unix/PrusaGcodeviewer.desktop \ - --replace-fail 'MimeType=text/x.gcode;' 'MimeType=application/x-bgcode;text/x.gcode;' - ''; + postPatch = lib.optionalString (finalAttrs.pname == "prusa-slicer") ( + # Patch required for GCC 14, but breaks on clang + lib.optionalString stdenv.cc.isGNU '' + substituteInPlace src/slic3r-arrange/include/arrange/DataStoreTraits.hpp \ + --replace-fail \ + "WritableDataStoreTraits::template set" \ + "WritableDataStoreTraits::set" + '' + # Make Gcode viewer open newer bgcode files. + + '' + substituteInPlace src/platform/unix/PrusaGcodeviewer.desktop \ + --replace-fail 'MimeType=text/x.gcode;' 'MimeType=application/x-bgcode;text/x.gcode;' + '' + ); nativeBuildInputs = [ cmake @@ -127,8 +121,9 @@ stdenv.mkDerivation (finalAttrs: { xorg.libX11 libbgcode heatshrink - catch2 + catch2_3 webkitgtk_4_1 + z3 ] ++ lib.optionals withSystemd [ systemd @@ -161,7 +156,7 @@ stdenv.mkDerivation (finalAttrs: { # dlopen(3) for context. if [ -f "src/libslic3r/Format/STEP.cpp" ]; then substituteInPlace src/libslic3r/Format/STEP.cpp \ - --replace 'libpath /= "OCCTWrapper.so";' 'libpath = "OCCTWrapper.so";' + --replace-fail 'libpath /= "OCCTWrapper.so";' 'libpath = "OCCTWrapper.so";' fi # https://github.com/prusa3d/PrusaSlicer/issues/9581 if [ -f "cmake/modules/FindEXPAT.cmake" ]; then @@ -169,8 +164,10 @@ stdenv.mkDerivation (finalAttrs: { fi # Fix resources folder location on macOS - substituteInPlace src/PrusaSlicer.cpp \ - --replace "#ifdef __APPLE__" "#if 0" + substituteInPlace src/${ + if finalAttrs.pname == "prusa-slicer" then "CLI/Setup.cpp" else "PrusaSlicer.cpp" + } \ + --replace-fail "#ifdef __APPLE__" "#if 0" ''; cmakeFlags = [ diff --git a/pkgs/applications/misc/prusa-slicer/fix-ambiguous-constructors.patch b/pkgs/applications/misc/prusa-slicer/fix-ambiguous-constructors.patch deleted file mode 100644 index 209a0d1a08a9..000000000000 --- a/pkgs/applications/misc/prusa-slicer/fix-ambiguous-constructors.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 910328f3131e24e330808f5d4cb814454dbe201d Mon Sep 17 00:00:00 2001 -From: Gregor Riepl -Date: Mon, 27 Nov 2023 13:01:55 +0100 -Subject: [PATCH] Make initializers explicit to avoid ambiguous wxArrayString - overloads - ---- - src/slic3r/GUI/PhysicalPrinterDialog.cpp | 2 +- - src/slic3r/GUI/Plater.cpp | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/slic3r/GUI/PhysicalPrinterDialog.cpp b/src/slic3r/GUI/PhysicalPrinterDialog.cpp -index 849e987c731..7d0c628c23f 100644 ---- a/src/slic3r/GUI/PhysicalPrinterDialog.cpp -+++ b/src/slic3r/GUI/PhysicalPrinterDialog.cpp -@@ -607,7 +607,7 @@ void PhysicalPrinterDialog::build_printhost_settings(ConfigOptionsGroup* m_optgr - // Always fill in the "printhost_port" combo box from the config and select it. - { - Choice* choice = dynamic_cast(m_optgroup->get_field("printhost_port")); -- choice->set_values({ m_config->opt_string("printhost_port") }); -+ choice->set_values(std::vector({ m_config->opt_string("printhost_port") })); - choice->set_selection(); - } - -diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp -index debfe625fd4..4d61e29a2dc 100644 ---- a/src/slic3r/GUI/Plater.cpp -+++ b/src/slic3r/GUI/Plater.cpp -@@ -4420,7 +4420,7 @@ void Plater::load_project(const wxString& filename) - s_multiple_beds.set_loading_project_flag(true); - ScopeGuard guard([](){ s_multiple_beds.set_loading_project_flag(false);}); - -- if (! load_files({ into_path(filename) }).empty()) { -+ if (! load_files(std::vector({ into_path(filename) })).empty()) { - // At least one file was loaded. - p->set_project_filename(filename); - // Save the names of active presets and project specific config into ProjectDirtyStateManager. From 35d765b1081535704d8797633a230bb5ccf59cd3 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 10:33:23 +0000 Subject: [PATCH 62/82] jailer: 16.6.2 -> 16.7 --- pkgs/by-name/ja/jailer/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ja/jailer/package.nix b/pkgs/by-name/ja/jailer/package.nix index 908b1f2decec..f28ad2b6d2f7 100644 --- a/pkgs/by-name/ja/jailer/package.nix +++ b/pkgs/by-name/ja/jailer/package.nix @@ -14,13 +14,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "jailer"; - version = "16.6.2"; + version = "16.7"; src = fetchFromGitHub { owner = "Wisser"; repo = "Jailer"; tag = "v${finalAttrs.version}"; - hash = "sha256-CeehX+btGexbFFD3p+FVmzXpH0bVWMW9Qdu5q6MJ5lw="; + hash = "sha256-lHBthOZu4utJd2X8cTJ7HCp8zLs0su78RIdf/QBbSJk="; }; nativeBuildInputs = [ From 231e7bf148b44158b432bbfc8b029d9da45feeb1 Mon Sep 17 00:00:00 2001 From: pilz0 Date: Mon, 16 Jun 2025 13:05:22 +0200 Subject: [PATCH 63/82] mcp-grafana: init at 0.4.2 --- pkgs/by-name/mc/mcp-grafana/package.nix | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pkgs/by-name/mc/mcp-grafana/package.nix diff --git a/pkgs/by-name/mc/mcp-grafana/package.nix b/pkgs/by-name/mc/mcp-grafana/package.nix new file mode 100644 index 000000000000..8c484ab118f1 --- /dev/null +++ b/pkgs/by-name/mc/mcp-grafana/package.nix @@ -0,0 +1,38 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, +}: + +buildGoModule (finalAttrs: { + pname = "mcp-grafana"; + version = "0.4.2"; + + src = fetchFromGitHub { + owner = "grafana"; + repo = "mcp-grafana"; + tag = "v${finalAttrs.version}"; + hash = "sha256-3w6xnDAcuDMZPr6lGGh0FpcyG2fRpkeVcJlZMdszu/g="; + }; + + vendorHash = "sha256-61nn/p6Un+uHuPK4hipJ3A2DhAEqpWTGefM8ENAOP1E="; + + ldflags = [ + "-s" + "-w" + ]; + + postInstall = '' + rm $out/bin/jsonschema + ''; + + __darwinAllowLocalNetworking = true; + + meta = { + description = "MCP server for Grafana"; + homepage = "https://github.com/grafana/mcp-grafana"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ pilz ]; + mainProgram = "mcp-grafana"; + }; +}) From 0546e2221746ac41cb0d9adfaf5e35482017ec58 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 11:37:24 +0000 Subject: [PATCH 64/82] python3Packages.pycrdt: 0.12.20 -> 0.12.21 --- .../python-modules/pycrdt/Cargo.lock | 66 +++++++++---------- .../python-modules/pycrdt/default.nix | 4 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/pkgs/development/python-modules/pycrdt/Cargo.lock b/pkgs/development/python-modules/pycrdt/Cargo.lock index 9c2e78591a90..2de3dc148e71 100644 --- a/pkgs/development/python-modules/pycrdt/Cargo.lock +++ b/pkgs/development/python-modules/pycrdt/Cargo.lock @@ -44,15 +44,15 @@ checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "concurrent-queue" @@ -162,15 +162,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.172" +version = "0.2.173" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -184,9 +184,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memoffset" @@ -211,9 +211,9 @@ checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -230,9 +230,9 @@ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "proc-macro2" @@ -245,7 +245,7 @@ dependencies = [ [[package]] name = "pycrdt" -version = "0.12.20" +version = "0.12.21" dependencies = [ "pyo3", "yrs", @@ -253,9 +253,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f239d656363bcee73afef85277f1b281e8ac6212a1d42aa90e55b90ed43c47a4" +checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" dependencies = [ "indoc", "libc", @@ -270,9 +270,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755ea671a1c34044fa165247aaf6f419ca39caa6003aee791a0df2713d8f1b6d" +checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598" dependencies = [ "once_cell", "target-lexicon", @@ -280,9 +280,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc95a2e67091e44791d4ea300ff744be5293f394f1bafd9f78c080814d35956e" +checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c" dependencies = [ "libc", "pyo3-build-config", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a179641d1b93920829a62f15e87c0ed791b6c8db2271ba0fd7c2686090510214" +checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -302,9 +302,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dff85ebcaab8c441b0e3f7ae40a6963ecea8a9f5e74f647e33fcf5ec9a1e89e" +checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc" dependencies = [ "heck", "proc-macro2", @@ -324,9 +324,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags", ] @@ -386,15 +386,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "syn" -version = "2.0.101" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -441,9 +441,9 @@ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasm-bindgen" diff --git a/pkgs/development/python-modules/pycrdt/default.nix b/pkgs/development/python-modules/pycrdt/default.nix index 8076d8155c91..0b0870d2bd2f 100644 --- a/pkgs/development/python-modules/pycrdt/default.nix +++ b/pkgs/development/python-modules/pycrdt/default.nix @@ -19,14 +19,14 @@ buildPythonPackage rec { pname = "pycrdt"; - version = "0.12.20"; + version = "0.12.21"; pyproject = true; src = fetchFromGitHub { owner = "y-crdt"; repo = "pycrdt"; tag = version; - hash = "sha256-kSwmQf46c5UJD75cfJxR3EfxFXExHhLXB+xdExr4lCk="; + hash = "sha256-QfgBq/jL/dFOr1YAC4y0s0tpdIC4bwxknPd1wJ/Z1lo="; }; postPatch = '' From 166e3c2e71126c2698e7c6feff10375b8a9b5f32 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 12:14:43 +0000 Subject: [PATCH 65/82] python3Packages.pypck: 0.8.6 -> 0.8.8 --- pkgs/development/python-modules/pypck/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pypck/default.nix b/pkgs/development/python-modules/pypck/default.nix index 35767d05b17e..6d619c2815bb 100644 --- a/pkgs/development/python-modules/pypck/default.nix +++ b/pkgs/development/python-modules/pypck/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "pypck"; - version = "0.8.6"; + version = "0.8.8"; pyproject = true; disabled = pythonOlder "3.11"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "alengwenus"; repo = "pypck"; tag = version; - hash = "sha256-Us6CkRt6s/Dfw2k1R4WLWfl9ekhSwTL54BJg2hToOYY="; + hash = "sha256-n7UFmWQyw60FTWNxs4mA9ZziZ2EwphkMI9pOLx7gFcA="; }; postPatch = '' @@ -47,7 +47,7 @@ buildPythonPackage rec { meta = with lib; { description = "LCN-PCK library written in Python"; homepage = "https://github.com/alengwenus/pypck"; - changelog = "https://github.com/alengwenus/pypck/releases/tag/${version}"; + changelog = "https://github.com/alengwenus/pypck/releases/tag/${src.tag}"; license = licenses.epl20; maintainers = with maintainers; [ fab ]; }; From 164c381f8823fe1cfef63e8b933f93bbbb4c9c75 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:16:12 +0200 Subject: [PATCH 66/82] python3Packages.python-djvulibre: fix eval --- .../python-modules/python-djvulibre/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/python-djvulibre/default.nix b/pkgs/development/python-modules/python-djvulibre/default.nix index c505e132ee07..12f31ba423fc 100644 --- a/pkgs/development/python-modules/python-djvulibre/default.nix +++ b/pkgs/development/python-modules/python-djvulibre/default.nix @@ -1,14 +1,16 @@ { lib, - python3Packages, + buildPythonPackage, fetchFromGitHub, + cython, djvulibre, + setuptools, ghostscript_headless, pkg-config, unittestCheckHook, }: -python3Packages.buildPythonPackage rec { +buildPythonPackage rec { pname = "python-djvulibre"; version = "0.9.3"; pyproject = true; @@ -21,14 +23,14 @@ python3Packages.buildPythonPackage rec { }; build-system = [ - python3Packages.cython + cython djvulibre ghostscript_headless pkg-config - python3Packages.setuptools + setuptools ]; - dependencies = with python3Packages; [ + dependencies = [ djvulibre ghostscript_headless ]; From 40d5a353e8bcfb3c8d52a8379ad4c88a8c7bc045 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:26:56 +0200 Subject: [PATCH 67/82] docker: use new completions The completions were taken from https://github.com/docker/cli/tree/master/contrib/completion Looking at recent PRs, it looks like these files are no longer being updated and instead everything is based on `docker completion`. This is consistent with the manual: https://github.com/docker/docs/blob/main/content/manuals/engine/cli/completion.md Co-authored-by: Tillmann Gaida --- .../virtualization/docker/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index fd980618de81..715c42357eb9 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -315,6 +315,8 @@ rec { installPhase = '' + runHook preInstall + install -Dm755 ./build/docker $out/libexec/docker/docker makeWrapper $out/libexec/docker/docker $out/bin/docker \ @@ -330,11 +332,16 @@ rec { ln -s ${moby}/etc/systemd/system/docker.service $out/etc/systemd/system/docker.service ln -s ${moby}/etc/systemd/system/docker.socket $out/etc/systemd/system/docker.socket '' - + '' + # Required to avoid breaking cross builds + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' # completion (cli) - installShellCompletion --bash ./contrib/completion/bash/docker - installShellCompletion --fish ./contrib/completion/fish/docker.fish - installShellCompletion --zsh ./contrib/completion/zsh/_docker + installShellCompletion --cmd docker \ + --bash <($out/bin/docker completion bash) \ + --fish <($out/bin/docker completion fish) \ + --zsh <($out/bin/docker completion zsh) + '' + + '' + runHook postInstall ''; passthru = { From 836bb82980ff4276bcd5d219568424f6fb43c015 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 12:31:53 +0000 Subject: [PATCH 68/82] fllog: 1.2.8 -> 1.2.9 --- pkgs/by-name/fl/fllog/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/fl/fllog/package.nix b/pkgs/by-name/fl/fllog/package.nix index f69b5aa0cfb3..80e8f96ed4e6 100644 --- a/pkgs/by-name/fl/fllog/package.nix +++ b/pkgs/by-name/fl/fllog/package.nix @@ -8,12 +8,12 @@ }: stdenv.mkDerivation rec { - version = "1.2.8"; + version = "1.2.9"; pname = "fllog"; src = fetchurl { url = "mirror://sourceforge/fldigi/${pname}-${version}.tar.gz"; - sha256 = "sha256-kJLb1ifd8sUOwGgNsIEmlhH29fQLdTfDMjKLrzK7r1I="; + sha256 = "sha256-3eJvT9PjHTrMn0/pArUDIIE7T7y1YnayG5PuGokwtRk="; }; buildInputs = [ From 2f3970c5d80b6320bd773163945037b7b4debb7c Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 16 Jun 2025 14:44:30 +0200 Subject: [PATCH 69/82] workflows/labels: fix syntax error --- .github/workflows/labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 2b487dc00407..1a3571ac0212 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -173,7 +173,7 @@ jobs: before.filter(name => !after.includes(name)) .map(name => github.rest.issues.removeLabel({ ...context.repo, - issue_number: pull_request.number + issue_number: pull_request.number, name })) ) @@ -183,7 +183,7 @@ jobs: if (added.length > 0) { await github.rest.issues.addLabels({ ...context.repo, - issue_number: pull_request.number + issue_number: pull_request.number, labels: added }) } From ee438bdfba529d5fb7abd5a3162ae865b49da603 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 12:35:12 +0000 Subject: [PATCH 70/82] gosmee: 0.26.0 -> 0.26.1 --- pkgs/by-name/go/gosmee/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/go/gosmee/package.nix b/pkgs/by-name/go/gosmee/package.nix index 4647f1566d9e..1721bd8675f4 100644 --- a/pkgs/by-name/go/gosmee/package.nix +++ b/pkgs/by-name/go/gosmee/package.nix @@ -7,13 +7,13 @@ buildGoModule rec { pname = "gosmee"; - version = "0.26.0"; + version = "0.26.1"; src = fetchFromGitHub { owner = "chmouel"; repo = "gosmee"; rev = "v${version}"; - hash = "sha256-dmv2fxL6jV6bpWvtMiLEtb/yg5vuD+B52P1PWVap1NA="; + hash = "sha256-qNO7mY03aWabTeUm8rXojy2Ek2IKNG6wimVhwZKxh9g="; }; vendorHash = null; From 63aa833704585fd99b2da7cd2c5fbfb9d1a730d9 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Wed, 4 Jun 2025 22:48:19 -0400 Subject: [PATCH 71/82] ocamlPackages.patricia-tree: init at 0.11.0 Signed-off-by: Ethan Carter Edwards --- .../ocaml-modules/patricia-tree/default.nix | 44 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/ocaml-modules/patricia-tree/default.nix diff --git a/pkgs/development/ocaml-modules/patricia-tree/default.nix b/pkgs/development/ocaml-modules/patricia-tree/default.nix new file mode 100644 index 000000000000..d61c28c166a5 --- /dev/null +++ b/pkgs/development/ocaml-modules/patricia-tree/default.nix @@ -0,0 +1,44 @@ +{ + lib, + buildDunePackage, + fetchFromGitHub, + findlib, + mdx, + qcheck-core, + ppx_inline_test, +}: + +buildDunePackage rec { + pname = "patricia-tree"; + version = "0.11.0"; + + minimalOCamlVersion = "4.14"; + + src = fetchFromGitHub { + owner = "codex-semantics-library"; + repo = "patricia-tree"; + tag = "v${version}"; + hash = "sha256-lpmU0KhsyIHxPBiw38ssA7XFEMsRvOT03MByoJG88Xs="; + }; + + nativeCheckInputs = [ + mdx.bin + ]; + + checkInputs = [ + mdx + ppx_inline_test + qcheck-core + ]; + + doCheck = true; + + meta = { + description = "Patricia Tree data structure in OCaml"; + homepage = "https://codex.top/api/patricia-tree/"; + downloadPage = "https://github.com/codex-semantics-library/patricia-tree"; + changelog = "https://github.com/codex-semantics-library/patricia-tree/releases/tag/v${version}"; + license = lib.licenses.lgpl21Only; + maintainers = [ lib.maintainers.ethancedwards8 ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index b0c593871bf9..3286ec309efb 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1654,6 +1654,8 @@ let path_glob = callPackage ../development/ocaml-modules/path_glob { }; + patricia-tree = callPackage ../development/ocaml-modules/patricia-tree { }; + pbkdf = callPackage ../development/ocaml-modules/pbkdf { }; pbrt = callPackage ../development/ocaml-modules/pbrt { }; From bf2505d76c911105beef4ee6694078712db8d6bf Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Fri, 6 Jun 2025 15:34:51 -0400 Subject: [PATCH 72/82] ocamlPackages.processor: init at 0.1 Signed-off-by: Ethan Carter Edwards --- .../ocaml-modules/processor/default.nix | 30 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/ocaml-modules/processor/default.nix diff --git a/pkgs/development/ocaml-modules/processor/default.nix b/pkgs/development/ocaml-modules/processor/default.nix new file mode 100644 index 000000000000..4a914449251a --- /dev/null +++ b/pkgs/development/ocaml-modules/processor/default.nix @@ -0,0 +1,30 @@ +{ + lib, + buildDunePackage, + fetchFromGitHub, +}: + +buildDunePackage rec { + pname = "processor"; + version = "0.1"; + + minimalOCamlVersion = "4.08"; + + src = fetchFromGitHub { + owner = "haesbaert"; + repo = "ocaml-processor"; + tag = "v${version}"; + hash = "sha256-eGSNYjVbUIUMelajqZYOd3gvmRKQ9UP3TfMflLR9i7k="; + }; + + doCheck = true; + + meta = { + description = "CPU topology and affinity for ocaml-multicore"; + homepage = "https://haesbaert.github.io/ocaml-processor/processor/index.html"; + downloadPage = "https://github.com/haesbaert/ocaml-processor"; + changelog = "https://github.com/haesbaert/ocaml-processor/releases/tag/v${version}"; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.ethancedwards8 ]; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 3286ec309efb..8286936313f0 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1780,6 +1780,8 @@ let process = callPackage ../development/ocaml-modules/process { }; + processor = callPackage ../development/ocaml-modules/processor { }; + prometheus = callPackage ../development/ocaml-modules/prometheus { }; progress = callPackage ../development/ocaml-modules/progress { }; From 4425979533e2c2264613454739a77c55063cbbf2 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 16 Jun 2025 15:55:40 +0200 Subject: [PATCH 73/82] workflows/labels: fix first scheduled run This would fail, because no previous workflow can be found. --- .github/workflows/labels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 1a3571ac0212..6e025a8a36ce 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -69,13 +69,14 @@ jobs: // Normally a scheduled run, but could be workflow_dispatch, see above. Go back as far // as the last successful run of this workflow to make sure we are not leaving anyone // behind on GHA failures. + // Defaults to go back 1 hour on the first run. return (await github.rest.actions.listWorkflowRuns({ ...context.repo, workflow_id: 'labels.yml', event: 'schedule', status: 'success', exclude_pull_requests: true - })).data.workflow_runs[0]?.created_at + })).data.workflow_runs[0]?.created_at ?? new Date().getTime() - 1 * 60 * 60 * 1000 })()) core.info('cutoff timestamp: ' + cutoff.toISOString()) From c12c91f4658e18d7a79fbf446debf118efb7a4cf Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 16 Jun 2025 15:56:19 +0200 Subject: [PATCH 74/82] workflows/labels: run to completion on error This runs all PRs in scope to completion, before reporting errors. --- .github/workflows/labels.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 6e025a8a36ce..6bbcdfebcce3 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -99,7 +99,7 @@ jobs: direction: 'desc', ...prEventCondition }, - async (response, done) => await Promise.all(response.data.map(async (pull_request) => { + async (response, done) => (await Promise.allSettled(response.data.map(async (pull_request) => { const log = (k,v) => core.info(`PR #${pull_request.number} - ${k}: ${v}`) log('Last updated at', pull_request.updated_at) @@ -188,7 +188,9 @@ jobs: labels: added }) } - })) + }))) + .filter(({ status }) => status == 'rejected') + .map(({ reason }) => core.setFailed(reason)) ) - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 From 7efbed4cd753dcbad9704f626993033968da8502 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 16 Jun 2025 15:57:02 +0200 Subject: [PATCH 75/82] workflows/labels: save artifacts per PR Previously, the artifacts of different PRs would overwrite each other, thus leading to odd JSON parsing errors. --- .github/workflows/labels.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 6bbcdfebcce3..ac1f3c7b5777 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -137,7 +137,7 @@ jobs: repositoryOwner: context.repo.owner, token: core.getInput('github-token') }, - path: path.resolve('comparison'), + path: path.resolve(pull_request.number.toString()), expectedHash: artifact.digest }) @@ -161,11 +161,11 @@ jobs: ) const maintainers = new Set(Object.keys( - JSON.parse(await readFile('comparison/maintainers.json', 'utf-8')) + JSON.parse(await readFile(`${pull_request.number}/maintainers.json`, 'utf-8')) )) // And the labels that should be there - const after = JSON.parse(await readFile('comparison/changed-paths.json', 'utf-8')).labels + const after = JSON.parse(await readFile(`${pull_request.number}/changed-paths.json`, 'utf-8')).labels if (approvals.size > 0) after.push(`12.approvals: ${approvals.size > 2 ? '3+' : approvals.size}`) if (Array.from(maintainers).some(m => approvals.has(m))) after.push('12.approved-by: package-maintainer') From 97130d08e19e39b12776f6614769c8ae77427eb6 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 16 Jun 2025 16:19:42 +0200 Subject: [PATCH 76/82] workflows/labels: add more error context The original error is kept, but the PR number is printed as well. Makes debugging much easier. --- .github/workflows/labels.yml | 156 ++++++++++++++++++----------------- 1 file changed, 80 insertions(+), 76 deletions(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index ac1f3c7b5777..5d69dfe4e071 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -100,97 +100,101 @@ jobs: ...prEventCondition }, async (response, done) => (await Promise.allSettled(response.data.map(async (pull_request) => { - const log = (k,v) => core.info(`PR #${pull_request.number} - ${k}: ${v}`) + try { + const log = (k,v) => core.info(`PR #${pull_request.number} - ${k}: ${v}`) - log('Last updated at', pull_request.updated_at) - if (new Date(pull_request.updated_at) < cutoff) return done() + log('Last updated at', pull_request.updated_at) + if (new Date(pull_request.updated_at) < cutoff) return done() - const run_id = (await github.rest.actions.listWorkflowRuns({ - ...context.repo, - workflow_id: 'eval.yml', - event: 'pull_request_target', - // For PR events, the workflow run is still in progress with this job itself. - status: prEventCondition ? 'in_progress' : 'success', - exclude_pull_requests: true, - head_sha: pull_request.head.sha - })).data.workflow_runs[0]?.id + const run_id = (await github.rest.actions.listWorkflowRuns({ + ...context.repo, + workflow_id: 'eval.yml', + event: 'pull_request_target', + // For PR events, the workflow run is still in progress with this job itself. + status: prEventCondition ? 'in_progress' : 'success', + exclude_pull_requests: true, + head_sha: pull_request.head.sha + })).data.workflow_runs[0]?.id - // Newer PRs might not have run Eval to completion, yet. We can skip them, because this - // job will be run as part of that Eval run anyway. - log('Last eval run', run_id) - if (!run_id) return; + // Newer PRs might not have run Eval to completion, yet. We can skip them, because this + // job will be run as part of that Eval run anyway. + log('Last eval run', run_id) + if (!run_id) return; - const artifact = (await github.rest.actions.listWorkflowRunArtifacts({ - ...context.repo, - run_id, - name: 'comparison' - })).data.artifacts[0] + const artifact = (await github.rest.actions.listWorkflowRunArtifacts({ + ...context.repo, + run_id, + name: 'comparison' + })).data.artifacts[0] - // Instead of checking the boolean artifact.expired, we will give us a minute to - // actually download the artifact in the next step and avoid that race condition. - log('Artifact expires at', artifact.expires_at) - if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return; + // Instead of checking the boolean artifact.expired, we will give us a minute to + // actually download the artifact in the next step and avoid that race condition. + log('Artifact expires at', artifact.expires_at) + if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return; - await artifactClient.downloadArtifact(artifact.id, { - findBy: { - repositoryName: context.repo.repo, - repositoryOwner: context.repo.owner, - token: core.getInput('github-token') - }, - path: path.resolve(pull_request.number.toString()), - expectedHash: artifact.digest - }) + await artifactClient.downloadArtifact(artifact.id, { + findBy: { + repositoryName: context.repo.repo, + repositoryOwner: context.repo.owner, + token: core.getInput('github-token') + }, + path: path.resolve(pull_request.number.toString()), + expectedHash: artifact.digest + }) - // Get all currently set labels that we manage - const before = - pull_request.labels.map(({ name }) => name) - .filter(name => - name.startsWith('10.rebuild') || - name == '11.by: package-maintainer' || - name.startsWith('12.approvals:') || - name == '12.approved-by: package-maintainer' + // Get all currently set labels that we manage + const before = + pull_request.labels.map(({ name }) => name) + .filter(name => + name.startsWith('10.rebuild') || + name == '11.by: package-maintainer' || + name.startsWith('12.approvals:') || + name == '12.approved-by: package-maintainer' + ) + + const approvals = new Set( + (await github.paginate(github.rest.pulls.listReviews, { + ...context.repo, + pull_number: pull_request.number + })) + .filter(review => review.state == 'APPROVED') + .map(review => review.user.id) ) - const approvals = new Set( - (await github.paginate(github.rest.pulls.listReviews, { - ...context.repo, - pull_number: pull_request.number - })) - .filter(review => review.state == 'APPROVED') - .map(review => review.user.id) - ) + const maintainers = new Set(Object.keys( + JSON.parse(await readFile(`${pull_request.number}/maintainers.json`, 'utf-8')) + )) - const maintainers = new Set(Object.keys( - JSON.parse(await readFile(`${pull_request.number}/maintainers.json`, 'utf-8')) - )) + // And the labels that should be there + const after = JSON.parse(await readFile(`${pull_request.number}/changed-paths.json`, 'utf-8')).labels + if (approvals.size > 0) after.push(`12.approvals: ${approvals.size > 2 ? '3+' : approvals.size}`) + if (Array.from(maintainers).some(m => approvals.has(m))) after.push('12.approved-by: package-maintainer') - // And the labels that should be there - const after = JSON.parse(await readFile(`${pull_request.number}/changed-paths.json`, 'utf-8')).labels - if (approvals.size > 0) after.push(`12.approvals: ${approvals.size > 2 ? '3+' : approvals.size}`) - if (Array.from(maintainers).some(m => approvals.has(m))) after.push('12.approved-by: package-maintainer') + // Remove the ones not needed anymore + await Promise.all( + before.filter(name => !after.includes(name)) + .map(name => github.rest.issues.removeLabel({ + ...context.repo, + issue_number: pull_request.number, + name + })) + ) - // Remove the ones not needed anymore - await Promise.all( - before.filter(name => !after.includes(name)) - .map(name => github.rest.issues.removeLabel({ - ...context.repo, - issue_number: pull_request.number, - name - })) - ) - - // And add the ones that aren't set already - const added = after.filter(name => !before.includes(name)) - if (added.length > 0) { - await github.rest.issues.addLabels({ - ...context.repo, - issue_number: pull_request.number, - labels: added - }) + // And add the ones that aren't set already + const added = after.filter(name => !before.includes(name)) + if (added.length > 0) { + await github.rest.issues.addLabels({ + ...context.repo, + issue_number: pull_request.number, + labels: added + }) + } + } catch (cause) { + throw new Error(`Labeling PR #${pull_request.number} failed.`, { cause }) } }))) .filter(({ status }) => status == 'rejected') - .map(({ reason }) => core.setFailed(reason)) + .map(({ reason }) => core.setFailed(`${reason.message}\n${reason.cause.stack}`)) ) - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 From b3dc07c5cdd96ac81b83d945b0255ed11f19b10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Thu, 5 Jun 2025 17:10:07 +0200 Subject: [PATCH 77/82] python3Packages.robotframework-assertion-engine: init at 3.0.3 It's a required dependency for python3Packages.robotframework-databaselibrary. --- .../default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/robotframework-assertion-engine/default.nix diff --git a/pkgs/development/python-modules/robotframework-assertion-engine/default.nix b/pkgs/development/python-modules/robotframework-assertion-engine/default.nix new file mode 100644 index 000000000000..e2cbd708d515 --- /dev/null +++ b/pkgs/development/python-modules/robotframework-assertion-engine/default.nix @@ -0,0 +1,40 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + poetry-core, + robotframework, + robotframework-pythonlibcore, +}: + +buildPythonPackage rec { + pname = "robotframework-assertion-engine"; + version = "3.0.3"; + pyproject = true; + + src = fetchPypi { + pname = "robotframework_assertion_engine"; + inherit version; + hash = "sha256-HGCNTGnZZSCYah3cbe8Px/foSVIPHmiCpjO1HbuY/Yg="; + }; + + build-system = [ + poetry-core + ]; + + dependencies = [ + robotframework + robotframework-pythonlibcore + ]; + + pythonImportsCheck = [ + "assertionengine" + ]; + + meta = { + description = "Generic way to create meaningful and easy to use assertions for the Robot Framework libraries"; + homepage = "https://pypi.org/project/robotframework-assertion-engine/"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ bjornfor ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f7b641392343..d3161910845f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15484,6 +15484,10 @@ self: super: with self; { robotframework = callPackage ../development/python-modules/robotframework { }; + robotframework-assertion-engine = + callPackage ../development/python-modules/robotframework-assertion-engine + { }; + robotframework-databaselibrary = callPackage ../development/python-modules/robotframework-databaselibrary { }; From 08e7d25169af3b1ecab1a859a53266f5ea57f93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Thu, 5 Jun 2025 17:11:22 +0200 Subject: [PATCH 78/82] python3Packages.robotframework-databaselibrary: add missing dep Fix this build time error: ModuleNotFoundError: No module named 'assertionengine' --- .../python-modules/robotframework-databaselibrary/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/robotframework-databaselibrary/default.nix b/pkgs/development/python-modules/robotframework-databaselibrary/default.nix index 06982dfdded0..efc09a7c95f3 100644 --- a/pkgs/development/python-modules/robotframework-databaselibrary/default.nix +++ b/pkgs/development/python-modules/robotframework-databaselibrary/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, setuptools, robotframework, + robotframework-assertion-engine, robotframework-excellib, pytestCheckHook, }: @@ -27,6 +28,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ robotframework + robotframework-assertion-engine robotframework-excellib ]; From 960859723a8f0921261e10893c6c08b96208ba1c Mon Sep 17 00:00:00 2001 From: emaryn Date: Mon, 16 Jun 2025 23:52:41 +0800 Subject: [PATCH 79/82] mihomo-party: 1.7.4 -> 1.7.5 --- pkgs/by-name/mi/mihomo-party/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/mi/mihomo-party/package.nix b/pkgs/by-name/mi/mihomo-party/package.nix index ad4336297b5a..a8fc616faffd 100644 --- a/pkgs/by-name/mi/mihomo-party/package.nix +++ b/pkgs/by-name/mi/mihomo-party/package.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { pname = "mihomo-party"; - version = "1.7.4"; + version = "1.7.5"; src = let @@ -31,8 +31,8 @@ stdenv.mkDerivation rec { fetchurl { url = "https://github.com/mihomo-party-org/mihomo-party/releases/download/v${version}/mihomo-party-linux-${version}-${arch}.deb"; hash = selectSystem { - x86_64-linux = "sha256-pQcDW9ztCTIS5dbmPuvig32cXWfzYiHksa3Jv/O5J7E="; - aarch64-linux = "sha256-YHLHJ05sdMj/Wz/WAEianbDIUz9X+AER2wm9T/QHRXI="; + x86_64-linux = "sha256-Kw7VDyJ07DeinAzsilJU0vBhDLViB8zlpIA+mAPpp2M="; + aarch64-linux = "sha256-OljIM8BI8umkRB1wUqcwQ/H1i1FhYtQ4d5cXMi/Lt9E="; }; }; From de01c86993b1c2bf09ba039060fcef4c25b14168 Mon Sep 17 00:00:00 2001 From: emaryn Date: Mon, 16 Jun 2025 23:57:42 +0800 Subject: [PATCH 80/82] mihomo-party: use finalAttrs --- pkgs/by-name/mi/mihomo-party/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/mi/mihomo-party/package.nix b/pkgs/by-name/mi/mihomo-party/package.nix index a8fc616faffd..1b907b9473df 100644 --- a/pkgs/by-name/mi/mihomo-party/package.nix +++ b/pkgs/by-name/mi/mihomo-party/package.nix @@ -14,7 +14,7 @@ libGL, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "mihomo-party"; version = "1.7.5"; @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { }; in fetchurl { - url = "https://github.com/mihomo-party-org/mihomo-party/releases/download/v${version}/mihomo-party-linux-${version}-${arch}.deb"; + url = "https://github.com/mihomo-party-org/mihomo-party/releases/download/v${finalAttrs.version}/mihomo-party-linux-${finalAttrs.version}-${arch}.deb"; hash = selectSystem { x86_64-linux = "sha256-Kw7VDyJ07DeinAzsilJU0vBhDLViB8zlpIA+mAPpp2M="; aarch64-linux = "sha256-OljIM8BI8umkRB1wUqcwQ/H1i1FhYtQ4d5cXMi/Lt9E="; @@ -88,4 +88,4 @@ stdenv.mkDerivation rec { sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; maintainers = with lib.maintainers; [ ]; }; -} +}) From 26b303bffdde096f52a4a4cfc7be15a92e16fc2f Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 16:46:27 +0000 Subject: [PATCH 81/82] svix-server: 1.66.0 -> 1.67.0 --- pkgs/by-name/sv/svix-server/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/sv/svix-server/package.nix b/pkgs/by-name/sv/svix-server/package.nix index b4d79f721100..08b0a7b7ef4e 100644 --- a/pkgs/by-name/sv/svix-server/package.nix +++ b/pkgs/by-name/sv/svix-server/package.nix @@ -10,19 +10,19 @@ rustPlatform.buildRustPackage rec { pname = "svix-server"; - version = "1.66.0"; + version = "1.67.0"; src = fetchFromGitHub { owner = "svix"; repo = "svix-webhooks"; rev = "v${version}"; - hash = "sha256-Us/Bkp5ujC1rd/zpPzXL4kiFAiAygPWvRJF836ErK/0="; + hash = "sha256-H9SrYWwSwW03LSKzCTVgtgZIM+o6nL3USBmJ61qxFos="; }; sourceRoot = "${src.name}/server"; useFetchCargoVendor = true; - cargoHash = "sha256-fGXdWPJYauLQYC7o7I8q8okXn8JXzwnX6Pq71hj36Wo="; + cargoHash = "sha256-xDSxevVnUPG95djjq//tjYI7WPb6qkXcvVKa6rBIwF0="; nativeBuildInputs = [ pkg-config ]; From b4286452f20ef8fe7ead614963f08ad79305fc1b Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 16 Jun 2025 08:16:28 +0000 Subject: [PATCH 82/82] python3Packages.bagit: 1.9b2 -> 1.9.0 --- pkgs/development/python-modules/bagit/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/bagit/default.nix b/pkgs/development/python-modules/bagit/default.nix index 28e4bb4b41ab..9a04da723e4a 100644 --- a/pkgs/development/python-modules/bagit/default.nix +++ b/pkgs/development/python-modules/bagit/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "bagit"; - version = "1.9b2"; + version = "1.9.0"; pyproject = true; build-system = [ setuptools @@ -21,8 +21,8 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "LibraryOfCongress"; repo = "bagit-python"; - rev = "v${version}"; - hash = "sha256-IkRMsCrtX8nS0nrxs5B9csMq1YrI75QLDuT8eTPILkw="; + tag = "v${version}"; + hash = "sha256-gHilCG07BXL28vBOaqvKhEQw+9l/AkzZRQxucBTEDos="; }; nativeBuildInputs = [