| 31 Dec 2023 |
| Philip Taron (UTC-8) changed their display name from Philip Taron to Philip Taron (UTC-8). | 18:10:52 |
| 11 Jan 2024 |
| SomeoneSerge (hash-versioned python modules when) joined the room. | 00:37:33 |
SomeoneSerge (hash-versioned python modules when) | Hi! We've been using something relatively ugly in cudaPackages because the "cuda compiler driver" usually needs an old gcc, but the libraries it produces need to co-exist with the normal nixpks shared libraries in the same process, and so they need to link against the same c++ standard library. It's like with clang using libstdc++, only the old gcc in place of clang.
I now consider using this uglyness outside cudaPackages because e.g. tensorflow also has some ideas about which compilers it's compatible with. I was suggested that instead of introducing new attributes or changing the meaning of attributes like gccXXStdenv I write a "stdenv adapter".
The hack is (ab)using wrapCCWith with gccForLibs. One bit I'm unsure of is whether I should pass wrapCC the target stdenv's wrapped cc, or the unwrapped one: https://github.com/NixOS/nixpkgs/pull/275947/commits/30016f9c4622fca0145e9904f471079e9393eff1#diff-cea9c91ed8344102b5d5fbf28eae400b8182d3b51d718f88345de8c7a187165fR243
We've been using the unwrapped one so far (because it didn't matter), but I wonder if discarding the old wrappers flags&c is the right thing to do in the general case? This suggests the 2nd question, do wrapCCs compose? | 00:45:00 |
| connor (he/him) (UTC-5) joined the room. | 04:11:57 |
| Théophane joined the room. | 06:10:15 |
| Théophane left the room. | 06:11:19 |
| layus joined the room. | 08:26:49 |
| Toma joined the room. | 11:42:12 |
| 12 Jan 2024 |
| Sean Link joined the room. | 23:06:36 |
| eryngion joined the room. | 23:07:01 |
Sean Link | Hey everyone.
Have been working on getting qtbase and qtmultimedia cross compiling for windows. See https://github.com/NixOS/nixpkgs/issues/274274 https://github.com/NixOS/nixpkgs/issues/272538 https://github.com/seanybaggins/qt-package-overalys
I got an example application cross compiling to windows. You can reproduce my results by doing the following
git clone https://github.com/seanybaggins/qt-package-overalys
nix build '.#pkgs.pkgsCross.qtapp-example
nix copy ../releases/qtapp-example '.#pkgs.pkgsCross.mingw32.qtapp-example' --no-check-sigs
cd ../releases/qtapp-example
mkdir staging
cp -r --dereference ./nix/store/<hash>-qtapp-example-i686-w64-mingw32-6.5.1/bin/* staging
# run inno setup. I used bottes to run it on linux. This is the iss file that I made to do the build
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "https://www.example.com/"
#define MyAppExeName "untitled.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{89681292-40F7-4D19-952B-8D51D68A6FC8}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableDirPage=yes
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputBaseFilename=mysetup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "Z:\<your-path>\releases\qtapp-example\staging\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "Z:\<your-path>\releases\qtapp-example\staging\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
As you can see, there were some lingering steps that I needed to run so I could get rid of symlinks and then run inno setup. Was wondering if some changes could be made within stdenv so I have an option to deference symbolic links within my derivation.
| 23:13:49 |
| 16 Jan 2024 |
SomeoneSerge (hash-versioned python modules when) | In reply to @ss:someonex.net
Hi! We've been using something relatively ugly in cudaPackages because the "cuda compiler driver" usually needs an old gcc, but the libraries it produces need to co-exist with the normal nixpks shared libraries in the same process, and so they need to link against the same c++ standard library. It's like with clang using libstdc++, only the old gcc in place of clang.
I now consider using this uglyness outside cudaPackages because e.g. tensorflow also has some ideas about which compilers it's compatible with. I was suggested that instead of introducing new attributes or changing the meaning of attributes like gccXXStdenv I write a "stdenv adapter".
The hack is (ab)using wrapCCWith with gccForLibs. One bit I'm unsure of is whether I should pass wrapCC the target stdenv's wrapped cc, or the unwrapped one: https://github.com/NixOS/nixpkgs/pull/275947/commits/30016f9c4622fca0145e9904f471079e9393eff1#diff-cea9c91ed8344102b5d5fbf28eae400b8182d3b51d718f88345de8c7a187165fR243
We've been using the unwrapped one so far (because it didn't matter), but I wonder if discarding the old wrappers flags&c is the right thing to do in the general case? This suggests the 2nd question, do wrapCCs compose? Heeey a new question: wrapCCWith takes a coreutils, and now should one manually pass buildPackages.coreutils to wrapCCWith, or should one call buildPackages.wrapCCWith or does this look like I made a terrible mistake early on and this question should never have arisen?
Context: https://github.com/NixOS/nixpkgs/pull/281371 | 19:17:48 |
connor (he/him) (UTC-5) | Nah, this is unrelated to the work you did the last few weeks | 19:24:51 |
connor (he/him) (UTC-5) | I never thought to try buildPackages.wrapCCWith -- interesting | 19:25:15 |
SomeoneSerge (hash-versioned python modules when) | (currently pondering at the scary thought of whether the package set we should be taking coreutils from depends on targetStdenv, my brain so slow) | 19:25:49 |
connor (he/him) (UTC-5) | I mean, stdenv.cc.coreutils_bin seems to always be correct, so you could just take it from there | 19:28:49 |
SomeoneSerge (hash-versioned python modules when) | In reply to @connorbaker:matrix.org I mean, stdenv.cc.coreutils_bin seems to always be correct, so you could just take it from there But which stdenv 🙃 | 19:29:15 |
connor (he/him) (UTC-5) | the model stdenv I think | 19:29:49 |
SomeoneSerge (hash-versioned python modules when) | targetStdenv I guess, in terms of the referenced code | 19:29:48 |
connor (he/him) (UTC-5) | lmao | 19:29:56 |
SomeoneSerge (hash-versioned python modules when) | I almost fell off the chair | 19:30:07 |
connor (he/him) (UTC-5) | Anyway, what I had meant to get across was that legacyPackages.x86_64-linux.stdenv.cc.coreutils_bin and legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.stdenv.cc.coreutils_bin are identical | 19:30:55 |
connor (he/him) (UTC-5) | imho this "pass the correct coreutils" is a workaround for a wrapCCWith not selecting the correct version of coreutils | 19:32:26 |
connor (he/him) (UTC-5) | * imho this "pass the correct coreutils" is a workaround for wrapCCWith not selecting the correct version of coreutils | 19:32:36 |
SomeoneSerge (hash-versioned python modules when) | wrapCCWith is selecting the coreutils I told it to select (I did hard-code pkgs.wrapCCWith, and did call it from pkgs.stdenvAdapters.useLibsFrom) | 19:33:09 |
connor (he/him) (UTC-5) | (I had patched wrapCCWith to choose coreutils from buildPackages if it was available instead of defaulting to the one from pkgs and that helped) | 19:33:49 |
SomeoneSerge (hash-versioned python modules when) | I think
useLibsFrom = modelStdenv: targetStdenv: wrapCCWith { ...; inherit (targetStdenv) coreutils; }
would've been "correct": targetStdenv is the one that has the right gcc and other native tools, so it should have the right coreutils as well, and we only want the host libraries from the other
Only stdenv doesn't expose coreutils, it exposes a string | 19:36:16 |
connor (he/him) (UTC-5) | This one?
nix-repl> :t legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.stdenv.cc.coreutils_bin
a set
| 19:38:07 |
connor (he/him) (UTC-5) | buildPackages.stdenvAdapter.useLibsFrom works by the way -- any ideas if modelStdenv and targetStdenv should be retrieved from pkgs or buildPackages? | 19:40:03 |
SomeoneSerge (hash-versioned python modules when) | The latter depends strictly on the use-case. The former works by accident, i.e. only in this particular configuration | 19:41:05 |