!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

398 Members
92 Servers

Load older messages


SenderMessageTime
14 Oct 2024
@artturin:matrix.orgArtturin
In reply to @reckenrode:matrix.org
I think depsBuildBuild should work. The new SDK stuff supports it, so I should be able to add the 15.0 SDK there as well.
For a depsBuildBuild compiler the libs will be in nativeBuildInputs usually
02:13:42
@reckenrode:matrix.orgRandy Eckenrode Just as long as it gets _FOR_BUILD when doing the roles stuff, so it stays out of the Windows cross. 02:14:24
@artturin:matrix.orgArtturinYup should be like that02:15:05
@artturin:matrix.orgArtturinJust do what you did in dxvk but with the addition of depsBuildBuild compiler02:17:34
@reckenrode:matrix.orgRandy EckenrodeThanks. This is going to be a pretty interesting build. It’s using clang for both the native and cross compiler, and it needs to link against LLVM for Windows as well.02:21:48
15 Oct 2024
@yehowshua:matrix.orgyehowshua removed their profile picture.17:19:27
17 Oct 2024
@joerg:thalheim.ioMic92 changed their display name from Mic92 to Mic3000.06:51:17
@joerg:thalheim.ioMic92 changed their display name from Mic3000 to Mic3000 πŸŒ‹.06:51:46
@joerg:thalheim.ioMic92 changed their display name from Mic3000 πŸŒ‹ to Mic92.12:22:31
18 Oct 2024
@greg:thehellings.comgreg 12:52:32
@icurtis:matrix.orgisaac joined the room.18:33:57
19 Oct 2024
@jackwilsdon:matrix.orgjackwilsdon

Trying to fix cross-compilation for countourpy. It stores information about its build environment in a .py file, including the path to the Python executable.

What's the right way to go about making this cross compile properly? The build environment file is generated using the builder Python. The simplest option I can see is just using substituteInPlace in post-build to replace the build Python with the target Python, but it feels a bit hacky.

04:03:16
@artturin:matrix.orgArtturinLook at upstream to see how it's generated and if anythings configurable04:05:45
@artturin:matrix.orgArtturinIf not then substiture04:06:10
@artturin:matrix.orgArtturin* If not then substitute04:06:17
@jackwilsdon:matrix.orgjackwilsdonWe could patch this and do a substitute on the patch before applying it, but not sure if that's really any better: https://github.com/contourpy/contourpy/blob/27160ab9a3f2d32f8d6b1990ae2919475c322283/lib/contourpy/util/meson.build#L2304:13:03
@artturin:matrix.orgArtturin

And check that output doesn't depend on build deps

nix path-info -r ./result look for paths without the target suffic

04:13:12
@artturin:matrix.orgArtturin* And check that output doesn't depend on build deps nix path-info -r ./result look for paths without the target suffix04:13:29
@jackwilsdon:matrix.orgjackwilsdonThe output currently does depend on the wrong Python which is causing the build failure, will check the other dependencies too04:13:35
@artturin:matrix.orgArtturin* And check that output doesn't depend on build deps `nix path-info -r ./result` look for paths without the target suffix04:13:42
@jackwilsdon:matrix.orgjackwilsdon

This is what I'm looking to fix:

error: output '/nix/store/gnk9kd5j28wm94m0pfk21rdbyzyvkypd-python3.12-contourpy-1.2.1-aarch64-unknown-linux-gnu' is not allowed to refer to the following paths:
         /nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6

The only reference to the wrong Python is in this build info file.

04:14:07
@artturin:matrix.orgArtturin
In reply to @jackwilsdon:matrix.org
We could patch this and do a substitute on the patch before applying it, but not sure if that's really any better: https://github.com/contourpy/contourpy/blob/27160ab9a3f2d32f8d6b1990ae2919475c322283/lib/contourpy/util/meson.build#L23
Without patch is more sustainable
04:15:38
@jackwilsdon:matrix.orgjackwilsdon

Testing this:

    postBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ''
      find . -name __pycache__ -type d -depth -delete
      substituteInPlace util/_build_config.py \
        --replace-fail ${python.pythonOnBuildForHost.interpreter} ${python.interpreter}
    '';

04:17:20
@artturin:matrix.orgArtturinAssuming it's not embedded in binaries04:17:26
@jackwilsdon:matrix.orgjackwilsdonIt's not, it's just in a plaintext Python file04:17:35
@artturin:matrix.orgArtturinThe things upstreams do :/04:20:49
@jackwilsdon:matrix.orgjackwilsdonIt looks like I'm going to have to do this in postPatch as a substituteInPlace to modify the input file, as there isn't a good point for me to intercept the built file afterwards (the meson-python library it's using builds into a temporary directory with a random name, then it's bundled into a wheel so I can't modify it there either)04:22:34
@jackwilsdon:matrix.orgjackwilsdonI guess I could modify it postInstall04:23:00
@artturin:matrix.orgArtturinEither works04:25:35
@jackwilsdon:matrix.orgjackwilsdon
$ nix path-info -r ./result | grep -v aarch64-unknown-linux
/nix/store/iv4iygkdy52b8vawy0b5aqxi7lpk7afy-cross-file.conf

seems promising!

04:31:29

Show newer messages


Back to Room ListRoom Version: 6