2017-06-15

<clever> sphalerite: are you able to restart hydra jobs? http://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents
<clever> with the correct path
<clever> so the file is at the wrong storepath
<clever> "cat /nix/store/y83prin1dixpzp78mqg9lnzmf1jldxgw-Mathematica_11.0.1_LINUX.sh.drv" and the first path should be the path its expecting to find in /nix/store/
<clever> run cat on that .drv file, and youll see a second path near the top
<clever> yeah, thats the hash of the drv. not the output
<clever> i need to see those exact paths
<clever> the paths and hashes are important
<clever> MagneticDuck: can you gist the entire console output from the failing nix-build?
<clever> ah, that was in step 1, maybe something got messed up then
<clever> then copy it there, and do the registration thing again
<clever> MagneticDuck: you may want to check the .drv file thats failing, to see the right storepath
<clever> and if that path is wrong, nix wont find the file
<clever> MagneticDuck: the hash in this path has no visible connection to the --flat hash
<clever> /nix/store/kl2nmapmbrgj62nw4bpmw51x6sfck7f9-jdk-8u131-linux-x64.tar.gz
<clever> teodorlu: nix-env manages all of .nix-profile, which must never be modified
<clever> teodorlu: oh, it has to go in ~/.config/nixpkgs/config.nix
<clever> MagneticDuck: what name did you give it in the store?
<clever> MagneticDuck: it needs to know the hash of the file before it knows where to write it, and it doesnt want you being naughty and changing the file between the hash and copy
<clever> teodorlu: line 12- makes a new package called mystuff, which i can then nix-env -iA nixpkgs.mystuff
<clever> teodorlu: yeah
<clever> teodorlu: you can do that with a buildEnv in config.nix
<clever> MagneticDuck: aha, --flat is the key
<clever> 0dhj623ya01glcl3iir9ajifcrf6awhvpk936x9cxfj8zfyibck2
<clever> [clever@amd-nixos:~]$ nix-hash --base32 --type sha256 Downloads/jdk-8u131-linux-x64.tar.gz --flat
<clever> nope, that gives an entirely new hash
<clever> MagneticDuck: and this command is happy with it
<clever> [clever@amd-nixos:~]$ nix-build '<nixpkgs>' -A oraclejdk.src
<clever> MagneticDuck: if i download the file it names, and --add-fixed sha256 it, i get this storepath
<clever> /nix/store/kl2nmapmbrgj62nw4bpmw51x6sfck7f9-jdk-8u131-linux-x64.tar.gz
<clever> 0dhj623ya01glcl3iir9ajifcrf6awhvpk936x9cxfj8zfyibck2 i think
<clever> and its using sha256_x86_64 which is passed in from elsewhere
<clever> MagneticDuck: with this, i can find the source for the jdk expression
<clever> "/nix/store/x8h72iqmsyzd1yyjwrwl7jjf7jlsh9jz-nixos-17.09pre108200.13f2f8673b/nixos/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix:65"
<clever> nix-repl> oraclejdk.meta.position
<clever> let me check some figures on this end
<clever> ah
<clever> MagneticDuck: and also, if you just manualy copy something into the store, db.sqlite wont say its valid, and nix will just delete it
<clever> MagneticDuck: if you ran nix-store --dump on the path, then pipe that nar into nix-hash, i think
<clever> MagneticDuck: i believe its the hash of the NAR file
<clever> but it could do those things
<clever> sphalerite: i'm purely guessing on how i would have written it and could have messed up, havent checked the make source
<clever> it would often truncate the output, id have to /exec -o df -h ; sleep 2
<clever> irssi would stop at child exit, not at eof
<clever> so a command that does a ton of output and quits asap, like df -h, will get truncated
<clever> if the child exited, irssi stopped reading the stdout pipe
<clever> irssi had a similiar problem in /exec at one time
<clever> i'm guessing its a race condition in make, where the child finishes too quickly, before the sigchld handler is setup
<clever> but if i sigchld the make, the build resumes like everything is ok
<clever> so it hangs just like above, with no sigstop to blame
<clever> where make doesnt waitpid
<clever> ive also see a bug, only on arm i believe
<clever> yep, waiting for make to waitpid() them
<clever> once the gcc's under it finish, it will hang
<clever> yeah
<clever> and make sure it goes to every child of that as well
<clever> then the root nix-daemon can still do new builds
<clever> that sub nix-daemon is the one you want to sigstop
<clever> sphalerite: if you check "pstree", you should see a child with the pid of nix-build in its arguments
<clever> sphalerite: nix-daemon will fork out a child for each client, and i believe that child is responsible for the timers
<clever> no other builds can take place, oh right one other thing
<clever> sphalerite: maybe
<clever> sphalerite: yeah, that seems like a tricky thing
<clever> sphalerite: when using nix-daemon, you have to stop the child of the daemon, not the nix-build that is remotely triggering it
<clever> i always say to use -iA
<clever> its much faster
<clever> disasm: and i often see people new to nix trying to nix-env -i every library, then wonder why it doesnt work
<clever> cmake often uses pkgconfig to find things, and it needs pkgconfig in the buildInputs to do so
<clever> bennofs: its also usually better to just add pkgs.qt4, and then let the stdenv figure out which outputs to use
<clever> try doing that and see if anything changes
<clever> trikl: did you also add pkgconfig to buildInputs?
<clever> again??
<clever> [6]- Segmentation fault chromium
<clever> yep
<clever> noffle: that tells nix-env which channel to look in, you can see the available names in nix-channel --list
<clever> yep, it will tell you what to put into config.nix, and where config.nix should be
<clever> noffle: nix-env -iA nixpkgs.skype
<clever> or nixpkgs if your not on nixos
<clever> noffle: nix-env -iA nixos.skype
<clever> and you can just copy that, and use it to define any group
<clever> pop: just change the word docker, the line i linked is how docker creates its own group
<clever> pop: that creates a docker group, and configures docker to run on bootup
<clever> yeah, and link the gists with all of the logs
<clever> heh
<clever> Nobabs27: maybe you should open an issue on nixpkgs, and list all of the above gist's
<clever> i'm leaning towards it being a bug in switch_root, but that seems pretty unlikely
<clever> the switch_root is being called with the right arguments, so i would expect this to just work
<clever> all of that information says that it should have worked perfectly
<clever> i thought it was a bash-only thing
<clever> "set -x" is what made all of that output
<clever> i didnt even think ash had that option
<clever> nice
<clever> Nobabs27: use that, to add boot.trace to the kernel arguments, and then watch the serial output again
<clever> and f10 to run the modified version
<clever> just hit e on any menu entry
<clever> Nobabs27: oh, line 121, that should help, do you know how to edit the kernel params in grub directly?
<clever> Nobabs27: all of the files ive read so far say everything should be working normally, we can try getting a shell
<clever> we need to find out what arguments where given to switch_root
<clever> and at that point, switch_root was pid 1, so its exit killed the system
<clever> something went wrong when running switch_root, and it just spit out its help text
<clever> yeah
<clever> it should build a copy of stage1, and then give a storepath at the end
<clever> Nobabs27: inside the guest, can you run "nix-build '<nixpkgs/nixos>' -A config.system.build.bootStage1" and then gist the file that result is pointing to
<clever> can you read the file with "less"?
<clever> Nobabs27: and can you gist the /boot/grub/grub.cfg file?
<clever> Nobabs27: what does "sudo nix-channel --list" say?
<clever> switch is just test+boot
<clever> nixos-rebuild boot will make it the default in grub
<clever> nixos-rebuild test will activate the changes without making them the default
<clever> every time you do switch or boot, nixos updates the grub.cfg
<clever> rebuild switch will restart services and update config files, but the kernel change will wait until you reboot
<clever> probably isnt
<clever> the change requires a reboot to apply, so switch doesnt really help any
<clever> i would use "nixos-rebuild boot"
<clever> and the socat has to be running when you launch the guest
<clever> path/address has to be set to 127.0.0.1:4321
<clever> and if your lucky enough to have a hardware serial port, you can also use the above on real machines for debugging things remotely
<clever> so you should now get the entire error, and have the ability to copy/paste
<clever> that tells linux to output everything to the serial port, instead of the virtual gpu
<clever> Nobabs27: then add boot.kernelParams = [ "console=ttyS0,115200" ]; to the configuration.nix and rebuild
<clever> you can then configure virtualbox to connect to 127.0.0.1:4321
<clever> if you run this on arch, it will listen on port 4321
<clever> socat tcp-listen:4321,fork stdin
<clever> and then you gain the ability to scroll
<clever> Nobabs27: the guest can be configured to print more debug info to the serial ports
<clever> Nobabs27: in the virtualbox settings, you can configure COM1 to tcp mode, and set it up to connect to an existing socket, let me find some exact values
<clever> Nobabs27: everything looks fine, what OS is the host that virtualbox is running on?

2017-06-14

<clever> Nobabs27: gist --login
<clever> Nobabs27: ok, boot that up and then gist the configuration.nix file and the output of sudo nix-channel --list
<clever> Nobabs27: are you able to pick an older generation from grub?
<clever> Nobabs27: did you do anything odd with the activation scripts?, can i see more of the error?
<clever> mellowmaroon: either modify idea, or set that env variable correctly before launching idea
<clever> so you need to use LD_LIBRARY_PATH to add things
<clever> but java/python are an edge case, where you dont know what libraries it will be using later on
<clever> you normally have to patch the program to know where the library is
<clever> so installing a library wont fix the problem
<clever> programs compiled with nix will never look for libraries in a global directory
<clever> but java is an edge case, where you must add the library to LD_LIBRARY_PATH when lauching it
<clever> normally, you must add the library to the package that needs it
<clever> installing libraries will never fix library not found errors in a nix system
<clever> mellowmaroon: what is the error?
<clever> mellowmaroon: that puts the opengl libs into /run/opengl-driver
<clever> also, nix-env -iA uses less memory then just -i
<clever> yep
<clever> run swapon on a swap partition
<clever> then you dont have swap enabled
<clever> memory or swap?
<clever> lil_dummy: what does "free -m" say?
<clever> lil_dummy: thats a memory thing, not a disk thing, do you have swap enabled?
<clever> this one should fix it all, at the cost of a lot of IO
<clever> [root@router:/tmp]# nix-store --verify --check-contents --option binary-caches https://cache.nixos.org --repair
<clever> cant GC that
<clever> aaannnd its in the closure of the active nixos!
<clever> yep, non-1 timestamps!
<clever> -rw-r--r-- 1 root root 563 Aug 25 2016 __init__.cpython-34.pyc
<clever> ah
<clever> Mic92: but nixos also mounts /nix/store with a read-only bind mount to prevent such things
<clever> i vaguely remember helping somebody in here with the same issue a few weeks ago
<clever> something with root got ahold of them!
<clever> and nearly all of the .pyc files are different
<clever> yep, "--option binary-caches https://cache.nixos.org" fixed it
<clever> i'm trying to repair a corrupt path, from my own binary cache (aka, localhost)
<clever> oh wait nvm, i see the problem
<clever> hash mismatch in downloaded path ‘/nix/store/4fr5rgsizd5q72fr8lsixvb274awg6nk-python3-3.4.4’: expected ea884d66d0bb30285413f36359e4b98bac384160bc307102425c95f54d0802c0, got 9dbbe49f1d8a9f9b25b57b8ee218bca9039d9bb7298b6cd554aee45405f51ea7
<clever> pxc: but the nix ELF files have a non-standard rpath, and cant search /usr/lib
<clever> pxc: my first guess is that someting in /etc is telling libc to load ldap, so it can properly lookup users and such
<clever> gchristensen: i now have an entire window in chromium, with gistbox, and 20 to 40 gists open, of stuff that was important when i opened it
<clever> http://www.gistboxapp.com/ has helped to dig gists out, as long as i set the topic well or know the name of the files
<clever> eacameron: i gist so much crap that i often have trouble finding the stuff i saved, lol
<clever> eacameron: nice
<clever> Mic92: have there been any changes in the area of a musl stdenv?
<clever> so if you dont do that, you loose bits
<clever> Mic92: also, you must use that typedef if you want to copy an inode from a stat result to your own storage
<clever> Mic92: and if any program was relying on that typedef being 32bits for some internal on-disk data...
<clever> Mic92: but it also changes the bit size of a typedef in glibc
<clever> Mic92: you need to compile with a -D flag, to transparently swap it over
<clever> Mic92: and many programs in nixos (and a lot of other distros) are compiled to only use the 32bit one, and also treat EOVERFLOW as "the directory is empty"
<clever> Mic92: on 32bit kernels, there are seperate stat and readdir functions, for 32bit or 64bit ints
<clever> Mic92: turns out, the problem was inode numbers that dont fit inside 32bits
<clever> Mic92: my case was pretty fun as well, programs claiming files dont exist, when they clearly do
<clever> Mic92: oh god, lol :D
<clever> Mic92: ive run the entire nix-daemon and a whole build under strace before
<clever> eacameron: yeah, it would help if there was a program that would run X on every event, and not quit
<clever> the -ff makes it append the pid to the filename, so the logs dont get interleaved
<clever> pxc: i also like makign heavy use of "strace -ff -o logfiles"
<clever> eacameron: heh
<clever> yeah, it depends on how extreme you want to disable things
<clever> Mic92: this one turns other x stuff off, and removes x11 from dbus
<clever> cant find that different option now
<clever> Mic92: i had seen a different option somewhere that turns x off in many things
<clever> Mic92: oh, that headless profile sounds usefull in my kexec stuff
<clever> Mic92: yeah, but not everything obeys it
<clever> ben: override X to null
<clever> eacameron: maybe search for an inotify cli tool and that could be used
<clever> eacameron: only issue will be the latency
<clever> :O
<clever> sneakernet
<clever> :D
<clever> so the box can modify its own shipping label
<clever> also interestingly, the shipping label is just an e-ink display
<clever> eacameron: yeah, i believe it just becomes normal objects in S3 once you return the box
<clever> eacameron: ah, and AWS has 80tb and 50tb models of the snowball, but you can connect several boxes at once
<clever> eacameron: simplest thing i can think of is to make a nix expression for building, and then just "watch nix-build", nix will hash the sources, and only build if the hash changes
<clever> eacameron: ah, they have changed the process a bit, they will basicaly ship you a micro S3 server, and you do the upload over the LAN, and then return the server back to them
<clever> eacameron: AWS also has a special option, where you mail them a physical harddrive, and they will add it to S3
<clever> freusque: i saw somebody in here a few months ago that encrypted the nixops state file with gpg, and stored it in git
<clever> ah, thats currently being handled by a special isohybrid
<clever> so you can dd that iso to a usb stick, and it will be a valid disk
<clever> sphalerite: the isohybridMbrImage is also of importance, it makes an image that is both an mbr partitioned disk, and an iso9660 disk
<clever> sphalerite: the stuff to make the iso boot on cd/usb, with legacy/efi might be of use
<clever> sphalerite: yeah, i dont see any capability for it to make an ESP, you may need to modify it directly
<clever> plus that
<clever> sphalerite: https://gist.github.com/lheckemann/ce382bfbc71b1cc73a7f626b85d9e302 line 10-ish, boot.loader.grub = { efiInstallAsRemovable=true; efiSupport = true; };
<clever> sphalerite: second, because its just running switch-to-configuration boot, you just need to put the right statements into your config
<clever> sphalerite: it will always install one
<clever> sphalerite: first issue i notice, it ignores the value of installBootloader: https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/make-disk-image.nix
<clever> sphalerite: ah, let me double-check that code
<clever> sphalerite: how was the image built again?
<clever> davidak: what is build-cores set to in /etc/nix/nix.conf?
<clever> or make it an argument, and let the user .override it later
<clever> calvertvl: you would need to either make 2 versions and have the user pick the right one, or make a nixos module
<clever> calvertvl: packages with nixpkgs cant detect what nixos options you have enabled
<clever> when ran as root, it can also manage the channel nixos uses
<clever> it should be something like: nix-channel --add https://nixos.org/channels/nixos-unstable nixos ; nix-channel --update
<clever> read its man page
<clever> by running nix-channel --add
<clever> jtojnar: it just sets what the cronjob will update to later on
<clever> jtojnar: system.autoUpgrade.channel has no effect on what the current build will use

2017-06-13

<clever> and nixos-rebuild --rollback doesnt handle undoing channel changes
<clever> behind the scenes, --upgrade just calls "nix-channel --update"
<clever> symphorien: nix-channel --rollback
<clever> it will tell you exactly how to do that if you do nix-env -iA nixpkgs.google-chrome
<clever> catern: nix-env -iA nixos.chromium
<clever> ahh, yeah, that fetchgit may behave differently
<clever> if sandboxing is enabled
<clever> fixed-output has network, but it should still be inside a sandbox, so it has its own pid/mount namespace
<clever> depends on the sandbox setting
<clever> and if the hash of that snapshot doesnt have a cached build, it will build it
<clever> every time you call nix-build, it will import a snapshot of the source into /nix/store/
<clever> just src = /home/clever/foo/app-1.2.3;
<clever> simpson: but that doesnt exactly mean that you are using that exact version of bash
<clever> if it doesnt, it will move it to that path
<clever> if ~/.config/nixpkgs/ already exists, it will put the other nixpkgs inside of it
<clever> fresheyeball: what is the contents of ~/.config/nixpkgs/config.nix?
<clever> fresheyeball: and as root?
<clever> fresheyeball: what does nix-channel --list say?
<clever> qknight: nix-build '<nixpkgs/nixos>' -A system.build.toplevel -I nixos-config=./configuration.nix
<clever> disasm: last time i used cups, it was tied into pam, so the root name/pw may work
<clever> not sure then, i would just use a linux machine elsewhere, it can be a VM
<clever> nixy: is $NIX_REMOTE set?
<clever> goibhniu: stateVersion also handles that, so when you do switch channels, it will keep using postgress 8
<clever> samueldr: if your using bridging, then you would put eno1 into br0 on line 21, where its currently blank, and then you give the containers IP's that exist in your main LAN
<clever> is eno1 in the bridge?
<clever> ah, if your using a bridge, then nat isnt at play
<clever> and you dont have a hostAddress set
<clever> samueldr: the internalIPs is commented out in there
<clever> samueldr: can you gist your configuration?
<clever> if you run "nixos-container root-login <containername>", can you ping a domain?
<clever> samueldr: i have used that exact config before to run a minecraft server
<clever> samueldr: does the hostaddress and localaddress exist in the same subnet as the internalip's?
<clever> it almost is
<clever> the kernel will run a command when certain events happen
<clever> catern: line 445-447, the closures for any kernel->userland entrypoints
<clever> 414, every path in an env variable
<clever> 406, every file mmap'd
<clever> 388-394, every open file
<clever> line 386, the current working dir
<clever> catern: on line 385, it checks what the executable for the pid is
<clever> but nix-store --delete still says they are in-use
<clever> there is also a bug, nix-store --query --roots doesnt show those
<clever> yes
<clever> and /proc/*/environ are env variables
<clever> /proc/*/exe are symlinks to all running binaries
<clever> catern: the GC will scan /proc to find all in-use paths
<clever> yes
<clever> ah, then youll need the right type and flags
<clever> andrewrk: oh, what bootloader are you using?
<clever> andrewrk: oops, boot.loader.grub.device
<clever> and confirm that boot.loader.device is still right
<clever> yeah
<clever> andrewrk: try nixos-rebuild --install-bootloader boot
<clever> andrewrk: one sec
<clever> andrewrk: try unset, rather then setting it to nothing
<clever> yeah, try unsetting that
<clever> andrewrk: when you run "env | grep run", is that in any of the tempdir vars?

2017-06-12

<clever> catern: only with fixed-output derivations, will the hash actualy be of the content