···2626 fetch-depth: 0
2727 ref: ${{ github.event.pull_request.head.sha }}
2828 - name: Create backport PRs
2929- # should be kept in sync with `version`
3030- uses: zeebe-io/backport-action@v0.0.5
2929+ uses: zeebe-io/backport-action@v0.0.8
3130 with:
3231 # Config README: https://github.com/zeebe-io/backport-action#backport-action
3332 github_token: ${{ secrets.GITHUB_TOKEN }}
3433 github_workspace: ${{ github.workspace }}
3535- # should be kept in sync with `uses`
3636- version: v0.0.5
3734 pull_description: |-
3835 Bot-based backport to `${target_branch}`, triggered by a label in #${pull_number}.
3936
+2-2
doc/languages-frameworks/dotnet.section.md
···71717272To package Dotnet applications, you can use `buildDotnetModule`. This has similar arguments to `stdenv.mkDerivation`, with the following additions:
73737474-* `projectFile` has to be used for specifying the dotnet project file relative to the source root. These usually have `.sln` or `.csproj` file extensions. This can be an array of multiple projects as well.
7474+* `projectFile` is used for specifying the dotnet project file, relative to the source root. These usually have `.sln` or `.csproj` file extensions. This can be a list of multiple projects as well. Most of the time dotnet can figure this location out by itself, so this should only be set if necessary.
7575* `nugetDeps` takes either a path to a `deps.nix` file, or a derivation. The `deps.nix` file can be generated using the script attached to `passthru.fetch-deps`. This file can also be generated manually using `nuget-to-nix` tool, which is available in nixpkgs. If the argument is a derivation, it will be used directly and assume it has the same output as `mkNugetDeps`.
7676* `packNupkg` is used to pack project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`.
7777* `projectReferences` can be used to resolve `ProjectReference` project items. Referenced projects can be packed with `buildDotnetModule` by setting the `packNupkg = true` attribute and passing a list of derivations to `projectReferences`. Since we are sharing referenced projects as NuGets they must be added to csproj/fsproj files as `PackageReference` as well.
···100100* `dotnetPackFlags` can be used to pass flags to `dotnet pack`. Used only if `packNupkg` is set to `true`.
101101* `dotnetFlags` can be used to pass flags to all of the above phases.
102102103103-When packaging a new application, you need to fetch it's dependencies. You can set `nugetDeps` to an empty string to make the derivation temporarily evaluate, and then run `nix-build -A package.passthru.fetch-deps` to generate it's dependency fetching script. After running the script, you should have the location of the generated lockfile printed to the console. This can be copied to a stable directory. Note that if either `projectFile` or `nugetDeps` are unset, this script cannot be generated!
103103+When packaging a new application, you need to fetch its dependencies. You can run `nix-build -A package.fetch-deps` to generate a script that will build a lockfile for you. After running the script you should have the location of the generated lockfile printed to the console, which can be copied to a stable directory. Then set `nugetDeps = ./deps.nix` and you're ready to build the derivation.
104104105105Here is an example `default.nix`, using some of the previously discussed arguments:
106106```nix
+3-1
nixos/tests/zfs.nix
···88let
991010 makeZfsTest = name:
1111- { kernelPackage ? if enableUnstable then pkgs.linuxPackages_latest else pkgs.linuxPackages
1111+ { kernelPackage ? if enableUnstable
1212+ then pkgs.zfsUnstable.latestCompatibleLinuxPackages
1313+ else pkgs.linuxPackages
1214 , enableUnstable ? false
1315 , extraTest ? ""
1416 }:
···11{ lib
22, stdenvNoCC
33, callPackage
44+, writeShellScript
55+, writeText
66+, srcOnly
47, linkFarmFromDrvs
88+, symlinkJoin
99+, makeWrapper
510, dotnetCorePackages
611, dotnetPackages
712, mkNugetSource
813, mkNugetDeps
99-, srcOnly
1010-, writeShellScript
1111-, writeText
1212-, makeWrapper
1314, nuget-to-nix
1415, cacert
1515-, symlinkJoin
1616, coreutils
1717}:
1818···2020, pname ? name
2121, enableParallelBuilding ? true
2222, doCheck ? false
2323-# Flags to pass to `makeWrapper`. This is done to avoid double wrapping.
2424-, makeWrapperArgs ? []
2323+ # Flags to pass to `makeWrapper`. This is done to avoid double wrapping.
2424+, makeWrapperArgs ? [ ]
25252626-# Flags to pass to `dotnet restore`.
2727-, dotnetRestoreFlags ? []
2828-# Flags to pass to `dotnet build`.
2929-, dotnetBuildFlags ? []
3030-# Flags to pass to `dotnet test`, if running tests is enabled.
3131-, dotnetTestFlags ? []
3232-# Flags to pass to `dotnet install`.
3333-, dotnetInstallFlags ? []
3434-# Flags to pass to `dotnet pack`.
3535-, dotnetPackFlags ? []
3636-# Flags to pass to dotnet in all phases.
3737-, dotnetFlags ? []
2626+ # Flags to pass to `dotnet restore`.
2727+, dotnetRestoreFlags ? [ ]
2828+ # Flags to pass to `dotnet build`.
2929+, dotnetBuildFlags ? [ ]
3030+ # Flags to pass to `dotnet test`, if running tests is enabled.
3131+, dotnetTestFlags ? [ ]
3232+ # Flags to pass to `dotnet install`.
3333+, dotnetInstallFlags ? [ ]
3434+ # Flags to pass to `dotnet pack`.
3535+, dotnetPackFlags ? [ ]
3636+ # Flags to pass to dotnet in all phases.
3737+, dotnetFlags ? [ ]
38383939-# The path to publish the project to. When unset, the directory "$out/lib/$pname" is used.
3939+ # The path to publish the project to. When unset, the directory "$out/lib/$pname" is used.
4040, installPath ? null
4141-# The binaries that should get installed to `$out/bin`, relative to `$out/lib/$pname/`. These get wrapped accordingly.
4242-# Unfortunately, dotnet has no method for doing this automatically.
4343-# If unset, all executables in the projects root will get installed. This may cause bloat!
4141+ # The binaries that should get installed to `$out/bin`, relative to `$out/lib/$pname/`. These get wrapped accordingly.
4242+ # Unfortunately, dotnet has no method for doing this automatically.
4343+ # If unset, all executables in the projects root will get installed. This may cause bloat!
4444, executables ? null
4545-# Packs a project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`.
4545+ # Packs a project as a `nupkg`, and installs it to `$out/share`. If set to `true`, the derivation can be used as a dependency for another dotnet project by adding it to `projectReferences`.
4646, packNupkg ? false
4747-# The packages project file, which contains instructions on how to compile it. This can be an array of multiple project files as well.
4747+ # The packages project file, which contains instructions on how to compile it. This can be an array of multiple project files as well.
4848, projectFile ? null
4949-# The NuGet dependency file. This locks all NuGet dependency versions, as otherwise they cannot be deterministically fetched.
5050-# This can be generated by running the `passthru.fetch-deps` script.
4949+ # The NuGet dependency file. This locks all NuGet dependency versions, as otherwise they cannot be deterministically fetched.
5050+ # This can be generated by running the `passthru.fetch-deps` script.
5151, nugetDeps ? null
5252-# A list of derivations containing nupkg packages for local project references.
5353-# Referenced derivations can be built with `buildDotnetModule` with `packNupkg=true` flag.
5454-# Since we are sharing them as nugets they must be added to csproj/fsproj files as `PackageReference` as well.
5555-# For example, your project has a local dependency:
5656-# <ProjectReference Include="../foo/bar.fsproj" />
5757-# To enable discovery through `projectReferences` you would need to add a line:
5858-# <ProjectReference Include="../foo/bar.fsproj" />
5959-# <PackageReference Include="bar" Version="*" Condition=" '$(ContinuousIntegrationBuild)'=='true' "/>
6060-, projectReferences ? []
6161-# Libraries that need to be available at runtime should be passed through this.
6262-# These get wrapped into `LD_LIBRARY_PATH`.
6363-, runtimeDeps ? []
5252+ # A list of derivations containing nupkg packages for local project references.
5353+ # Referenced derivations can be built with `buildDotnetModule` with `packNupkg=true` flag.
5454+ # Since we are sharing them as nugets they must be added to csproj/fsproj files as `PackageReference` as well.
5555+ # For example, your project has a local dependency:
5656+ # <ProjectReference Include="../foo/bar.fsproj" />
5757+ # To enable discovery through `projectReferences` you would need to add a line:
5858+ # <ProjectReference Include="../foo/bar.fsproj" />
5959+ # <PackageReference Include="bar" Version="*" Condition=" '$(ContinuousIntegrationBuild)'=='true' "/>
6060+, projectReferences ? [ ]
6161+ # Libraries that need to be available at runtime should be passed through this.
6262+ # These get wrapped into `LD_LIBRARY_PATH`.
6363+, runtimeDeps ? [ ]
64646565-# Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks.
6666-# See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details.
6767-, disabledTests ? []
6868-# The project file to run unit tests against. This is usually referenced in the regular project file, but sometimes it needs to be manually set.
6969-# It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this.
6565+ # Tests to disable. This gets passed to `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all frameworks.
6666+ # See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test#filter-option-details for more details.
6767+, disabledTests ? [ ]
6868+ # The project file to run unit tests against. This is usually referenced in the regular project file, but sometimes it needs to be manually set.
6969+ # It gets restored and build, but not installed. You may need to regenerate your nuget lockfile after setting this.
7070, testProjectFile ? ""
71717272-# The type of build to perform. This is passed to `dotnet` with the `--configuration` flag. Possible values are `Release`, `Debug`, etc.
7272+ # The type of build to perform. This is passed to `dotnet` with the `--configuration` flag. Possible values are `Release`, `Debug`, etc.
7373, buildType ? "Release"
7474-# If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet
7474+ # If set to true, builds the application as a self-contained - removing the runtime dependency on dotnet
7575, selfContainedBuild ? false
7676-# The dotnet SDK to use.
7676+ # The dotnet SDK to use.
7777, dotnet-sdk ? dotnetCorePackages.sdk_6_0
7878-# The dotnet runtime to use.
7878+ # The dotnet runtime to use.
7979, dotnet-runtime ? dotnetCorePackages.runtime_6_0
8080-# The dotnet SDK to run tests against. This can differentiate from the SDK compiled against.
8080+ # The dotnet SDK to run tests against. This can differentiate from the SDK compiled against.
8181, dotnet-test-sdk ? dotnet-sdk
8282-, ... } @ args:
8383-8484-assert projectFile == null -> throw "Defining the `projectFile` attribute is required. This is usually an `.csproj`, or `.sln` file.";
8585-8686-# TODO: Automatically generate a dependency file when a lockfile is present.
8787-# This file is unfortunately almost never present, as Microsoft recommands not to push this in upstream repositories.
8888-assert nugetDeps == null -> throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script.";
8282+, ...
8383+} @ args:
89849085let
9186 inherit (callPackage ./hooks {
9287 inherit dotnet-sdk dotnet-test-sdk disabledTests nuget-source dotnet-runtime runtimeDeps buildType;
9388 }) dotnetConfigureHook dotnetBuildHook dotnetCheckHook dotnetInstallHook dotnetFixupHook;
94899595- localDeps = if (projectReferences != [])
9090+ localDeps =
9191+ if (projectReferences != [ ])
9692 then linkFarmFromDrvs "${name}-project-references" projectReferences
9793 else null;
98949999- _nugetDeps = if lib.isDerivation nugetDeps
100100- then nugetDeps
101101- else mkNugetDeps { inherit name; nugetDeps = import nugetDeps; };
9595+ _nugetDeps =
9696+ if (nugetDeps != null) then
9797+ if lib.isDerivation nugetDeps
9898+ then nugetDeps
9999+ else mkNugetDeps { inherit name; nugetDeps = import nugetDeps; }
100100+ else throw "Defining the `nugetDeps` attribute is required, as to lock the NuGet dependencies. This file can be generated by running the `passthru.fetch-deps` script.";
102101103102 # contains the actual package dependencies
104104- _dependenciesSource = mkNugetSource {
103103+ dependenciesSource = mkNugetSource {
105104 name = "${name}-dependencies-source";
106105 description = "A Nuget source with the dependencies for ${name}";
107106 deps = [ _nugetDeps ] ++ lib.optional (localDeps != null) localDeps;
···110109 # this contains all the nuget packages that are implictly referenced by the dotnet
111110 # build system. having them as separate deps allows us to avoid having to regenerate
112111 # a packages dependencies when the dotnet-sdk version changes
113113- _sdkDeps = mkNugetDeps {
112112+ sdkDeps = mkNugetDeps {
114113 name = "dotnet-sdk-${dotnet-sdk.version}-deps";
115114 nugetDeps = dotnet-sdk.passthru.packages;
116115 };
117116118118- _sdkSource = mkNugetSource {
117117+ sdkSource = mkNugetSource {
119118 name = "dotnet-sdk-${dotnet-sdk.version}-source";
120120- deps = [ _sdkDeps ];
119119+ deps = [ sdkDeps ];
121120 };
122121123122 nuget-source = symlinkJoin {
124123 name = "${name}-nuget-source";
125125- paths = [ _dependenciesSource _sdkSource ];
124124+ paths = [ dependenciesSource sdkSource ];
126125 };
127127-in stdenvNoCC.mkDerivation (args // {
128128- nativeBuildInputs = args.nativeBuildInputs or [] ++ [
126126+in
127127+stdenvNoCC.mkDerivation (args // {
128128+ nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
129129 dotnetConfigureHook
130130 dotnetBuildHook
131131 dotnetCheckHook
···150150 passthru = {
151151 inherit nuget-source;
152152153153- fetch-deps = let
154154- # Because this list is rather long its put in its own store path to maintain readability of the generated script
155155- exclusions = writeText "nuget-package-exclusions" (lib.concatStringsSep "\n" (dotnet-sdk.passthru.packages { fetchNuGet = attrs: attrs.pname; }));
153153+ fetch-deps =
154154+ let
155155+ # Because this list is rather long its put in its own store path to maintain readability of the generated script
156156+ exclusions = writeText "nuget-package-exclusions" (lib.concatStringsSep "\n" (dotnet-sdk.passthru.packages { fetchNuGet = attrs: attrs.pname; }));
157157+158158+ # Derivations may set flags such as `--runtime <rid>` based on the host platform to avoid restoring/building nuget dependencies they dont have or dont need.
159159+ # This introduces an issue; In this script we loop over all platforms from `meta` and add the RID flag for it, as to fetch all required dependencies.
160160+ # The script would inherit the RID flag from the derivation based on the platform building the script, and set the flag for any iteration we do over the RIDs.
161161+ # That causes conflicts. To circumvent it we remove all occurances of the flag.
162162+ flags =
163163+ let
164164+ hasRid = flag: lib.any (v: v) (map (rid: lib.hasInfix rid flag) (lib.attrValues dotnet-sdk.runtimeIdentifierMap));
165165+ in
166166+ builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
156167157157- runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) (args.meta.platforms or dotnet-sdk.meta.platforms);
168168+ runtimeIds = map (system: dotnet-sdk.systemToDotnetRid system) (args.meta.platforms or dotnet-sdk.meta.platforms);
169169+ in
170170+ writeShellScript "fetch-${pname}-deps" ''
171171+ set -euo pipefail
158172159159- # Derivations may set flags such as `--runtime <rid>` based on the host platform to avoid restoring/building nuget dependencies they dont have or dont need.
160160- # This introduces an issue; In this script we loop over all platforms from `meta` and add the RID flag for it, as to fetch all required dependencies.
161161- # The script would inherit the RID flag from the derivation based on the platform building the script, and set the flag for any iteration we do over the RIDs.
162162- # That causes conflicts. To circumvent it we remove all occurances of the flag.
163163- flags =
164164- let
165165- hasRid = flag: lib.any (v: v) (map (rid: lib.hasInfix rid flag) (lib.attrValues dotnet-sdk.runtimeIdentifierMap));
166166- in
167167- builtins.filter (flag: !(hasRid flag)) (dotnetFlags ++ dotnetRestoreFlags);
173173+ export PATH="${lib.makeBinPath [ coreutils dotnet-sdk nuget-to-nix ]}"
168174169169- in writeShellScript "fetch-${pname}-deps" ''
170170- set -euo pipefail
175175+ for arg in "$@"; do
176176+ case "$arg" in
177177+ --keep-sources|-k)
178178+ keepSources=1
179179+ shift
180180+ ;;
181181+ --help|-h)
182182+ echo "usage: $0 <output path> [--keep-sources] [--help]"
183183+ echo " <output path> The path to write the lockfile to. A temporary file is used if this is not set"
184184+ echo " --keep-sources Dont remove temporary directories upon exit, useful for debugging"
185185+ echo " --help Show this help message"
186186+ exit
187187+ ;;
188188+ esac
189189+ done
190190+191191+ exitTrap() {
192192+ test -n "''${ranTrap-}" && return
193193+ ranTrap=1
194194+195195+ if test -n "''${keepSources-}"; then
196196+ echo -e "Path to the source: $src\nPath to the fake home: $HOME"
197197+ else
198198+ rm -rf "$src" "$HOME"
199199+ fi
200200+201201+ # Since mktemp is used this will be empty if the script didnt succesfully complete
202202+ ! test -s "$depsFile" && rm -rf "$depsFile"
203203+ }
204204+205205+ trap exitTrap EXIT INT TERM
206206+207207+ dotnetRestore() {
208208+ local -r project="''${1-}"
209209+ local -r rid="$2"
210210+211211+ dotnet restore ''${project-} \
212212+ -p:ContinuousIntegrationBuild=true \
213213+ -p:Deterministic=true \
214214+ --packages "$HOME/nuget_pkgs" \
215215+ --runtime "$rid" \
216216+ ${lib.optionalString (!enableParallelBuilding) "--disable-parallel"} \
217217+ ${lib.optionalString (flags != []) (toString flags)}
218218+ }
171219172172- export PATH="${lib.makeBinPath [ coreutils dotnet-sdk nuget-to-nix ]}"
220220+ declare -a projectFiles=( ${toString (lib.toList projectFile)} )
221221+ declare -a testProjectFiles=( ${toString (lib.toList testProjectFile)} )
173222174174- case "''${1-}" in
175175- --help|-h)
176176- echo "usage: $0 <output path> [--help]"
177177- echo " <output path> The path to write the lockfile to"
178178- echo " --help Show this help message"
179179- exit
180180- ;;
181181- esac
223223+ export HOME=$(mktemp -td "${pname}-home-XXXXXX")
224224+ export DOTNET_NOLOGO=1
225225+ export DOTNET_CLI_TELEMETRY_OPTOUT=1
182226183183- deps_file="$(realpath "''${1:-$(mktemp -t "${pname}-deps-XXXXXX.nix")}")"
184184- export HOME=$(mktemp -td "${pname}-home-XXXXXX")
185185- mkdir -p "$HOME/nuget_pkgs"
227227+ depsFile="$(realpath "''${1:-$(mktemp -t "${pname}-deps-XXXXXX.nix")}")"
228228+ mkdir -p "$HOME/nuget_pkgs"
186229187187- store_src="${srcOnly args}"
188188- src="$(mktemp -td "${pname}-src-XXXXXX")"
189189- cp -rT "$store_src" "$src"
190190- chmod -R +w "$src"
191191- trap "rm -rf $src $HOME" EXIT
230230+ storeSrc="${srcOnly args}"
231231+ src="$(mktemp -td "${pname}-src-XXXXXX")"
232232+ cp -rT "$storeSrc" "$src"
233233+ chmod -R +w "$src"
192234193193- cd "$src"
194194- echo "Restoring project..."
235235+ cd "$src"
236236+ echo "Restoring project..."
195237196196- export DOTNET_NOLOGO=1
197197- export DOTNET_CLI_TELEMETRY_OPTOUT=1
238238+ for rid in "${lib.concatStringsSep "\" \"" runtimeIds}"; do
239239+ (( ''${#projectFiles[@]} == 0 )) && dotnetRestore "" "$rid"
198240199199- for rid in "${lib.concatStringsSep "\" \"" runtimeIds}"; do
200200- for project in "${lib.concatStringsSep "\" \"" ((lib.toList projectFile) ++ lib.optionals (testProjectFile != "") (lib.toList testProjectFile))}"; do
201201- dotnet restore "$project" \
202202- -p:ContinuousIntegrationBuild=true \
203203- -p:Deterministic=true \
204204- --packages "$HOME/nuget_pkgs" \
205205- --runtime "$rid" \
206206- ${lib.optionalString (!enableParallelBuilding) "--disable-parallel"} \
207207- ${lib.optionalString (flags != []) (toString flags)}
208208- done
209209- done
241241+ for project in ''${projectFiles[@]-} ''${testProjectFiles[@]-}; do
242242+ dotnetRestore "$project" "$rid"
243243+ done
244244+ done
210245211211- echo "Succesfully restored project"
246246+ echo "Succesfully restored project"
212247213213- echo "Writing lockfile..."
214214- echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please dont edit it manually, your changes might get overwritten!\n" > "$deps_file"
215215- nuget-to-nix "$HOME/nuget_pkgs" "${exclusions}" >> "$deps_file"
216216- echo "Succesfully wrote lockfile to: $deps_file"
217217- '';
218218- } // args.passthru or {};
248248+ echo "Writing lockfile..."
249249+ echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please dont edit it manually, your changes might get overwritten!\n" > "$depsFile"
250250+ nuget-to-nix "$HOME/nuget_pkgs" "${exclusions}" >> "$depsFile"
251251+ echo "Succesfully wrote lockfile to $depsFile"
252252+ '';
253253+ } // args.passthru or { };
219254220255 meta = {
221256 platforms = dotnet-sdk.meta.platforms;
222222- } // args.meta or {};
257257+ } // args.meta or { };
223258})
···77 runHook preCheck
8899 if [ "${disabledTests-}" ]; then
1010- disabledTestsFlag="--filter FullyQualifiedName!=@disabledTests@"
1010+ local -r disabledTestsFlag="--filter FullyQualifiedName!=@disabledTests@"
1111 fi
12121313- for project in ${testProjectFile[@]}; do
1313+ if [ "${enableParallelBuilding-}" ]; then
1414+ local -r maxCpuFlag="$NIX_BUILD_CORES"
1515+ else
1616+ local -r maxCpuFlag="1"
1717+ fi
1818+1919+ for project in ${testProjectFile[@]-}; do
1420 env "LD_LIBRARY_PATH=@libraryPath@" \
1521 dotnet test "$project" \
1622 -maxcpucount:$maxCpuFlag \
···55# the second is the destination for the wrapper.
66wrapDotnetProgram() {
77 if [ ! "${selfContainedBuild-}" ]; then
88- dotnetRootFlag=("--set" "DOTNET_ROOT" "@dotnetRuntime@")
88+ local -r dotnetRootFlag=("--set" "DOTNET_ROOT" "@dotnetRuntime@")
99 fi
10101111 makeWrapper "$1" "$2" \
1212- "${dotnetRootFlag[@]}" \
1312 --suffix "LD_LIBRARY_PATH" : "@runtimeDeps@" \
1313+ "${dotnetRootFlag[@]}" \
1414 "${gappsWrapperArgs[@]}" \
1515 "${makeWrapperArgs[@]}"
16161717- echo "Installed wrapper to: "$2""
1717+ echo "installed wrapper to "$2""
1818}
19192020dotnetFixupHook() {
2121 echo "Executing dotnetFixupPhase"
22222323- if [ "${executables}" ]; then
2323+ if [ "${executables-}" ]; then
2424 for executable in ${executables[@]}; do
2525- execPath="$out/lib/${pname}/$executable"
2525+ path="$out/lib/$pname/$executable"
26262727- if [[ -f "$execPath" && -x "$execPath" ]]; then
2828- wrapDotnetProgram "$execPath" "$out/bin/$(basename "$executable")"
2727+ if test -x "$path"; then
2828+ wrapDotnetProgram "$path" "$out/bin/$(basename "$executable")"
2929 else
3030- echo "Specified binary \"$executable\" is either not an executable, or does not exist!"
3030+ echo "Specified binary \"$executable\" is either not an executable or does not exist!"
3131+ echo "Looked in $path"
3132 exit 1
3233 fi
3334 done
3435 else
3535- for executable in $out/lib/${pname}/*; do
3636- if [[ -f "$executable" && -x "$executable" && "$executable" != *"dll"* ]]; then
3737- wrapDotnetProgram "$executable" "$out/bin/$(basename "$executable")"
3838- fi
3939- done
3636+ while IFS= read -d '' executable; do
3737+ wrapDotnetProgram "$executable" "$out/bin/$(basename "$executable")" \;
3838+ done < <(find "$out/lib/$pname" ! -name "*.dll" -executable -type f -print0)
4039 fi
41404241 echo "Finished dotnetFixupPhase"
···12121313# Version of Pulumi from
1414# https://www.pulumi.com/docs/get-started/install/versions/
1515-VERSION="3.38.0"
1515+VERSION="3.40.1"
16161717# An array of plugin names. The respective repository inside Pulumi's
1818# Github organization is called pulumi-$name by convention.