gchristensen 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 | 18.09 release managers: vcunat and samueldr | https://logs.nix.samueldr.com/nixos-dev
phreedom_ has joined #nixos-dev
phreedom has quit [Ping timeout: 256 seconds]
<ekleog> zimbatm: oh? I thought to remember you were the one who created it, sorry then… any idea who I can poke for a change to either the RFC repo or discourse? :)
sir_guy_carleton has joined #nixos-dev
lassulus_ has joined #nixos-dev
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ is now known as lassulus
phreedom has joined #nixos-dev
phreedom_ has quit [Ping timeout: 256 seconds]
jtojnar has joined #nixos-dev
phreedom has quit [Remote host closed the connection]
phreedom has joined #nixos-dev
phreedom_ has joined #nixos-dev
phreedom has quit [Ping timeout: 256 seconds]
<zimbatm> ekleog: I only have admin on discourse
<ekleog> zimbatm: oh 'k, so if you wish to create a pre-RFC category on discourse… :° (I guess it's possible to post to Development, but… sounds like it'd mix up RFC and non-RFC talks… not sure whether that's a problem, though, will do if you think it'd be better)
<ekleog> btw, just came upon https://discourse.nixos.org/t/about-the-development-category/88 … I guess it'd deserve an edit? :°
sir_guy_carleton has quit [Ping timeout: 244 seconds]
goibhniu has joined #nixos-dev
Cale has quit [Remote host closed the connection]
pie__ has joined #nixos-dev
pie_ has quit [Ping timeout: 260 seconds]
Cale has joined #nixos-dev
orivej has joined #nixos-dev
<domenkozar> morning!
<{^_^}> nixos-weekly#65 (by domenkozar, 6 days ago, open): Call for Content: 2018/10
<domenkozar> anything to add for tomorrow?
<domenkozar> when is 18.09 release?
<domenkozar> samueldr: ^^
<ekleog> gchristensen: ^ if you want your post to get in nixos weekly? :)
<gchristensen> heck yes I do!
<domenkozar> oh this one is going to be juicy
<domenkozar> making a special announcement also today :-)
<gchristensen> domenkozar: you can not publish them all at the same time! you can same some juicy stuff for next week to even them out
<domenkozar> dunno, feels a bit of a shame to hold news, I'd rather have one juicy week and skip another
<domenkozar> could also just shift to bi-weekly email for now
<Profpatsch> Sounds reasonable.
<Profpatsch> gchristensen: I’d like the manual to have permalinks for each builtin function definition.
<gchristensen> oh we can do that
<Profpatsch> Do you have any inputs about what I might need to change in the docbook (template)?
<gchristensen> notably, it already has IDs: https://nixos.org/nix/manual/#builtin-toFile
<Profpatsch> Huh, I couldn’t see any IDs in the HTML for getEnv?
<gchristensen> interesting, only some have IDs
<Profpatsch> huh
<Profpatsch> The subsections already have permalinks on hover.
<gchristensen> right, so each varlistentry in builtins.xml needs xml:id='builtins-xxxx' added
<Profpatsch> I’d argue every definition should get one, also each example.
<Profpatsch> Not possible to do this automatically?
<Profpatsch> Should be a templating thing, right?
<gchristensen> we need to give the elements IDs and then we can update the XSLT to add permalink-on-hovers
<Profpatsch> Wikipedia does this for example, it adds ids automatically.
<gchristensen> that is true
<Profpatsch> There is a `generate-id()` function in XSLT
orivej has quit [Ping timeout: 252 seconds]
<gchristensen> IMO we should just add some IDs with good human-readable names
<gchristensen> it will take all but 10 minutes
<Profpatsch> > In fact, if you run the same stylesheet with the same input document a second time, the XSLT processor may not generate the same ID values that it generated the first time.
<{^_^}> error: syntax error, unexpected ',', expecting ')', at (string):196:8
<Profpatsch> lol, so it’s useless
<gchristensen> this is why I've worked so hard to remove auto-generated IDs from our docs
<Profpatsch> Ah, that’s news to me.
<Profpatsch> But I see.
<domenkozar> btw asciidoctor auto generates human readable ids
<domenkozar> just saying :)
<Profpatsch> “If you set this parameter's value to 1, then the template named object.id will replace the use of the function generate-id() with <xsl:number level="multiple" count="*"/>. This counts preceding elements to generate a unique number for the id value.”
<Profpatsch> lol, so this docbook option is even more useless than generate-idn)
<Profpatsch> Because it will not only create different ids, it will also make them point to different parts of the document if something is added or removed.
<gchristensen> yes, it doesn't take long to find out you don't want them https://nixos.org/nix/manual/#idm140737318528048
<domenkozar> hm, I might do another experiment for documentation, seems like asciidoctor can output to either html5 or docbook
<domenkozar> and if claims are true, conversion should be isomorphic and thus almost lossless
<Profpatsch> ahem, isomorphic means lossless.
<domenkozar> "and thus"
<gchristensen> "almost"
<Profpatsch> :D
<gchristensen> Profpatsch: would you mind adding IDs?
<Profpatsch> can do
<gchristensen> I'm digging in to the generation step
<domenkozar> actuall this time it's going to be more painful
<domenkozar> we've accumulated quite a bit of markdown
<gchristensen> unfortunately so
<gchristensen> Profpatsch: so I have a way to do it, but it is ugly... I'll be asking someone for further help in a couple hours when they're awake
<Profpatsch> gchristensen: The problem is they need to be *stable between runs*, but also *unique*.
<gchristensen> Profpatsch: adding IDs should be done by hand, via xml:id="builtins-xxxx"
<Profpatsch> Yeah.
<Profpatsch> Ah, you mean you found a way to generate anchors?
<gchristensen> the thing I have a way to do, but is ugly, is adding the little linkey thing.
<Profpatsch> There’s already a little linkey thing on headers.
<Profpatsch> Can’t copy that?
<gchristensen> it is ugly because the ID is on an <a> with no inner elements or text, so you have to hover over a secret square to find it. some possible solution I'll explore but first I need to make breakfast
<Profpatsch> +2
<Profpatsch> I think it was a mistake that ids have to be globally unique in XML documents.
<Profpatsch> Should have been a path down the document or something.
<gchristensen> makes it more complicated for cross-linking docs though I think
<Profpatsch> Or maybe we shouldn’t use ids for permalinks?
<gchristensen> they're not necessarily permalinks, but for ... identifying ... the element :)
<gchristensen> we could have cross-linking nixpkgs <-> nixos without much trouble, using IDs of each other's elements
<Profpatsch> As long as they are stable. :)
<gchristensen> exactly, though the validiting of the links is checked at build time
<Profpatsch> gchristensen: Huh, you should add some <variablelist> examples to docbook.rocks as well.
<gchristensen> yeah, I've considered adding another page for slightly more complex stuff
<Profpatsch> Having to read docbook documentation completely sucks the joy out of it https://tdg.docbook.org/tdg/4.5/variablelist.html
<Profpatsch> Which is ironic.
<gchristensen> oh, yeah, it took me a long time to feel comfortable reading that page. in general, don't need to look when you're doing simple expansion of nix* docs
<Profpatsch> Ah, here’s more welcoming site: http://doccookbook.sourceforge.net/html/en/dbc.markup.lists.html
<gchristensen> oh much nicer
<Profpatsch> haha, doccookbook
<gchristensen> ah nice, Tom works on opensuse's docs
<Profpatsch> Probalby written because they had an internal need for such a book. :P
<gchristensen> yes :) https://opensuse.github.io/daps/
<Profpatsch> gchristensen: Where’s the difference between single and double quotes in attributes?
<Profpatsch> xml:id='foo' vs xml:id="foo"
<gchristensen> I don't know, I always use double
<Profpatsch> Emacs highlights them differently
<gchristensen> seems they aren't different
<Profpatsch> TIL
<gchristensen> I think emacs maybe doesn't realize they're equivalent
<Profpatsch> But it’s probablay one of the longest-living emacs modes oO
<Profpatsch> nXML
<Profpatsch> Strange
<samueldr> single quotes allow double quotes in them without escaping, and vice versa
<Profpatsch> This is a really rare and interesting specimen of documentation for a CLI util written by somebody specializing in written documentation: https://opensuse.github.io/daps/doc/art.daps.quick.html
<gchristensen> oh don' bother trying to install daps on nixos
<gchristensen> sooo many hard coded paths and assumptions
<Profpatsch> Well, it’s the code of somebody specializing in written documentation after all. :P
<Profpatsch> Oh, huh, I wasn’t aware of just how many builtins nix has grown.
<Profpatsch> Frightening
<Profpatsch> Took me ten minutes just to add ids to all of them.
<LnL> a decent chunk of those are only builtins for performance reasons
<Profpatsch> I know I know, “nix is not a general purpose language”
<Profpatsch> gchristensen: Now, how do a run the manual verification for the nix manual?
<clever> Profpatsch: have you seen my sublist PR to nix?
<Profpatsch> clever: No, I don’t think so.
<{^_^}> nix#2459 (by cleverca22, 2 days ago, open): add a sublist primop
<clever> ah, its got 2 comments now
<Profpatsch> clever: And? I don’t see any documentation in that PR.
<Profpatsch> Plus, you don’t link the code it optimizes.
<clever> more about just wondering when it might get merged and such
<clever> let me link that
<Profpatsch> (I’m not involved in nix development)
<clever> its a fairly large expression
<gchristensen> Profpatsch: https://nixos.org/nix/manual/#chap-hacking then run `make doc/manual/manual.html`
<Profpatsch> I think the real question is: why do you have 100 million calls to elemAt in the first place.
<Profpatsch> gchristensen: Ah, thanks.
<clever> Profpatsch: lib.unique will recursively call lib.sublist
<Profpatsch> I always forget how to do that.
<clever> Profpatsch: and lib.sublist will use lib.drop to get the 2nd onwards in a list
<clever> Profpatsch: and lib.drop uses builtins.elemAt to fetch every element from the 2nd slot onwards, and re-assemble the list
<Profpatsch> clever: Yeah, lib.unique shouldn’t be used, should it?
<clever> thats uniqList, a second function with similar behaviour
<Profpatsch> If you need it I’d say something is wrong in the way you construct your lists.
<clever> this code is recursively searching a tree of haskel modules, and gathering dependencies and ghc flags
ben has joined #nixos-dev
<Profpatsch> If you have to search the output for information that you could have gathered from the input, you have lost control.
<Profpatsch> Generic programming wisdom I live by. :)
<clever> i didnt start this code, i'm just optimizing it enough to make a 38+ hour eval run in <20 seconds :P
<Profpatsch> In my books one of the main reasons for code complexity in today’s world.
<Profpatsch> clever: Hm, then why not fix the original code?
<clever> Profpatsch: i have heavily modified the code to improve its performance
<clever> but the unique vs sublist thing, it was simpler to fix in c++
<Profpatsch> And thus, we accumulate and accumulate.
<clever> and the entire implementation of sublist and drop just felt yuck :P
<Profpatsch> I count around 70 documented builtins.
<Profpatsch> Can’t speak for the undocumented one’s, but there’s a few.
<samueldr> Profpatsch: doesn't each doc folder have a README with a minimum working example of how to build it? (If it doesn't I'd consider it a bug)
<Profpatsch> samueldr: nope.
<Profpatsch> That’s why I stumble over it every time, the build instructions are in the manual, not in the readme.
<samueldr> oh right, I see only nixos/doc has it
<samueldr> (well, nixos/doc/manual/README)
<Profpatsch> > nix
<{^_^}> "<derivation /nix/store/w0ya8np5b6xj8n6176lbhcwl3iibhm55-nix-2.1.drv>"
<Profpatsch> heyheyhey {^_^}, > is reserved for greentext, damnit
<samueldr> :)
<Profpatsch> gchristensen: here you go https://github.com/NixOS/nix/pull/2464
<{^_^}> nix#2464 (by Profpatsch, 2 minutes ago, open): manual: add XML IDs to all builtin list entries
<Profpatsch> Somebody should read over all of them and see whether there’s a typo, those should be stable after all.
<Profpatsch> Another reason why they should be generated automaticall.
<Profpatsch> *y
<samueldr> any reasons for going with `builtin` instead of `builtins`?
<samueldr> and then, maybe there's a limitation with xml:id, but can't find any good source, are dots (.) invalid?
* samueldr should comment on the PR
<samueldr> where I'm going is that if builtins.foo's id is builtins.foo, it becomes a bit more trivial to cross-reference
<gchristensen> niksnut: can that PR be backported?
<samueldr> (ah, I see in the previous discussion that builtin-* was already in use)
<Profpatsch> samueldr: We can’t really change those anymore (anchors should be kept stable)
<Profpatsch> So better to stay regular.
<samueldr> yeah, as I realised
<zimbatm> ekleog: do you know if signed commits change the commit hash?
<yorick> sorry to annoy people on irc, but can anyone take a look at https://github.com/NixOS/nix/pull/2409 ?
<{^_^}> nix#2409 (by yegortimoshenko, 3 weeks ago, open): Make fetchGit do full checkout if ref = "*"
<yorick> telling our users to install a patched nix version is less than ideal :P
<gchristensen> I think it isn't a good idea, because even '*' isn't all the refs
<gchristensen> for example, github has lots of refs that wouldn't be fetched but are valid refs
<gchristensen> and those can change over time
<gchristensen> for that reason, I feel the best way to go is specifying the correct ref from the start
<yorick> gchristensen: the correct ref is not available to us, only the information that it is reachable from the things that are fetched by default
aanderse has joined #nixos-dev
<yorick> (usecase: stack.yaml parsing :P)
<yorick> I've been thinking of rewriting github urls into fetchTarball. but ew.
<yorick> also, can you give me an example of something that won't be fetched but is a valid ref?
<gchristensen> sure, refs/pull/*/* -- the remote can have any number of refs not directly available.
<niksnut> gchristensen: sure
<gchristensen> great!
Sigyn has quit [Quit: People always have such a hard time believing that robots could do bad things.]
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ has joined #nixos-dev
lassulus_ is now known as lassulus
Sigyn has joined #nixos-dev
lassulus_ has joined #nixos-dev
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ is now known as lassulus
<Profpatsch> Meeeeeeeeeeeeeeh
<Profpatsch> Why does tryEval not work with derivations?
<Profpatsch> I’m trying to instantiate all packages from ocamlPackages, and can’t work around sucky throws and asserts.
<Profpatsch> Not even a construction like this makes it work:
<Profpatsch> goodDerivation = v:
<Profpatsch> if (builtins.tryEval v).success && lib.isDerivation v && (
<Profpatsch> let a = (builtins.tryEval v.meta.available);
<Profpatsch> in a.success && a.value)
<Profpatsch> then v else hello;
<Profpatsch> Fails on some dependency.
<infinisil> Does it not work with --eval?
<Profpatsch> --eval is only WHNF
<Profpatsch> But I want to actually instantiate
<Profpatsch> And in the end, build.
<infinisil> Yeah, but do the try evals work with --eval (and --strict)?
<Profpatsch> Of course --strict doesn’t work with any derivation, nixpkgs is a minefield.
<infinisil> Oh right
<infinisil> I have some patches to improve that
<Profpatsch> And you know what happens if you step on every part of a minefield. :)
<infinisil> Boom!
<infinisil> So either it's a but that tryEval doesn't work with instantiation, or that it has some reason behind it
<infinisil> s/but/bug
<Profpatsch> nix-repl> builtins.tryEval (runCommand "hi" {} ''cp "foo${throw "nope"}" > $out'')
<Profpatsch> { success = true; value = «derivation «error: nope»; }
<Profpatsch> Oh, hm.
<Profpatsch> HM
<Profpatsch> what the actual heck
<infinisil> Yet another nix mystery to discover!
<Taneb> Profpatsch: looks like it's not forcing it far enough to trigger the error in the tryEval?
<Profpatsch> I guess the repl forces it for the derivation description.
<infinisil> --strict doesn't work without --eval, right? ( am on phone)
<Profpatsch> Why can’t I do this stuff inside nix.
<Profpatsch> I don’t want to write wrapper scripts.
lassulus_ has joined #nixos-dev
<Profpatsch> That’s silly.
lassulus has quit [Ping timeout: 252 seconds]
lassulus_ is now known as lassulus
FRidh has joined #nixos-dev
<Profpatsch> infinisil: It actually works, but I don’t think it does anything.
<Profpatsch> lol
<infinisil> Heh
<pie__> probably a repost: https://www.youtube.com/watch?v=BQVT6wiwCxM build systems a la carte icfp2018
goibhniu has quit [Ping timeout: 252 seconds]
Synthetica has joined #nixos-dev
<infinisil> pie__: Why repost?
<pie__> i mean i felt like smeone would have brought it up already
<infinisil> ah
orivej has joined #nixos-dev
orivej has quit [Ping timeout: 264 seconds]
<infinisil> pie__: Oh god, that mic
<infinisil> Oh that was a bit delayed, I already finished watching it
<infinisil> Very interesting talk!
<infinisil> (and paper too probably)
<pie__> seems like it was extremely summarized :p
<infinisil> Yeah, a bit too rushed, would've loved to hear more!
<pie__> going by the talk the paper is probably pretty readable
<infinisil> Yeah probably
pie__ has quit [Ping timeout: 252 seconds]
FRidh has quit [Quit: Konversation terminated!]
pie__ has joined #nixos-dev
orivej has joined #nixos-dev
ericnoan has joined #nixos-dev
<andi-> So, I want to prepare a PR for the staging-18.03 branch. Since that is a bit outdated I decided to run a `git merge --ff-only origin/release-18.03` on that branch. That should be the normal workflow?
<LnL> yeah, that should be fine
<Synthetica> Could someone take a look at my rfc? https://github.com/NixOS/rfcs/pull/35 (Looking for a co-author btw)
<{^_^}> rfcs#35 (by Synthetica9, 3 hours ago, open): Default `name` from `pname`
<andi-> Ok, then i'll push that to the staging branch first and then open / prepare the PR.
<LnL> andi-: if this is about rustc, making sure firefox works is probably the most important check
<andi-> LnL: I know. I won't push it without running a sufficient rebuild :-)
<andi-> (and going through a PR for the discussion/documentation purpose)
<LnL> ah, ok :)
<andi-> I am THAT horrified of breaking the UX that I always spent a day or more rebuilding such things and trying to verify things..
<andi-> also it seems that we have a rustc 1.26 on 18.03 but no users..
<LnL> hmm?
<andi-> LnL: 18.03 is on 1.24.0 which isn't affected by the thing I submittede against staging. Only >=1.26 is.
<LnL> ah, thought it where basically all older versions
lassulus has quit [Ping timeout: 252 seconds]
lassulus1 has joined #nixos-dev
lassulus1 is now known as lassulus
<andi-> yay, a lib documentation?!? Is that half-automated or all hand-crafted?
<andi-> gchristensen++
<{^_^}> gchristensen's karma got increased to 31
<gchristensen> hand crafted, but it isn't a big deal. w edon't add / change functions much
<LnL> only took a quick glance, but it looks great!
<gchristensen> macros andlots of copy-paste, and afew hours on the train without wifi :P
<LnL> we should really have some basic documentation for functions like this, even if it's not automated
<samueldr> gchristensen: is that #47688 ?
<{^_^}> https://github.com/NixOS/nixpkgs/pull/47688 (by grahamc, 26 minutes ago, open): nixpkgs docs: breakout functions
<gchristensen> no
<samueldr> you're showering us with doc updates :D
<andi-> I bounced it through a NIX beginner and it looks helpful. One thing that might be missin and/or confusing there is that most of those aren't accessed with the complete path (lib.attrsets.filterAttrs) but via lib.filterAttrs within nixpkgs.
<samueldr> > moar docs
<samueldr> Verified
<gchristensen> (my iternet is still bad, so it is still hard to edit typos on IRC, sorry)
<samueldr> uh, that Verified is github's DOM doing silly stuff
<gchristensen> haha, I thought you were approving my PR :)
<samueldr> nah, but still it works: "Verified, you added moar docs"
<samueldr> (wanted to check the docbook side of things to see if my observations were right)
<gchristensen> lib.attrsets.foldAttrs has my favorite type signature
<gchristensen> andi-: true, maybe could add a "also known as" thing
<samueldr> gchristensen: improvement idea, the examples and their return values should maybe be either separated in different elements, or at least identified using docbook wizardy so it'd be possible to (in another time and place) test their output
<gchristensen> agreed!
<andi-> The other thing that could probably be a bit confusin is that you talk about the arguments "name" before introducing the order of them or actually mentioning the "signature" with names of the fields. The current signatures are great for people familiar with functional programming. What I am missing would be something like: `foldAttrs op nul` (or similar)
<gchristensen> andi-: hmm I agree
<samueldr> (though, my main fear isn't valid, it looks like hljs doesn't go mad at seeing invalid stuff after the nix code)
<samueldr> and additionally, if the return value's representation is valid nix itself, hljs may have a better time trying to parse it than after a "=>"
<gchristensen> I'm not sre it is
<samueldr> maybe docbook has some wizardy that we can then use to make it more obvious those are parameters?
<samueldr> but I agree with andi-, those not used to FP have a hard time reading those FP "signatures"
<gchristensen> they are marked <function> and <varname> so maybe yes, but I'm leaving it out for now
<gchristensen> I'm going to push through and keep documenting and then we can go back and make it better
<samueldr> :)
<andi-> gchristensen: thanks for enduring that pain :-)
<gchristensen> :) we have _soooo_ many attrsetfunctions
<samueldr> though it may be we need to figure out an even better way to signify all that
<samueldr> aw, I forgot to preface all I said by "hello gift horse, what's in your mouth today?"
<gchristensen> LOL
<gchristensen> like 6 hours in and I've documented 45% of attrsets.nix.
<gchristensen> ok, to finish this of, we'll probably need to make a list and divvy up the work
pie__ has quit [Ping timeout: 246 seconds]