<{^_^}>
nix-pills#124 (by ThoenigAdrian, 1 hour ago, open): Nix Pill Nr. 10 builder.sh ./configure not found
orivej has quit [Ping timeout: 265 seconds]
<bennofs>
would it be ok for me to merge https://github.com/NixOS/nixpkgs/pull/44928? it seems the discussion about whether those functions are useful is unrelated to the PR
<{^_^}>
#44928 (by vcunat, 1 year ago, open): lib/strings: guard against an easy mistake
<bennofs>
change page to some random number to avoid going over things others already looked at
<mkaito>
can github do saved searches?
<mkaito>
maybe infinisil could add some of that to the bot command
<bennofs>
no I don't think so. It can't even search for PRs without conflicts or PRs without a "changes requested" review
<mkaito>
yay github
<bennofs>
(- infront of -review:changes-requested does not seem to do anything)
<Profpatsch>
mkaito: infinisil: Maybe we should make the ,random-pr thing a private query feature of the bot? It might be a tad spammy in the long run.
<Profpatsch>
infinisil: And then add ,contribute, which gives pointers on how to contribute (add it to the topic).
<Profpatsch>
If a person types ,contribute, we see it and can help if they have any questions.
<mkaito>
seems reasonable, if you feel it's spammy. but maybe it can also serve as a conversation trigger in some cases.
<Profpatsch>
mkaito: true
<mkaito>
whatever gets more code review happening, you know?
<mkaito>
I thought I was pretty decent at Bash, but damn, that stuff is *extra*
<arianvp>
Weird flex
<gchristensen>
saruspete is *wild*. check their pinned tweet
<Profpatsch>
haha, I need to use that bash optparsing library to replace my implementation.
<arianvp>
But extremely OK
<Profpatsch>
Generate a script optparser from nix expressions.
<gchristensen>
neat
<mkaito>
I vaguely remember some efforts to make Rust more usable for script-like tasks
<mkaito>
maybe some helpers to run commands and stuff
<mkaito>
do you happen to know anything?
<gchristensen>
I don't
<gchristensen>
last time I rewrote a bash script as a rust program it converted a 50 line program in to about 1,000 lines
<mkaito>
sounds about right
<gchristensen>
I happily made the trade because it wasn't a trivial script, but the script-like UX is not there :P
<mkaito>
big chunks of the scriptability of bash is a huge mug of "I don't give a hoot what happens here"
<mkaito>
which rust is explicitly designed to not let you get away with
<gchristensen>
I disagree actually
<mkaito>
how so
<gchristensen>
I think the thing which makes bash an easy fit is the primitives are designed for job control. exec, pipes, backgrounding, foregrounding, etc. being first-class language citizens which all require awkward dances with Rust
kenjis1 has joined #nixos-dev
misuzu has quit [Quit: leaving]
<mkaito>
I have like 10 hours total experience with Rust, but can't you solve much of that with macros?
<gchristensen>
but I think even with duct and other tools which make it nicer, it will never be as nice as just regular bash -- when the problem at hand is solved easily by bash
<tilpner>
It won't be as short without embedding a shell language in a macro, which would defeat the point, yes
<mkaito>
but it might take you most of the way there, just far enough to make you not hate your life
<gchristensen>
aye
<tilpner>
But the other parts of Rust might make up for it, the application logic you wouldn't want to write in bash
<tilpner>
Or not. I don't know your usecase
<mkaito>
convenient, safe, fast. pick two?
<qyliss>
What does that bash line do, gchristensen?
<gchristensen>
it runs fortune many times, pipnig the result to rev
<qyliss>
when does fortune fail?
<infinisil>
When you're out of luck!
<infinisil>
Hah
<gchristensen>
just trying to be thorough :)
<mkaito>
`set -e` usually takes care of that tbh
<gchristensen>
yes, but rust doesn't have a set -e, and I was trying to match and not be unfair :P
<mkaito>
that's because rust has proper error handling
<mkaito>
something something Option and Result in Bash :P
orivej has joined #nixos-dev
<Profpatsch>
you know what’s proper magic?
<Profpatsch>
pipefail
<mkaito>
`set -euo pipefail` is standard in everything I write
<mkaito>
and I'm always miffed this is not the default in pkgs.writeScript :P
<yorick>
flokli: updated the buildkite-agents thing
<thefloweringash>
`set -e` is kinda broken though. consider: bash -c 'set -e; foo() { false; echo "how am I here?"; }; foo || echo "foo failed"'
drakonis has joined #nixos-dev
<gchristensen>
yeah it is
rajivr___ has quit [Quit: Connection closed for inactivity]
<mkaito>
yeah I tried using `false` to abort a function with `set -e` and was surprised :P
<thefloweringash>
false may or may not abort foo depending on the context in which it's called, which horrifies me
emilazy has quit []
emilazy has joined #nixos-dev
justan0theruser has quit [Quit: WeeChat 2.6]
justanotheruser has joined #nixos-dev
<flokli>
yorick: looking
kenjis1 has quit [Ping timeout: 248 seconds]
<flokli>
yorick: updated
<yorick>
flokli: so the usecase of buildkite agent is to do more than just nix-build :D
mmlb has quit [Ping timeout: 272 seconds]
<yorick>
ours run nix-build -o ~/cd/$BUILDKITE_PIPELINE && sudo nixos-rebuild switch
<flokli>
wack
<yorick>
otherwise we could use hercules :D
<flokli>
you abuse buildkite as a deployment tool? ;-)
<gchristensen>
buildkite? sudo? please erase that from my brain
<yorick>
flokli: they advertise buildkite as a deployment tool
<yorick>
gchristensen: there's a sudoers rule that can only do nixos-rebuild switch
<flokli>
yorick: deploy to other machines, but probably not the same machine
<flokli>
how do you ensure you trigger that "deployment step" on every machine? ;-)
<gchristensen>
yorick: there is only such a rule until they nixos-rebuild switch to delete the rule
<yorick>
flokli: there's concurrency stuff, but we only need to deploy to a single machine for now
<yorick>
gchristensen: ~/cd only contains derivation inputs, no nix
<gchristensen>
I also use buildkite to deploy many things with nixops,, but I don't use buildkite to deploy to its own machine
<cransom>
if you really want to talk about abuse, i use hydra as a deployment tool...
<yorick>
flokli: are you really gonna make me implement sandboxing just because I need this PR merged :/
<gchristensen>
mkaito: heh, yeah, that has happened (please watch the profanities :))
<mkaito>
:P
<flokli>
yorick: I'm not gonna make you anything :-)
<flokli>
I'm just proposing to make use of dynamic users, if we can
<flokli>
if we create a bunch of users we don't really need outside that build
<flokli>
we should probably use dynamic users
<yorick>
sounds like it's out of the scope for this PR, though
<mkaito>
I'd be surprised if nothing else went wrong when switching to DynamicUsers
<yorick>
but yeah, I need those users
<yorick>
gotta do anything for that coveted 'approved' checkmark
<gchristensen>
I do agree that dynamic users would be nice, but perhaps a big change for buildkite -- since it wouldn't be uncommon for these users to have special authority / access granted by name
<flokli>
It can be a followup, but if we break API anyways, we might want to think about flipping defaults here
<flokli>
yorick: can you add/edit release notes to contain your changes?
<gchristensen>
true
<flokli>
I might propose a followup PR adding dynamic user support (and flipping the default)
Jackneill has quit [Remote host closed the connection]
<yorick>
flokli: okay
Synthetica has joined #nixos-dev
<yorick>
how do I build the nixos manual?
<jtojnar>
yorick `nix-build nixos/release.nix -A manual.x86_64-linux`
<yorick>
thanks!
<yorick>
flokli: updated the release notes
ris has joined #nixos-dev
drakonis has quit [Ping timeout: 260 seconds]
drakonis has joined #nixos-dev
<flokli>
thanks, will take a look
psyanticy has quit [Quit: Connection closed for inactivity]
<ma27[m]>
gchristensen: worldofpeace: in case you need another PR to look at for the office hours, how about https://github.com/NixOS/nixpkgs/pull/77985 ? (Won't be able to join though, sry)
<{^_^}>
#77985 (by Ma27, 6 days ago, open): gcc: remove versions 4.9 and 5
<gchristensen>
anyone know how long kernel 5.4 will be supported?
<samueldr>
gchristensen yes
<samueldr>
:3
<gchristensen>
wonderful! that is all I needed to know
<clever>
gchristensen: gist updated, both targets now have a dir and a test_script
<gchristensen>
nice! I'll give it a try
<clever>
gchristensen: i suspect the bulk of the cpu cost for direct_stage_2 is creating 1000's of files in a tmpfs on boot, and will heavily depend on the target cpu
<clever>
gchristensen: netboot only has a single 200mb file to unpack, and the the squashfs defers that cost until later, and spread over time
<clever>
gchristensen: oh, and direct_stage_2 does not yet update the db.sqlite, so nix will happily GC the entire store
<clever>
i'll get that soon-ish
<gchristensen>
all of this seems fine as long as generating the initrd is faster
justanotheruser has quit [Ping timeout: 272 seconds]
<clever>
1m43s for the netboot image on my laptop, both stages of compression
<gchristensen>
:o
<clever>
29 seconds for the direct_stage_2 image
<gchristensen>
how long did squash take for you before?
<gchristensen>
oh 1m43s?
<clever>
that 1m43s is squashfs + initrd
<gchristensen>
so much nicer
<clever>
the gist also includes changes to reduce the closure size, so it has less data to compress
<clever>
ah, profiles/minimal.nix was the only change for that
zarel has quit [Ping timeout: 252 seconds]
zarel has joined #nixos-dev
justanotheruser has joined #nixos-dev
<jtojnar>
do you hear a sound in the office hours recording?