!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

187 Members
59 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
25 May 2025
@reckenrode:matrix.orgRandy Eckenrode Also, how does it handle NIX_ vars? Does this even work with Darwin since Darwin needs an SDK? 13:44:42
@rosscomputerguy:matrix.orgTristan Ross
In reply to @reckenrode:matrix.org
Also, how does it handle NIX_ vars? Does this even work with Darwin since Darwin needs an SDK?
Suffix salt should work with the env vars. Idk about Darwin but it could be made to work.
14:28:05
@rosscomputerguy:matrix.orgTristan Ross
In reply to @reckenrode:matrix.org
How does crossStdenv handle cross-compiled dependencies? DXVK needs SPIRV and Vulkan headers and windows.pthreads.
You'll have to override the stdenv for the dependencies.
14:28:23
@reckenrode:matrix.orgRandy Eckenrode
In reply to @rosscomputerguy:matrix.org
You'll have to override the stdenv for the dependencies.
That doesn’t seem like an improvement.
14:29:31
@rosscomputerguy:matrix.orgTristan Ross
In reply to @reckenrode:matrix.org
That doesn’t seem like an improvement.
I don't see really any other way of doing cross without either creating a new nixpkgs instance (what we already have) or only provide cross compilation stdenv's
14:30:30
@reckenrode:matrix.orgRandy Eckenrode

DXVK uses a custom MinGW (with the Win32 thread model instead of the POSIX one). When you build dxvk on Darwin or Linux, it uses the cross-compiled 32- and 64-bit MinGW DLLs.

https://github.com/NixOS/nixpkgs/blob/6fb6fd3ceff99de72d881f1a97773647c94e5a82/pkgs/by-name/dx/dxvk/package.nix#L28-L44

DXVK itself has dependencies: spirv-headers and vulkan-headers. Fortunately, those do not have transitive dependencies. (Arguably, DXVK has more dependencies, but I didn’t bother to de-vendor them.)

https://github.com/NixOS/nixpkgs/blob/6fb6fd3ceff99de72d881f1a97773647c94e5a82/pkgs/by-name/dx/dxvk_2/package.nix#L74-L81

The replacement sounds like I need to manually enumerate the transitive dependencies of DXVK, replace all of their stdenvs and make sure they get the right dependencies themselves (thankfully easy for DXVK since they have none themselves).

15:08:53
@reckenrode:matrix.orgRandy Eckenrode crossStdenv is still expensive, but now the maintainability of my package has gone down because I have more work to do to build my package instead of just referencing pkgsCross.mingw32.dxvk_2 and pkgsCross.mingwW64.dxvk_2. 15:09:59
@reckenrode:matrix.orgRandy Eckenrode Note that it’s not possible to write a function to replace inputs that works in all cases because not all dependencies are in buildInputs (or propagatedBuildInputs). It’s the same problem that overrideSDK had. 15:15:22
@reckenrode:matrix.orgRandy Eckenrode * Note that it’s not possible to write a function to replace inputs that works in all cases because not all dependencies are in buildInputs (or propagatedBuildInputs). It’s the same problem that overrideSDK had. You’ll always need to know what dependencies your inputs have to make sure there are no problems. 15:15:44
@rosscomputerguy:matrix.orgTristan Ross
In reply to @reckenrode:matrix.org
Note that it’s not possible to write a function to replace inputs that works in all cases because not all dependencies are in buildInputs (or propagatedBuildInputs). It’s the same problem that overrideSDK had.
Yeah, I have thought about a recursiveStdenvOverride function which might work here
15:30:31
@rosscomputerguy:matrix.orgTristan RossIt would go through and apply the new stdenv where it should apply.15:30:54
@reckenrode:matrix.orgRandy Eckenrode That can’t be done in the general case. Would it be possible to have a function like yesReallyDoInstantiateAnotherNixpkgsWithStdenc for non-trivial cases? 15:31:47
@reckenrode:matrix.orgRandy Eckenrode * That can’t be done in the general case. Would it be possible to have a function like yesReallyDoInstantiateAnotherNixpkgsWithStdenv for non-trivial cases? 15:31:59
@rosscomputerguy:matrix.orgTristan Ross Idk 15:32:48
@reckenrode:matrix.orgRandy EckenrodeThinking about Wine, it has a number of vendored dependencies that would be nice to devendor. It would also be nice to build wine-mono and wine-gecko from source.15:32:54
@reckenrode:matrix.orgRandy EckenrodeI would not want to have to manually override all the dependencies to build Gecko or Mono.15:33:22
@rosscomputerguy:matrix.orgTristan RossYeah, it seems like no matter what, cross compilation is always going to be expensive but necessary.15:34:39

Show newer messages


Back to Room ListRoom Version: 9