| 16 Jan 2024 |
SomeoneSerge (nix.camp) | 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 (nix.camp) | 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 (nix.camp) | The latter depends strictly on the use-case. The former works by accident, i.e. only in this particular configuration | 19:41:05 |
SomeoneSerge (nix.camp) | (I think) | 19:41:11 |
SomeoneSerge (nix.camp) | In reply to @connorbaker:matrix.org
This one?
nix-repl> :t legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform.stdenv.cc.coreutils_bin
a set
Maybe I got an old nixpkgs check-out, but I'm looking at a line starting with coreutils_bin = optionalString ... | 19:41:41 |
SomeoneSerge (nix.camp) | * The latter depends strictly on the use-case. The former works by accident, i.e. only in this particular configuration (just as the original implementation did "work" for native builds) | 19:42:48 |
SomeoneSerge (nix.camp) | * The latter depends strictly on the use-case. The former works (?) by accident, i.e. only in this particular offsets, just as the original implementation did "work" for native builds | 19:43:22 |
SomeoneSerge (nix.camp) | * The latter depends strictly on the use-case. The former works (?) by accident, i.e. only for these articular offsets, just as the original implementation did "work" for native builds | 19:43:36 |
SomeoneSerge (nix.camp) | (I suppose optionalString doesn't enforce types, does it) | 19:44:33 |
SomeoneSerge (nix.camp) | * (I suppose optionalString doesn't enforce types, does it)
EDIT:
nix-repl> lib.optionalString true {}
{ }
| 19:45:15 |
SomeoneSerge (nix.camp) | Legit | 19:45:36 |
connor (he/him) (UTC-5) | Ah yeah lol | 19:45:38 |
connor (he/him) (UTC-5) | The return type depends on the value of the first argument | 19:46:37 |
connor (he/him) (UTC-5) | love it when things are dependently typed without being able to express that in any way | 19:46:52 |
SomeoneSerge (nix.camp) | Wdym dependently typed, it's just a sum | 19:47:13 |
connor (he/him) (UTC-5) | You can write it as optionalString : Bool -> a -> String | a, sure, but it's more precise to say that it is a string when the boolean argument is false (specifically the empty string), and the second argument when the boolean argument is true | 20:01:10 |
connor (he/him) (UTC-5) | Python lets us get a bit closer using overload:
from typing import Literal, overload
@overload
def optionalString[_](b: Literal[False], value: object) -> Literal[""]: ...
@overload
def optionalString[a](b: Literal[True], value: a) -> a: ...
def optionalString[a](b: bool, value: a) -> Literal[""] | a:
return value if b else ""
| 20:05:47 |
| 17 Jan 2024 |
| yannham joined the room. | 16:53:41 |
| 18 Jan 2024 |
SomeoneSerge (nix.camp) | Note: https://github.com/NixOS/nixpkgs/pull/281371 and https://github.com/NixOS/nixpkgs/pull/281750 need answers from people familiar with the cc-wrapper | 14:35:49 |
SomeoneSerge (nix.camp) | * Note: https://github.com/NixOS/nixpkgs/pull/281371 and https://github.com/NixOS/nixpkgs/pull/281750 need answers from people familiar with the cc-wrapper
EDIT: also please do redirect me if this isn't the righ room though I guess it is | 22:02:25 |
SomeoneSerge (nix.camp) | * Note: https://github.com/NixOS/nixpkgs/pull/281371 and https://github.com/NixOS/nixpkgs/pull/281750 need answers from people familiar with the cc-wrapper
EDIT: also please do redirect me if this isn't the right room though I guess it is | 22:02:32 |
| 19 Jan 2024 |
| ris_ joined the room. | 22:03:18 |
ris_ | would be great to get some movement on https://github.com/NixOS/nixpkgs/pull/274089 - there are two more hardening flags after this i'd like to get into the next release | 22:04:16 |
raitobezarius | not a stdenv person per se but you have my approval | 22:04:54 |
| 20 Jan 2024 |
ris_ | i may have to just take the merge-and-apologize approach | 16:29:29 |
raitobezarius | I think so | 16:29:41 |
| 21 Jan 2024 |
ris_ | merging before i lose my nerve | 13:32:31 |