Commit Graph

169 Commits

Author SHA1 Message Date
David McFarland
4bb15106d5 add-nuget-deps: use cacert via nativeBuildInputs 2024-09-17 01:12:13 -03:00
David McFarland
e6bca73d01 nuget-to-nix: use xmlstarlet instead of xq (yq)
xq has such a long startup time that this significantly improves
performance.
2024-09-17 01:12:13 -03:00
David McFarland
c693cb8ec6 addNuGetDeps: move TMPDIR handling out of fetch-deps
We now handle creating TMPDIR and setting the working directory outide
of nix-shell.  This allows nix-shell to set NIX_BUILD_TOP correctly.
2024-09-17 01:12:13 -03:00
David McFarland
521b7b5e5f fetch-nupkg: use helper from nuget-package-hook to unpack 2024-09-17 01:12:12 -03:00
David McFarland
b1685747a7 nuget-package-hook: move package unpacking from buildDotnetModule 2024-09-17 01:12:11 -03:00
David McFarland
c1ee815d03 dotnet-fixup-hook: obey dontFixup 2024-09-17 01:12:11 -03:00
David McFarland
60d3a7d230 nuget-to-nix: set SSL_CERT_FILE
This is required for curl.
2024-09-17 01:12:11 -03:00
David McFarland
1d4d0d3db7 nuget-to-nix: use dotnet from PATH
The dotnet sdk used usually needs to match the one required by the
project (global.json). Having the dependcy in nix just meant it always
had to be overridden.
2024-09-17 01:12:11 -03:00
David McFarland
e05c0c4f98 dotnet-fixup-hook: remove confusing logs 2024-09-17 01:12:11 -03:00
David McFarland
773cc0de74 dotnet-sdk-setup-hook: move nuget configuration from dotnetBuildModule 2024-09-17 01:12:11 -03:00
David McFarland
60eb0db2ab dotnet-sdk-setup-hook: add trailing slashes to NUGET_PACKAGES vars 2024-09-17 01:12:11 -03:00
David McFarland
f820d2cf3c dotnetCorePackages: split fetch-deps logic into addNuGetDeps 2024-09-17 01:12:11 -03:00
Artturin
19bf002d43
treewide: fix editorconfig (#341423) 2024-09-13 21:49:38 +03:00
Artturin
a4e4fc5d35 dotnetenv.{buildSolution,buildWrapper}: follow editorconfig & follow common bash style
There seems to be duplication and also improvements to one between these, so someone
should rework these.

Add missing `pre` and `post` hook runs.
2024-09-13 18:17:41 +03:00
Sergei Trofimovich
35671aabff dotnet/build-dotnet-module: fix eval of fetch-deps
Without the change the eval fails as:

    $ nix build --no-link -f. csharp-ls.fetch-deps --show-trace
    error:
       … while evaluating a path segment
         at pkgs/build-support/dotnet/build-dotnet-module/default.nix:258:36:
          257|                   else
          258|                     ''$(mktemp -t "${finalAttrs.pname ? finalAttrs.finalPackage.name}-deps-XXXXXX.nix")'';
             |                                    ^
          259|                 nugetToNix = (nuget-to-nix.override { inherit dotnet-sdk; });

       error: cannot coerce a Boolean to a string: false

Switch from `?` operator (attribute presence predicate) to an `or`
("else" form).
2024-09-13 07:12:37 +01:00
Matt Sturgeon
c8a0f01473
dotnetCorePackages.fetchNupkg: override avalonia to include upstream fix
Backport https://github.com/AvaloniaUI/Avalonia/pull/16835 to versions
11.1.0 through 11.2.0-beta1

Co-authored-by: Nick Cao <nickcao@nichi.co>
2024-09-08 16:38:43 +01:00
David McFarland
e6c700ed11 dotnetCorePackages.fetchNupkg: override avalonia.x11 to find native libs 2024-09-06 16:32:08 -03:00
David McFarland
cc9c59c478 buildDotnetModule: use individual dependencies for nugetDeps 2024-09-06 16:05:19 -03:00
David McFarland
9a0be2fd28 dotnetCorePackages.fetchNupkg: override skiasharp to find fontconfig 2024-09-06 16:05:19 -03:00
David McFarland
1f6cd35f5e dotnetCorePackages.fetchNupkg: add override mechanism 2024-09-05 23:46:24 -03:00
David McFarland
32ccfdc278 dotnetCorePackages.fetchNupkg: run missing hooks 2024-09-05 23:46:24 -03:00
David McFarland
7ea78aaf5a dotnetCorePackages.fetchNupkg: split from mkNugetDeps 2024-09-05 23:46:23 -03:00
David McFarland
2d43ecc400 buildDotnetModule: clean-up stdenv attributes
- stop binding attributes we don't care about (e.g. name, doCheck)
- remove attributes we handle in nix (e.g. useAppHost)
- inherit attributes with default values (e.g. packNupkg)
2024-09-05 23:46:23 -03:00
David McFarland
e78882326b mkNugetDeps: unpack to source/
Unpacking to the build root was a bad idea. stdenv uses dumpVars() to
create a file env-vars containing the entire environment.  This was
being installed in the derivation output, and since it contains lots of
store paths, it was bloating the closure for every nuget package.
2024-09-05 22:47:39 -03:00
David McFarland
e49642596f buildDotnetModule: set TMPDIR in fetch-deps
Some packages assume TMPDIR is unshared, even in nix-shell.
2024-09-05 22:47:39 -03:00
David McFarland
e530139caa buildDotnetModule: fix tool manifest detection 2024-09-05 22:47:38 -03:00
Ivan Trubach
2d33d5c778 buildDotnetModule: inherit enableParallelBuilding
After this change, enableParallelBuilding defaults to true for packages
using buildDotnetModule. The argument value already defaults to true,
but we did not use it. Note that default values in Nix are not present
in the arguments attribute set, e.g. `args` does not contain `def` for
`{ def ? true }@args: …` function unless this argument is explicitly
passed.
2024-09-03 22:57:52 +03:00
Matt Sturgeon
1c379e3a57
buildDotnetModule: add testFilters arg
In addition to the existing `disabledTests`, allow defining more general
test filters using `testFilters`.
2024-08-22 19:52:07 +01:00
Matt Sturgeon
79d26048de
buildDotnetModule: add finalAttrs support
Allow users to pass arguments to `buildDotnetModule` in the form:

```nix
buildDotnetModule (finalAttrs: {
  # Args
})
```

Exposing the behaviour of the underlying `mkDerivation` and allowing
packages to be defined in a recursive way that works correctly even when
the package is overridden, e.g. using `overrideAttrs`.

Added some simple test cases that piggyback on the existing
`structured-attrs` test.
2024-08-06 16:33:49 +01:00
Matt Sturgeon
77a13aa9ad
buildDotnetModule: format with nixfmt 2024-08-01 13:58:28 +01:00
David McFarland
d3ca5027fa dotnet: use unpacked nuget packages 2024-07-31 00:47:14 -03:00
David McFarland
7402aa90cf buildDotnetModule: fix typo 2024-07-30 12:16:45 -03:00
David McFarland
b87ddc0dd5 nuget-to-nix: catch errors from process substitution 2024-07-30 12:16:45 -03:00
David McFarland
0c1f3e6c93 buildDotnetModule: remove nugetDeps from derivation args
This allows fetch-deps to work even when the deps file is missing.
2024-07-30 12:16:45 -03:00
Smaug123
7924a2513e
dotnet: fix fetchDeps null handling 2024-07-16 08:34:23 +01:00
David McFarland
d50a509660
Merge pull request #326785 from Smaug123/nuget-deterministic
dotnet: strip signature files from NuGet
2024-07-14 21:23:38 -03:00
Smaug123
368fc1c5b1
dotnet: strip signature files from NuGet packages 2024-07-14 22:41:30 +01:00
Smaug123
45037a9d73
buildDotnetModule: split fetch-deps script to new file
This makes the minimal change to put the script in a new file.
It does not fix the resulting ShellCheck warnings (which would
have been present in the previous version; I've just exposed
them).
2024-07-12 09:53:13 +01:00
David McFarland
691bec7b0e nuget-to-nix: fix hash generation when resolving multiple sources
Fixes: 2280d5c467
2024-07-08 12:14:09 -03:00
aleksana
74597434a7 buildDotNetGlobalTool: add SRI hash support 2024-07-04 20:16:51 +08:00
aleksana
2280d5c467 nuget-to-nix: generate SRI hash instead of sha256 2024-07-04 20:16:51 +08:00
aleksana
c3698a127a mkNugetDeps: add SRI hash support 2024-07-04 20:16:51 +08:00
aleksana
9aee77e045 fetchNuGet: add SRI hash support 2024-07-04 17:33:34 +08:00
Ivan Trubach
4caf9a61f9 buildDotnetModule: convert makeWrapperArgs to an array 2024-06-19 00:34:15 +03:00
David McFarland
b5447275d2
Merge pull request #313005 from tie/dotnet-cross
buildDotnetModule: fix structured attributes support
2024-06-17 09:43:51 -03:00
Alexis Hildebrandt
755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
Ivan Trubach
f7d8046fb8 buildDotnetModule: fix structured attributes support
This change refactors internal hooks used by buildDotnetModule to
support derivations with structured attributes. Note that this changes
variable names that the internal hooks expect.
2024-05-29 08:45:25 +03:00
Ivan Trubach
cfd1bd6141 buildDotnetModule: remove unnecessary callPackage calls
This change removes no-op callPackage calls and reformats the file with
nixpkgs-fmt.
2024-05-22 03:12:30 +03:00
Ivan Trubach
0e64e645c9 buildDotnetModule: fix cross-compilation and remove dotnet-test-sdk
This change fixes cross-compilation for .NET packages (that are not
using .sln as project files). See relevant comment in the change list
for more details.

In addition to that, it removes dotnet-test-sdk that appears to be
broken, that is, dotnet --list-sdks does not recognize SDKs from PATH,
and when propagated from the check hook it was shadowed by inputs from
preceding hooks.

Note that dotnet-test-sdk used to work when it was introduced in PR
144062, but PR 155257 probably overlooked this case. However, currently
it is not used in Nixpkgs and I think dotnetCorePackages.combinePackages
should cover the intended use case for dotnet-test-sdk.
2024-05-22 03:08:42 +03:00
Ivan Trubach
7877140075 buildDotnetModule: do not run dotnet command using env
There should be no reason to use env here:

1. In places where it is used to run dotnet with environment variables,
   the same can be done with shell syntax.

   For example, `env "FOO=$bar" baz` is equivalent to `FOO="$bar" baz`.

2. Otherwise, it just unnecessarily forces PATH lookup for dotnet
   command. In addition to that, some dotnet invocations did not use
   env.
2024-05-20 03:02:23 +03:00