!OqhvaDMJdKYUicLDiE:nixos.org

Nixpkgs Stdenv

256 Members
79 Servers

Load older messages


SenderMessageTime
16 Jan 2024
@ss:someonex.netSomeoneSerge (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
@connorbaker:matrix.orgconnor (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
@ss:someonex.netSomeoneSerge (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
@connorbaker:matrix.orgconnor (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
@connorbaker:matrix.orgconnor (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
@ss:someonex.netSomeoneSerge (nix.camp)The latter depends strictly on the use-case. The former works by accident, i.e. only in this particular configuration19:41:05
@ss:someonex.netSomeoneSerge (nix.camp)(I think)19:41:11
@ss:someonex.netSomeoneSerge (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
@ss:someonex.netSomeoneSerge (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
@ss:someonex.netSomeoneSerge (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 builds19:43:22
@ss:someonex.netSomeoneSerge (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 builds19:43:36
@ss:someonex.netSomeoneSerge (nix.camp) (I suppose optionalString doesn't enforce types, does it) 19:44:33
@ss:someonex.netSomeoneSerge (nix.camp) *

(I suppose optionalString doesn't enforce types, does it)

EDIT:

nix-repl> lib.optionalString true {}
{ }
19:45:15
@ss:someonex.netSomeoneSerge (nix.camp)Legit19:45:36
@connorbaker:matrix.orgconnor (he/him) (UTC-5)Ah yeah lol19:45:38
@connorbaker:matrix.orgconnor (he/him) (UTC-5)The return type depends on the value of the first argument19:46:37
@connorbaker:matrix.orgconnor (he/him) (UTC-5)love it when things are dependently typed without being able to express that in any way19:46:52
@ss:someonex.netSomeoneSerge (nix.camp)Wdym dependently typed, it's just a sum19:47:13
@connorbaker:matrix.orgconnor (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
@connorbaker:matrix.orgconnor (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:matrix.orgyannham joined the room.16:53:41
18 Jan 2024
@ss:someonex.netSomeoneSerge (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
@ss:someonex.netSomeoneSerge (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
@ss:someonex.netSomeoneSerge (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
@r_i_s:matrix.orgris_ joined the room.22:03:18
@r_i_s:matrix.orgris_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 release22:04:16
@raitobezarius:matrix.orgraitobezariusnot a stdenv person per se but you have my approval22:04:54
20 Jan 2024
@r_i_s:matrix.orgris_i may have to just take the merge-and-apologize approach16:29:29
@raitobezarius:matrix.orgraitobezariusI think so16:29:41
21 Jan 2024
@r_i_s:matrix.orgris_merging before i lose my nerve13:32:31

Show newer messages


Back to Room ListRoom Version: 9