ekleog changed the topic of #nixos-dev to: NixOS Development (#nixos for questions) | https://hydra.nixos.org/jobset/nixos/trunk-combined https://channels.nix.gsc.io/graph.html https://r13y.com | 18.09 release managers: vcunat and samueldr | https://logs.nix.samueldr.com/nixos-dev
drakonis1 has joined #nixos-dev
drakonis has quit [Ping timeout: 245 seconds]
drakonis has joined #nixos-dev
drakonis1 has quit [Ping timeout: 252 seconds]
drakonis1 has joined #nixos-dev
drakonis2 has joined #nixos-dev
drakonis has quit [Ping timeout: 245 seconds]
drakonis1 has quit [Ping timeout: 257 seconds]
orivej has quit [Ping timeout: 255 seconds]
init_6 has joined #nixos-dev
init_6 has quit [Read error: Connection reset by peer]
<samueldr> maybe related to MichaelRaskin's proposal, but which instruction set should nixpkgs target, #56786 disables checks for a package since it might end up on a machine without AVX
<{^_^}> https://github.com/NixOS/nixpkgs/pull/56786 (by Ma27, 6 days ago, open): dlib: improve AVX configuration
<samueldr> I don't like the idea of disabling the checks and still build something that the farm can't handle, and it might not be the only thing in that situation too
<samueldr> (and following a link in the PR I see there's already a small discussion about that https://discourse.nixos.org/t/targeting-particular-x86-64-generation-haswell-ivybridge-skylake/2280/10 )
pie__ has joined #nixos-dev
pie___ has quit [Ping timeout: 245 seconds]
<ma27> samueldr: may I ask what you'd do instead? I thought that without precise matching to tell which optimizations can be used, the best thing to do would be to use defaults (AVX enabled in this case) and run tests without AVX to ensure that they don't fail on a Hydra machine (building python-dlib costs time, so it shouldn't fail IMHO)
<samueldr> I see three cases: use upstream default and nothing else (current situation); ensure all of nixpkgs can be executed on a target minimum platform; mark AVX as a feature a build machine needs for that derivation and mark hydra instances which can do AVX
<samueldr> the latter is fine if it's fine that not the whole of nixpkgs can be executed on the minimum platform
<samueldr> at least, that's what I see
<samueldr> though I think this could point towards a more subtle issue, where we may have things building with features not the whole of hydra instances can handle, waiting for a long build on qemu non-kvm to see if I can repro an earlier feature
init_6 has joined #nixos-dev
qyliss_ has joined #nixos-dev
averell- has joined #nixos-dev
Haskellfant has joined #nixos-dev
qyliss has quit [*.net *.split]
averell has quit [*.net *.split]
NinjaTrappeur has quit [*.net *.split]
angerman has quit [*.net *.split]
cbarrett has quit [*.net *.split]
cocreature has quit [*.net *.split]
qyliss_ is now known as qyliss
Haskellfant is now known as cocreature
averell- is now known as averell
init_6 has quit [Read error: Connection reset by peer]
<MichaelRaskin> Right, thought about mentioning it explicitly andforgot
<MichaelRaskin> Added
johanot has joined #nixos-dev
johanot has quit [Quit: WeeChat 2.2]
init_6 has joined #nixos-dev
<ma27> samueldr: I don't think that using a minimum set of features is a good idea (at least for dlib) as people will experience significantly less performance (http://dlib.net/compile.html). Matching where to build (a.k.a which flags to use) is basically what volth and I agreed on, however this isn't implemented in nixpkgs yet. I mainly wanted to work around the issue with the probably broken builds on Hydra so
<ma27> that nobody needs to build this locally (https://github.com/NixOS/nixpkgs/pull/56786#discussion_r263563984) for now
<ma27> as soon as we have proper matching of advanced hardware features I intend to improve the code in the dlib derivation %)
orivej has joined #nixos-dev
cbarrett has joined #nixos-dev
angerman has joined #nixos-dev
NinjaTrappeur has joined #nixos-dev
init_6 has quit [Read error: Connection reset by peer]
jtojnar has quit [Quit: jtojnar]
jtojnar has joined #nixos-dev
<samueldr> the question was more general than for dlib; this is something we need to address I think since as new instruction sets arrive, it'll happen more and more
<samueldr> there are different kind of situations, specialized software which benefit greatly from them, and routine optimizations, I guess
<samueldr> should the whole of nixpkgs be usable on that minimum platform without recompilation? probably; what about specialized software? don't know how to handle it, but optimizations would be good too :/
jtojnar has quit [Read error: Connection reset by peer]
jtojnar has joined #nixos-dev
jtojnar has quit [Remote host closed the connection]
JosW has joined #nixos-dev
contrapumpkin has joined #nixos-dev
copumpkin has quit [Ping timeout: 255 seconds]
copumpkin has joined #nixos-dev
contrapumpkin has quit [Ping timeout: 245 seconds]
drakonis has joined #nixos-dev
asymmetric has joined #nixos-dev
lopsided98 has quit [Quit: No Ping reply in 180 seconds.]
lopsided98 has joined #nixos-dev
<catern> hmm so there's a regression in restrict-eval and pure-eval modes, if you use a non-default store location by setting NIX_REMOTE, it won't work in Nix 2.1.3 and will work in Nix 2.0.1
<catern> NIX_REMOTE=~/nix nix --option pure-eval 1 eval '(1+1)'
lopsided98 has quit [Ping timeout: 252 seconds]
<catern> fails (with an not-too-scrutable error) in 2.1.3, worked in 2.0.1
<catern> specifically it fails on this path https://github.com/NixOS/nix/blob/master/src/libexpr/eval.cc#L310 in the search path not being valid
<catern> what I don't get is why it worked in 2.0.1
<LnL> you can't use <nix> unless it's in the target store
<catern> isInStore is incorrectly firing on the <nix> added to the include path
<catern> LnL: no, I'm not using it, it fails before any evaluation takes place, when it tries to process the search path as done in that commit I just linked, and fails when it hits the nix entry
<LnL> oh, you're not using it?
<catern> right, this command fails:
<catern> NIX_REMOTE=~/nix nix --option pure-eval 1 eval '(1+1)'
<catern> or restrict-eval 1
<LnL> ah I see now
lopsided98 has joined #nixos-dev
<catern> so isInStore incorrectly returns true on the <nix> path
<catern> because storeDir is /nix/store, even though I've set NIX_REMOTE=~/nix. so that's what I don't get now... why is storeDir like that?
<clever> catern: i have a related gist
<clever> let me find it
<LnL> but it's not true, nix isn't in the realStoreDir
<clever> NIX_REMOTE=local?root=/home/clever/rootfs makes nix prefix that path on all store access
<clever> NIX_CONF_DIR=/home/$X/etc/nix changes where /etc/nix is, combined with the previous, results in it being /home/clever/rootfs/home/$X/etc/nix
<clever> NIX_LOG_DIR=/home/$X/nix/var/log/nix moves the /nix/var/log/nix/, which also obeys the prefix
<clever> NIX_STORE=/home/$X/nix/store changes /nix/store, so it lands in /home/clever/rootfs/home/$X/nix/store
<clever> NIX_STATE_DIR=/home/$X/nix/var changes the /nix/var/ dir
<clever> nix.override { storeDir = "/home/'$X'/nix/store"; stateDir = "/home/'$X'/nix/var"; confDir = "/home/'$X'/etc"; }
<catern> LnL: right, so isInStore should definitely be false, but it's going off of storeDir instead of realStoreDir... why do both of those two exist instead of just having one storeDir?
<clever> and this builds a modified nix within that store, that has all of those baked into it!
<clever> then, you can tar /home/clever/rootfs up, and unpack it such that /home/clever/rootfs/home/$X/nix/store lands at /home/$X/nix/store
<LnL> the build doesn't know the real path but nix needs to know both to put stuff in the right place
<catern> I don't think that's relevant, this is just a bug in the interaction between localStore with a non-default store path and restricted evaluation mode
<LnL> but it's relatively new so not all cases use the new realStoreDir correctly
<clever> LnL: i have 2 or 3 open bugs on nix involving that
<catern> LnL: hmm I see
<catern> LnL: so, I want to actually change the store dir, though
<catern> like, have builds using /whatever/nix/store
<catern> is that not possible at runtime?
<{^_^}> nix#2381 (by cleverca22, 27 weeks ago, open): builtins.readDir does not respect `local?root=`
<{^_^}> nix#2174 (by cleverca22, 41 weeks ago, open): nix-collect-garbage doesnt obey local?root=/mnt
<{^_^}> nix#2125 (by cleverca22, 45 weeks ago, open): indirect roots dont work with local?root=/mnt
<catern> I assumed that localStore with a different store dir would actually change the store dir, not try to do the magic container thing
<LnL> then you want to actually change the storeDir instead
<clever> which is $NIX_STORE and the storeDir= under .override
<clever> depending on if its a one-off, or something you want to bake into the binary
<LnL> there are a bunch of different ways of relocating with different semantics
<LnL> --store /foo == --store local?store=/nix/store&real=/foo IIRC
<catern> ah, I see, I see
<catern> LnL: yes, that looks right to me
<LnL> ah no it's local?root=/foo
JosW has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<manveru> can someone explain how the nix hashing algo works?
<manveru> i basically have a lockfile with the hashes of `cat $lib/VERSION $lib/metadata.config $lib/contents.tar.gz | sha256sum -` and would like to build a fetcher for it so i don't need to build a separate lockfile for nix that has to be generated
<manveru> in theory, i could put that concatenated thing in the nix store, and in the next step cut everything until the gzip header to just get the contents.tar.gz, would that be a good idea?
drakonis2 has quit [Quit: WeeChat 2.3]
asymmetric has quit [Ping timeout: 245 seconds]
asymmetric has joined #nixos-dev
<clever> manveru: nix uses the hash of the nar, so nix-store --dump $lib | sha256sum -
<manveru> i guess that's order-dependent though :|
<clever> manveru: the rules of a nar file enforce a consistant sorting order, so it always gives the same hash
<manveru> yeah, but that doesn't match the order of the hashing algo in the lockfile
<manveru> anw, i'll try my way for now, i think it has a chance to work :)
<manveru> problem is that it will still rely on IFD to convert that lockfile from elixir syntax to nix...
<clever> manveru: one option, is to not try to convert the lock file and hashes into a single recursive nix hash
<clever> manveru: instead, create a dozen flat nix hash derivations (basically, fetchurl), for every input in the upstream lock file
<clever> manveru: then have a non-fixed derivation, that combines them all together
<clever> 133 outputHashMode = if (recursiveHash || executable) then "recursive" else "flat";
<clever> if you set `outputHashMode = "recursive";` then nix will use the hash of the NAR, which is hard for you to convert to
<manveru> but that leads to refetching of all the constituents
<clever> but if you set `outputHashMode = "flat";` then its just the raw hash of $out, which must be a single file
<clever> thats going to match your lock file a lot better
<clever> and each constituent dep is a single derivation, that it can fetch&cache seperately
<manveru> hmm
<gchristensen> that'll be much nicer
<manveru> i think i'm lost there :)
<clever> manveru: go thru the lock file, and find every URL + sha256 pair, and then create a fetchurl call for each one
<clever> manveru: and then have a non-fixed derivation that joins all of those into a single directory (preferably with symlinks)
<manveru> so, you'd only specify a single hash for the toplevel symlink tree of all the derivations?
<clever> the symlink tree is not a fixed-output drv
<clever> so its $out will depend on the sha256 of every input fetchurl (and also the build of coreutils)
<manveru> lemme see if i can make that work
MichaelRaskin has quit [Quit: MichaelRaskin]
asymmetric has quit [Ping timeout: 250 seconds]
lopsided98 has quit [Quit: Disconnected]
lopsided98 has joined #nixos-dev
lopsided98 has quit [Client Quit]
<thoughtpolice> gchristensen: Around still? You pinged yesterday
lopsided98 has joined #nixos-dev
tilpner has quit [Quit: WeeChat 2.4]
orivej has quit [Ping timeout: 245 seconds]
tilpner has joined #nixos-dev
orivej has joined #nixos-dev
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #nixos-dev