<adelbertc> anyone know of a good way to get an existing Docker image into a Nix-friendly expression? there is `dockerTools.pullImage` but that requires `inLinuxVM` which is not Darwin friendly..
philr has quit [Ping timeout: 245 seconds]
disasm has quit [Quit: WeeChat 1.9.1]
disasm has joined #nix-darwin
<acowley> I think I found a primary culprit in my super-slow nix-shell: darwin frameworks
<acowley> This takes about 10s for me: time nix-shell -p darwin.apple_sdk.frameworks.Cocoa --run 'echo hey'
<acowley> hey
<acowley> ApplicationServices takes 6s
<acowley> So if I have a nix-shell where I want, say, imagemagick, I get ApplicationServices and pay the price.
<acowley> Well, just knowing that let me set things up differently so some commands now take 20s less just to start up
<acowley> So that's a win
jtojnar_ has joined #nix-darwin
jtojnar has quit [Ping timeout: 252 seconds]
jtojnar_ is now known as jtojnar
jtojnar has quit [Ping timeout: 268 seconds]
elvishjerricco has quit [Quit: Updating details, brb]
elvishjerricco has joined #nix-darwin
<johnw> acowley: interesting
johnw_ has joined #nix-darwin
johnw has quit [Ping timeout: 255 seconds]
zzamboni has joined #nix-darwin
zzamboni has quit [Quit: Leaving.]
zzamboni has joined #nix-darwin
philr has joined #nix-darwin
benley has quit [Ping timeout: 256 seconds]
benley has joined #nix-darwin
zzamboni has quit [Read error: Connection reset by peer]
zzamboni has joined #nix-darwin
philr has quit [Ping timeout: 256 seconds]
zzamboni has quit [Quit: Leaving.]
zzamboni has joined #nix-darwin
zzamboni has quit [Client Quit]
zzamboni has joined #nix-darwin
zzamboni has quit [Ping timeout: 256 seconds]
zzamboni has joined #nix-darwin
zzamboni has quit [Ping timeout: 256 seconds]
zzamboni has joined #nix-darwin
zzamboni has quit [Ping timeout: 268 seconds]
zzamboni has joined #nix-darwin
philr has joined #nix-darwin
zzamboni has quit [Quit: Leaving.]
zzamboni has joined #nix-darwin
<LnL> weird! wonder what's causing that, the frameworks have a setup hook but nothing that would be expensive
zzamboni has quit [Quit: Leaving.]
zzamboni has joined #nix-darwin
niksnut_ is now known as niksnut
peacememories has joined #nix-darwin
<acowley> LnL: Do you have suggestions on how to profile that slowness?
<LnL> not particularly, comparing a -vvvvv and/or dtruss log for -p stdenv and -p darwin.apple_sdk.frameworks.Cocoa
<LnL> that might be a good start
<LnL> also is it just Cocoa or one of the frameworks that it depends on
<LnL> or the fact that Cocoa depends on most of the frameworks
<acowley> Right, I think it's a less dramatic but non-negligible overhead for each framework
<acowley> The other observation I can offer is that Activity Monitor shows bash as using noticeable CPU during such a nix-shell, and Terminal.app's title bar shows bash doing something with rc files. Those are pretty weak signals, but perhaps offer a clue.
zzamboni has quit [Read error: Connection reset by peer]
<LnL> if it’s bash then it’s something in the stdenv or a setup-hook
peacememories has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<acowley> I don't think I really understand framework-setup-hook.sh stuff
<acowley> I'm not sure what $prefix is set to when it's called. Is fixupOutputHooks getting called for every package being brought into scope?
<acowley> But I'm having trouble finding documentation about fixupOutputHooks
<acowley> I found an IRC log that I guess qualifies as official documentation
<LnL> lol
<LnL> so setup-hooks get called before genericBuild and usually add some extra steps to certain hooks/phases
<LnL> the functions get defined when including a framework, but shouldn't get called until the fixupPhase
<acowley> What's not clear to me is if they would be called when a derivation is pulled in to a nix-shell
<acowley> It doesn't seem likely, as then $prefix would have to be set to each derivation in scope?
<acowley> That all seems wrong, but it's the slowest-looking thing attached to frameworks and related to bash.
philr has quit [Ping timeout: 240 seconds]
zzamboni has joined #nix-darwin
zzamboni has quit [Client Quit]
zzamboni has joined #nix-darwin
<LnL> well it's not necceceraly the setup-hook part of the stdenv
<acowley> Interestingly (eh), basically all the output of dtruss and opensnoop finish before a bulk of the nix-shell setup time
<acowley> All those duplicate setup-hooks.sh files are loaded, for each framework, and then there's a bunch of activity without any more file system hits (I think) or even sys calls.
<acowley> Which is consistent with bash computing things
<acowley> Sorry, that's not quite right
<acowley> The perl process is done
<LnL> perl!?
<acowley> but bash processes are spun up
<acowley> Yes, nix-shell is a perl program iinm
<acowley> So dtruss shows a lot of fork, sigaction, close sequences
<acowley> While the busy-work is happening
<LnL> nix-shell: Mach-O 64-bit executable x86_64
<LnL> 2.0 was released! :p
<LnL> anyway
<acowley> I think I tried with nixUnstable a while back to see if it made a difference, but I could try again
<LnL> the only other thing that's specific to frameworks is the CoreFounation hook
<acowley> 2.0 still isn't in the unstable channel
<LnL> but adding one more item to the array is probably not what causes a massive slowdown
<acowley> No, I wonder if it's process forks
<LnL> ah that could be, but I was able to reproduce it with 2.0
<acowley> Since that's all that dtruss is showing
<LnL> what forks?
<acowley> Well, I don't know really. It's just that's a repeated syscall while the nix-shell is spinning up
<LnL> from nix or the builder.sh
<acowley> I don't know where it's from. I hook dtruss up to watch any process named perl, and have it follow all child processes.
zzamboni has quit [Quit: Leaving.]
johnw_ has quit [Changing host]
johnw_ has joined #nix-darwin
johnw_ is now known as johnw
peacememories has joined #nix-darwin
peacememories has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
peacememories has joined #nix-darwin
peacememories has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
philr has joined #nix-darwin