supersandro2000 has quit [Disconnected by services]
supersandro2000 has joined #nix-darwin
andremed- has joined #nix-darwin
Gaelan_ has joined #nix-darwin
squidgy_ has joined #nix-darwin
squidgy has quit [*.net *.split]
andremedeiros has quit [*.net *.split]
cransom has quit [*.net *.split]
Gaelan has quit [*.net *.split]
andremed- is now known as andremedeiros
cransom has joined #nix-darwin
hke has quit [Read error: Connection reset by peer]
hke has joined #nix-darwin
Chiliparrot has joined #nix-darwin
squidgy_ has quit [Quit: ZZZzzz…]
Chiliparrot has quit [Ping timeout: 260 seconds]
Chiliparrot has joined #nix-darwin
__monty__ has joined #nix-darwin
philr_ has quit [Ping timeout: 245 seconds]
philr_ has joined #nix-darwin
claudiii has quit [Quit: Connection closed for inactivity]
Chiliparrot has quit [Ping timeout: 272 seconds]
Chiliparrot has joined #nix-darwin
eraserhd has joined #nix-darwin
eraserhd has quit [Client Quit]
eraserhd has joined #nix-darwin
squidgy has joined #nix-darwin
hke has quit [Read error: Connection reset by peer]
hke has joined #nix-darwin
Chiliparrot has quit [Ping timeout: 272 seconds]
Chiliparrot has joined #nix-darwin
Chiliparrot has quit [Ping timeout: 260 seconds]
Chiliparrot has joined #nix-darwin
philr_ has quit [Ping timeout: 245 seconds]
Chiliparrot has quit [Ping timeout: 258 seconds]
Chiliparrot has joined #nix-darwin
squidgy has quit [Quit: ZZZzzz…]
Chiliparrot has quit [Ping timeout: 260 seconds]
Chiliparrot has joined #nix-darwin
Chiliparrot has quit [Ping timeout: 264 seconds]
Chiliparrot has joined #nix-darwin
Chiliparrot has quit [Quit: Textual IRC Client: www.textualapp.com]
oliver85 has joined #nix-darwin
<oliver85> hello
<abathur> hey
<abathur> sorry, helping someone out in #nixos; divided attention :)
<oliver85> all good
<abathur> I'm aware buildkite exists but not otherwise familiar with it, not sure if that'll end up being relevant
<oliver85> Its getting more popular these past couple years. Its basically a build orchestrator and you bring your own agents. In our case our agents are AWS ec2 mac1.metal instances
<abathur> did you also add the SecureToken to the buildkite user, I guess?
<abathur> (for posterity/anyone else reading, we're discussing nix#4640)
<{^_^}> https://github.com/NixOS/nix/issues/4640 (by OliverKoo, 1 day ago, open): MacOS /nix unmount when reboot. /nix ownership change to root
<oliver85> not on the AMi but yes after I booted up I ssh in and added SecureToken manually
<abathur> iirc others reported being able to skirt this issue by using a GUI session to add a security exemption (FDE, I think) for /bin/sh, in case you're under pressure to have something working yesterday here
<abathur> some of the links I listed in the previous post have a little contextual information; I haven't directly done this
<abathur> I'm not sure if that's the only path or not
<abathur> before I was thinking that this was about running ~headless systems, because all of the reports involved people trying to set up over ssh, failing, and then describing going in through the GUI
<abathur> but I'm not quite clear on how you're connected when you describe the commands at the end of your last comment in the issue
<abathur> i.e. "if I launch the daemon sudo launchctl load -w /Library/LaunchDaemons/com.buildkite.buildkite-agent.plist then I see the dyld: Library not loaded post above when build" and "but I can successfully build with nix if I invoke the agent directly after ssh into the machine
<abathur> sudo su - buildkite-agent then /usr/local/bin/buildkite-agent start"
<abathur> so if the first part of that IS with a GUI that might help rule out at least one possibility
<oliver85> ah let me clarify my last comment on the issue and give a bit more context.
<oliver85> buildkite-agent can be start (https://buildkite.com/docs/agent/v3/cli-start) by directly invoking the binary at /usr/locl/bin/buildkite-agent. Now an agent is running on my machine. from buildkite.com I can then schedule job that will be pick up by the agent. Jobs like "nix --verison"
<oliver85> If I start the buildkite agent by manuall ssh into my ec2 instance.  run (. /Users/buildkite-agent/.nix-profile/etc/profile.d/nix.sh) then kick off the agent "/usr/local/bin/buildkite-agent start" as buildkite-agent user. Then the job pick up by this agent seems to run nix command just fine.
<oliver85> But if I have launchctl kick off the agent (agent is set to start on boot), then jobs picked up by this agent shows the dyld error
<oliver85> I am not sure what you meant by "GUI session to add a security exemption"
<abathur> well, it's a good sign that it will run over ssh if set up correctly
<abathur> I guess it might be failing for some reason related to the system not having a logged-in user, or something about the launchd context compared to how you're invoking it
<abathur> re: GUI; sorry, I said FDE instead of FDA earlier :) if I understood correctly they did something like literally VNC in to the desktop, open the system preferences > security & privacy > privacy > Full Disk Acces, unlock, and then add /bin/sh
<oliver85> ah gotcha, Yah VNC into desktop will be hard to incorporate with the AMI creation process. (i.e pause the process, VNC in, then continue)
<oliver85> when you say `iirc others reported being able to skirt this issue` which issue you referring to? dyld?
<abathur> and a few of the other links in my earlier comment on the issue
<abathur> I have at least two ideas I guess
<abathur> sandro's comments about it working if he didn't use /bin/sh makes me wonder if buildkite-agent is a /bin/sh shell script
<abathur> and nix-daemon's launchd does use /bin/sh, I think maybe to get around argument weirdness in plist
<abathur> though looking at the buildkite/agent repo makes me think it's a go binary
<abathur> it does look like it uses /bin/sh internally though https://github.com/buildkite/agent/pull/448/files
<oliver85> wait a second, when I created buildkite-user on my machine I had bin/bash as my default shell `sudo sysadminctl -addUser buildkite-agent -shell /bin/bash`
<oliver85> if I have the buildkite daemon run job `echo $SHELL` I get bin/bash  as well.
<oliver85> I should switch to bin/sh?
<oliver85> so they are compatable and bin/sh have access to the entire disk (somehow?)
<abathur> worth a try
<abathur> it does seem like the difference between works/doesn't is just some permission grant that happens in a normal gui login session, and apparently happens in a ssh session
<abathur> but which isn't happening for these launchd jobs
<abathur> oh huh, that reminds me...
<abathur> ah; nm; was thinking of a launchd setting, but it looks like it should be enabled by default in this case
<oliver85> cool cool.
<oliver85> changed default shell to `chsh -s /bin/sh`
<oliver85> if I run `echo $SHELL` I see /bin/sh
<oliver85> but if I run nix --version......I see its using /bin/bash trapping?! (huh) I am digging to see where this trap comming from
<oliver85> ```
<oliver85> $ trap 'kill -- $$' INT TERM QUIT; nix --version
<oliver85> dyld: Library not loaded: /nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib
<oliver85>   Referenced from: /Users/buildkite-agent/.nix-profile/bin/nix
<oliver85>   Reason: no suitable image found. Did find:
<oliver85>  file system sandbox blocked open() of '/nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib'
<oliver85>  /nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib: stat() failed with errno=1
<oliver85>  file system sandbox blocked open() of '/nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib'
<oliver85> ```
<abathur> not sure I follow, but chsh alone won't change the shell for your current session; you might need to run /bin/sh or start a new one
<oliver85> yeah I started a new one.
<oliver85> sorry the above log wasn't complete
<oliver85> if the buildkite-agent daemon echo SHELL we get bin/sh but if the daemon runs `nix --version` I seee it erorr out with indication using bin/bash. strange..
<oliver85>  file system sandbox blocked open() of '/nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib'
<oliver85> 🚨 Error: The command exited with status 134
<oliver85> in/bash: line 1: 1426 Abort trap: 6 nix --version
<oliver85> uh ignore the above, not sure why my copy pasting is been weird
<abathur> I wonder if that's buildkite
<oliver85> see below =============
<oliver85> $ trap 'kill -- $$' INT TERM QUIT; nix --version
<oliver85> dyld: Library not loaded: /nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib
<oliver85>   Referenced from: /Users/buildkite-agent/.nix-profile/bin/nix
<oliver85>   Reason: no suitable image found. Did find:
<oliver85>  file system sandbox blocked open() of '/nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib'
<oliver85>  /nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib: stat() failed with errno=1
<oliver85>  file system sandbox blocked open() of '/nix/store/i1cg0wfns9j4lmfzvx5dz6rc436vs6ms-libsodium-1.0.18/lib/libsodium.23.dylib'
<oliver85> 🚨 Error: The command exited with status 134
<oliver85> the paste keeps ignoring this line `/bin/bash: line 1: 1426 Abort trap: 6 nix --version` <---- that should appear above the line of red siren
<abathur> so I think that's probably a red herring here
<abathur> but still probably worth making it use /bin/sh at least once, just in case
<oliver85> hmm not sure whats the best way of forcing it to. probably should change the plist?
<oliver85> to something like
<oliver85>     <key>ProgramArguments</key>
<oliver85>     <array>
<oliver85>       <string>/bin/sh</string>
<oliver85>       <string>-c</string>
<oliver85>       <string>/usr/local/bin/buildkite-agent</string>
<oliver85>       <string>start</string>
<oliver85>     </array>
<abathur> I think it's set at some other level
<abathur> it seems from the code like the variable it is using suggests it has a concept of a "bootstrap shell"
<oliver85> ah
<abathur> but it's not immediately obvious if there
<oliver85>  --shell value The shell command used to interpret build commands, e.g /bin/bash -e -c (default: "/bin/bash -e -c") [$BUILDKITE_SHELL]
<abathur> sis config for that
<abathur> aha
<oliver85> let me set that
<abathur> yeah, that looks right :)
<oliver85> ayyy the error went away so progress kind of?
<oliver85> no more dylib
<oliver85> but now seeing this
<oliver85> ```
<oliver85>  trap 'kill -- $$' INT TERM QUIT; nix --version
<oliver85> ```
<oliver85> ugh let me paste please
<abathur> heh, can use a gist or paste site, or the issue
<oliver85> let me paste to the issue
<abathur> sure; I'm afk a few but I'll go ahead and get it open
squidgy has joined #nix-darwin
<abathur> ah, I guess that's probably a PATH error
<abathur> is it doing the `. /Users/buildkite-agent/.nix-profile/etc/profile.d/nix.sh` thing?
<abathur> oh right, you said you set that in the plist
<oliver85> right....and it was showing up before
<oliver85> then now is gone
<oliver85> $ trap 'kill -- $$' INT TERM QUIT; echo $NIX_PATH
<oliver85> 🚨 Error: The command exited with status 127
<oliver85> let me post to issue
<oliver85> one moment
<oliver85> something going on with the shell, even running something simple like 'whoami' errors out with whoami: No such file or directory
<oliver85> also $PATH is not set as well
<oliver85> I need to step away to get some air, be back later. Thanks for the help so far!
philr_ has joined #nix-darwin
<abathur> oliver85: ok--I need to head out for dinner anyways; I'll check back after
hke_ has joined #nix-darwin
squidgy_ has joined #nix-darwin
squidgy has quit [*.net *.split]
hke has quit [*.net *.split]
__monty__ has quit [Quit: leaving]