| 22 Aug 2025 |
emily | so leaning more towards "llvmPackages wire-up is busted", as I've observed that myself | 11:09:14 |
| André Lima joined the room. | 15:07:26 |
| elikoga changed their profile picture. | 17:27:46 |
| 23 Aug 2025 |
André Lima | Any tips on cross-compiling a package out-of-tree with a compiler that's also built out-of-tree? I was looking into mkScopeWithSplicing', but I'm not sure how to use it outside of the Nixpkgs repository.
The concrete goal I'm trying to achieve is 1. compile a specific revision of LLVM that's used by Polygeist and 2. be able to use the clang compiler with the libc provided by that revision to cross-compile programs to another architecture. Any help is appreciated 🙏 | 22:37:19 |
| 24 Aug 2025 |
| RichInOverdraft changed their display name from Richman to rich. | 04:10:44 |
Artturin | With overlays | 12:22:57 |
Artturin | * With a overlay | 12:23:14 |
Artturin | Then you can use mkScopeWithSplicing because the set will be available top-level | 12:24:03 |
Artturin | * Then you can use makeScopeWithSplicing' because the set will be available top-level | 12:24:50 |
Artturin | You don't necessarily need a scope | 12:28:13 |
Artturin | Use overlays and callPackage to get deps, then you don't have to do anything non-cross specific unless the package itself needs something | 12:28:39 |
Artturin | * Use overlays and callPackage to get deps, then you don't have to do anything cross specific unless the package itself needs something | 12:28:55 |
André Lima | That's very helpful, thanks | 12:33:44 |
Artturin | * Define your packages in an overlay and use callPackage in the overlay to get deps, then you don't have to do anything cross specific unless the package itself needs something | 12:34:05 |
emily | I think you can use it without an overlay if you use splice.nix right? | 12:56:45 |
Artturin | splice.nix doesn't help with that | 12:59:48 |
Artturin | You can get otherSplices without an overlay if you use all the different callPackages yourself | 13:00:15 |
emily | it provides a generateSplicesForMkScope you can use with makeScopeWithSplicing' right? but I guess the problem is mixing in stuff from the main package set… | 13:00:19 |
Artturin | generateSplicesForMkScope gets from pkgsBuildBuild and so on | 13:00:39 |
Artturin | selfBuildBuild = lib.attrByPath (split "pkgsBuildBuild") bad pkgs;
selfBuildHost = lib.attrByPath (split "pkgsBuildHost") bad pkgs;
selfBuildTarget = lib.attrByPath (split "pkgsBuildTarget") bad pkgs;
selfHostHost = lib.attrByPath (split "pkgsHostHost") bad pkgs;
selfHostTarget = lib.attrByPath (split "pkgsHostTarget") bad pkgs;
selfTargetTarget = lib.attrByPath (split "pkgsTargetTarget") { } pkgs;
| 13:00:48 |
emily | I really wish we could have generic builder functions for compiler scopes that can be used out-of-tree to produce correct cross results without an overlay | 13:00:50 |
Artturin | Used like this otherSplices = generateSplicesForMkScope "xfce"; | 13:01:58 |
Artturin | * For example, the xfce set uses it like this otherSplices = generateSplicesForMkScope "xfce"; | 13:04:10 |
Sergei Zimmerman (xokdvium) | In reply to @emilazy:matrix.org I really wish we could have generic builder functions for compiler scopes that can be used out-of-tree to produce correct cross results without an overlay I think there are sort of? https://github.com/NixOS/nixpkgs/pull/426889
CppNix flake does cross without overlays now. | 14:05:24 |
Artturin | https://github.com/NixOS/nixpkgs/pull/426984
https://github.com/NixOS/nixpkgs/pull/267792 | 14:08:50 |
emily | you can certainly just roll your own yeah, but I'm talking about things like mkLLVMPackages | 14:12:37 |
emily | where it would be nice to offer a clean interface to instantiate your own LLVM version that can do cross, outside of Nixpkgs, without an overlay | 14:12:50 |
emily | interesting thanks | 14:13:07 |
emily | to be clear I wouldn't even be that upset if it doesn't work with splicing :P | 14:13:35 |
emily | just so long as you can actually reasonably access it across platforms | 14:13:49 |