jiebi/CodeConvo huggingface dataset:
Code change:
A Go program compiled using nix-shell returns an error when running on a separate server and trying to load a timezone file. file with: $nix-shell $<inside shellgo build $exit $ ./app # name of the app you just created 2019/01/25 20:04:58 All went well: America/NewYork Now copy this file to another computer #./app 2019/01/26 01:01:34 could not load new york locationopen /nix/store/0596k27r6pacyx4jp1bcn8zqyjhji52l-go- no such file or directory The error includes the zip name due to internal reasons the Go team has, but the real problem is that nix replaced with I would be more than happy to send a Pull Request if you agree with the proposed solution of prepending instead of replacing. $ nix-shell -p nix-info --run "nix-info -m" these paths will be fetched (0.00 MiB download, 0.00 MiB unpacked): /nix/store/dzvh4f6ihkwg44mmf2awxg564k1s8khg-nix-info copying path '/nix/store/dzvh4f6ihkwg44mmf2awxg564k1s8khg-nix-info' from ''... system: host os: multi-user?: sandbox: version: channels(diego): nixpkgs: version is nixos-unstable-2019-01-22 The file replaces the path that the go runtime looks for the timezone information. Original Go code is: But nix changes the first entry, for This works fine if you end up running your go application in the same nix env you compiled it, but when you deploy your go program to a separate server, the path, that can look like isn't present on the separate server and then the lookup fails. is a very common path in Linux distributions. A better way to solve this would be to prepend the nix only path, as the first entry, and then keep and the other entries as they are in the original go source code. The benefits are that those who compile and run in the same nix environment will use the nix path, but those who deploy somewhere else won't have to do any extra work.
I doubt anyone ever considered support for non-Nix and therefore I will mark it also as . I'll leave it open for now as maybe it can be supported (I doubt it).
would you accept a PR with my proposed solution? It won't hurt nix deployments but will help a use case of building a go program in nix but deploying outside of nix.
cross referencing a thread on the mailing list about this ticket/issue so both conversations are linked.
Your explanation and proposed solution seem to be very reasonable to me. I suggest that you submit a PR.

Related discussion:
text: --replace '#!/usr/bin/env bash' '#!${runtimeShell}' # Patch the mimetype database location which is missing on NixOS. <del> substituteInPlace src/mime/type_unix.go  --replace '/etc/mime.types' '${mailcap}/etc/mime.types' </del> <ins> # but also allow static binaries built with NixOS to run outside nix sed -i 's,"/etc/mime.types,"${mailcap}/etc/mime.types",nt&,' src/mime/type_unix.go </ins> # Disabling the 'os/http/net' tests (they want files not available in # chroot builds)
Code change:
A Go program compiled using nix-shell returns an error when running on a separate server and trying to load a timezone file. file with: $nix-shell $<inside shellgo build $exit $ ./app # name of the app you just created 2019/01/25 20:04:58 All went well: America/NewYork Now copy this file to another computer #./app 2019/01/26 01:01:34 could not load new york locationopen /nix/store/0596k27r6pacyx4jp1bcn8zqyjhji52l-go- no such file or directory The error includes the zip name due to internal reasons the Go team has, but the real problem is that nix replaced with I would be more than happy to send a Pull Request if you agree with the proposed solution of prepending instead of replacing. $ nix-shell -p nix-info --run "nix-info -m" these paths will be fetched (0.00 MiB download, 0.00 MiB unpacked): /nix/store/dzvh4f6ihkwg44mmf2awxg564k1s8khg-nix-info copying path '/nix/store/dzvh4f6ihkwg44mmf2awxg564k1s8khg-nix-info' from ''... system: host os: multi-user?: sandbox: version: channels(diego): nixpkgs: version is nixos-unstable-2019-01-22 The file replaces the path that the go runtime looks for the timezone information. Original Go code is: But nix changes the first entry, for This works fine if you end up running your go application in the same nix env you compiled it, but when you deploy your go program to a separate server, the path, that can look like isn't present on the separate server and then the lookup fails. is a very common path in Linux distributions. A better way to solve this would be to prepend the nix only path, as the first entry, and then keep and the other entries as they are in the original go source code. The benefits are that those who compile and run in the same nix environment will use the nix path, but those who deploy somewhere else won't have to do any extra work.
I doubt anyone ever considered support for non-Nix and therefore I will mark it also as . I'll leave it open for now as maybe it can be supported (I doubt it).
would you accept a PR with my proposed solution? It won't hurt nix deployments but will help a use case of building a go program in nix but deploying outside of nix.
cross referencing a thread on the mailing list about this ticket/issue so both conversations are linked.
Your explanation and proposed solution seem to be very reasonable to me. I suggest that you submit a PR.

Related discussion:
text: rm src/net/cgo_unix_test.go '' + optionalString stdenv.isLinux '' <del> sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go </del> <ins> # prepend the nix path to the zoneinfo files but also leave the original value for static binaries # that run outside a nix server sed -i 's,"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/",nt&,' src/time/zoneinfo_unix.go </ins> '' + optionalString stdenv.isAarch32 '' echo '#!${runtimeShell}' > misc/cgo/testplugin/test.bash '' + optionalString stdenv.isDarwin ''
Code change:
A Go program compiled using nix-shell returns an error when running on a separate server and trying to load a timezone file. file with: $nix-shell $<inside shellgo build $exit $ ./app # name of the app you just created 2019/01/25 20:04:58 All went well: America/NewYork Now copy this file to another computer #./app 2019/01/26 01:01:34 could not load new york locationopen /nix/store/0596k27r6pacyx4jp1bcn8zqyjhji52l-go- no such file or directory The error includes the zip name due to internal reasons the Go team has, but the real problem is that nix replaced with I would be more than happy to send a Pull Request if you agree with the proposed solution of prepending instead of replacing. $ nix-shell -p nix-info --run "nix-info -m" these paths will be fetched (0.00 MiB download, 0.00 MiB unpacked): /nix/store/dzvh4f6ihkwg44mmf2awxg564k1s8khg-nix-info copying path '/nix/store/dzvh4f6ihkwg44mmf2awxg564k1s8khg-nix-info' from ''... system: host os: multi-user?: sandbox: version: channels(diego): nixpkgs: version is nixos-unstable-2019-01-22 The file replaces the path that the go runtime looks for the timezone information. Original Go code is: But nix changes the first entry, for This works fine if you end up running your go application in the same nix env you compiled it, but when you deploy your go program to a separate server, the path, that can look like isn't present on the separate server and then the lookup fails. is a very common path in Linux distributions. A better way to solve this would be to prepend the nix only path, as the first entry, and then keep and the other entries as they are in the original go source code. The benefits are that those who compile and run in the same nix environment will use the nix path, but those who deploy somewhere else won't have to do any extra work.
I doubt anyone ever considered support for non-Nix and therefore I will mark it also as . I'll leave it open for now as maybe it can be supported (I doubt it).
would you accept a PR with my proposed solution? It won't hurt nix deployments but will help a use case of building a go program in nix but deploying outside of nix.
cross referencing a thread on the mailing list about this ticket/issue so both conversations are linked.
Your explanation and proposed solution seem to be very reasonable to me. I suggest that you submit a PR.

Related discussion:
text: sed -i 's,/etc/protocols,${iana-etc}/etc/protocols,' src/net/lookup_unix.go '' + lib.optionalString stdenv.isLinux '' <del> sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go </del> <ins> # prepend the nix path to the zoneinfo files but also leave the original value for static binaries # that run outside a nix server sed -i 's,"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/",nt&,' src/time/zoneinfo_unix.go </ins> # Find the loader dynamically LOADER="$(find ${lib.getLib libc}/lib -name ld-linux* | head -n 1)"
Code change:
When I run `sudo crontab -e", I get no crontab for root - using an empty one /bin/sh: /usr/bin/vi: No such file or directory crontab: "/usr/bin/vi" exited with status 127 Now I agree that I probably shouldn't do that (I should keep my crontab in ), but a better error message would probably be better. Please run and paste the results. system: host os: multi-user?: sandbox: version: channels(root): nixpkgs:
I also have this issue. Current work around is but this needs to be fixed. See
Please feel free to close as this issue has been fixed.

Related discussion:
text: <del> {stdenv, fetchurl, sendmailPath ? "/usr/sbin/sendmail"}: </del> <ins> {stdenv, fetchurl, vim, sendmailPath ? "/usr/sbin/sendmail"}: </ins> stdenv.mkDerivation { name = "cron-4.1";
Code change:
When I run `sudo crontab -e", I get no crontab for root - using an empty one /bin/sh: /usr/bin/vi: No such file or directory crontab: "/usr/bin/vi" exited with status 127 Now I agree that I probably shouldn't do that (I should keep my crontab in ), but a better error message would probably be better. Please run and paste the results. system: host os: multi-user?: sandbox: version: channels(root): nixpkgs:
I also have this issue. Current work around is but this needs to be fixed. See
Please feel free to close as this issue has been fixed.

Related discussion:
text: #undef _PATH_SENDMAIL #define _PATH_SENDMAIL "${sendmailPath}" <ins> #undef _PATH_VI #define _PATH_VI "${vim}/bin/vim" </ins> #undef _PATH_DEFPATH #define _PATH_DEFPATH "/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin" __EOT__
Code change:
When used with latest Nix the "new" hash is extracted incorrectly, or thereabouts. This seems to be due to Nix changing the message used to be more friendly to humans: Use an update script invoking common-updater-scripts. Sorry, LMK if repro is needed. Please run and paste the results. I don't expect this to be helpful but happy to provide anyway! system: host os: multi-user?: sandbox: version: channels(will): channels(root): nixpkgs:
It is increasingly messy, perhaps we can drop the old regexes, most people probably set instead of changing nix in overlays so this would not be affected.
What about adding a flag to nix, which turns on machine readable error messages with a guaranty that those messages will not change in a backward incompatible way? Would need someone to add that. But wouldn't that be better to parse error messages intended for human readers with shell tools?
Alternatively, if the build fails, I think we could do something like:
I'm not sure I follow, but FWIW I ran into this and I set and don't set it via overlay. Looks like the new behavior is in 2.2, the current default for : (err formatting might not work for email responses, maybe? sorry :)) I think it's reasonable to drop support for nix older than what's in the tree-- especially since you'd have to overlay to replace it and as you say would likely do via anyway. Oh... that's probably what you meant! :D
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly: for maintainers and people that previously touched the related code and @ mention them in a comment. on the . on the on .
Any updates on this?
I marked this as stale due to inactivity. &rarr;
Should have been fixed by
Thanks!

Related discussion:
text: if [ -z "$newHash" ]; then nix-build --no-out-link -A "$attr.src" 2>"$attr.fetchlog" >/dev/null || true # FIXME: use nix-build --hash here once https://github.com/NixOS/nix/issues/1172 is fixed <del> newHash=$(egrep -v "killing process|dependencies couldn't be built" "$attr.fetchlog" | tail -n2 | sed "s~output path .* has .* hash ‘(.*)’ when .* was expected|fixed-output derivation produced path '.*' with .* hash '(.*)' instead of the expected hash '.*'~12~" | head -n1) </del> <ins> newHash=$(egrep -v "killing process|dependencies couldn't be built|wanted: " "$attr.fetchlog" | tail -n2 | sed "s~output path .* has .* hash ‘(.*)’ when .* was expected|fixed-output derivation produced path '.*' with .* hash '(.*)' instead of the expected hash '.*'|  got:    .*:(.*)~123~" | head -n1) </ins> fi if [ -z "$newHash" ]; then
Code change:
I've just set on my laptop while on holiday. The timezone never updates (tried restarting, waiting a while). Running I see: I see in that the service is run as the user. If I run: I also see the message . Whereas if I run there is no output and the timezone immediately updates (as shown by an immediate change in the time in my status bar, and confirmed by running ). It seems that the user just doesn't have permission to set the timezone. in (and unset ) to see if timezone changes , look for messages with "Failed to set timezone" (will only appear if the timezone it would need to set is different than the current timezone) system: host os: multi-user?: sandbox: version: channels(root): nixpkgs:
It worked for me after a reboot. Maybe the polkit rules are not getting appliead during a ?

Related discussion:
text: config = mkIf cfg.enable { services.geoclue2.enable = true; <del> # so polkit will pick up the rules environment.systemPackages = [ pkgs.localtime ]; users.users = [{ name = "localtimed"; description = "Taskserver user"; }]; </del> <ins> # We use the 'out' output, since localtime has its 'bin' output # first, so that is what we get if we use the derivation bare. # Install the polkit rules. environment.systemPackages = [ pkgs.localtime.out ]; # Install the systemd unit. systemd.packages = [ pkgs.localtime.out ]; </ins> systemd.services.localtime = { <del> description = "localtime service"; </del> wantedBy = [ "multi-user.target" ]; <del> partOf = [ "geoclue.service "]; serviceConfig = { Restart                 = "on-failure"; # TODO: make it work with dbus #DynamicUser             = true; Nice                    = 10; User                    = "localtimed"; PrivateTmp              = "yes"; PrivateDevices          = true; PrivateNetwork          = "yes"; NoNewPrivileges         = "yes"; ProtectSystem           = "strict"; ProtectHome             = true; ExecStart               = "${pkgs.localtime}/bin/localtimed"; }; </del> <ins> serviceConfig.Restart = "on-failure"; </ins> }; }; }
Code change:
I've just set on my laptop while on holiday. The timezone never updates (tried restarting, waiting a while). Running I see: I see in that the service is run as the user. If I run: I also see the message . Whereas if I run there is no output and the timezone immediately updates (as shown by an immediate change in the time in my status bar, and confirmed by running ). It seems that the user just doesn't have permission to set the timezone. in (and unset ) to see if timezone changes , look for messages with "Failed to set timezone" (will only appear if the timezone it would need to set is different than the current timezone) system: host os: multi-user?: sandbox: version: channels(root): nixpkgs:
It worked for me after a reboot. Maybe the polkit rules are not getting appliead during a ?

Related discussion:
text: <del> { stdenv, systemd, polkit, fetchFromGitHub, buildGoPackage, m4}: </del> <ins> { stdenv, fetchFromGitHub, buildGoPackage, m4 }: </ins> buildGoPackage rec { name = "localtime-2017-11-07";
Code change:
I've just set on my laptop while on holiday. The timezone never updates (tried restarting, waiting a while). Running I see: I see in that the service is run as the user. If I run: I also see the message . Whereas if I run there is no output and the timezone immediately updates (as shown by an immediate change in the time in my status bar, and confirmed by running ). It seems that the user just doesn't have permission to set the timezone. in (and unset ) to see if timezone changes , look for messages with "Failed to set timezone" (will only appear if the timezone it would need to set is different than the current timezone) system: host os: multi-user?: sandbox: version: channels(root): nixpkgs:
It worked for me after a reboot. Maybe the polkit rules are not getting appliead during a ?

Related discussion:
text: }; goPackagePath = "github.com/Stebalien/localtime"; <del> buildInputs = [ systemd polkit m4 ]; </del> <ins> buildInputs = [ m4 ]; </ins> <del> makeFlags = [ "PREFIX=$(out)" ]; </del> <ins> makeFlags = [ "PREFIX=${placeholder "out"}" "BINDIR=${placeholder "bin"}/bin" ]; </ins> buildPhase = '' cd go/src/${goPackagePath} <del> make localtimed </del> <ins> make $makeFlags </ins> ''; installPhase = '' <del> mkdir -p $bin/bin install -Dm555 localtimed $bin/bin </del> <ins> make install $makeFlags </ins> ''; meta = with stdenv.lib; {
Code change:
Using with a doesn't work right anymore after (and the bugfix commit ). I have a simple Docker image I'm using as a , which sets up a user and puts some files in their home directory . (The exact setup doesn't matter.) When I use , the files that are present in the home folder in the base image are lost. This used to work before the commits above. I made this repro derivation: Try running and compare that output to the base image: You will see that the repro image is missing files. CC
(To be clear, it is now broken for a normal , not a layered one.)
Friendly ping , can you tell what broke here?
it seems to be related to the layers ordering. If you both images, you will see layers are reversed. Could you check the associated PR fixes this issue?
Yes, that seems to work! Many thanks :)
Merged so this should be fixed. Thanks !
Oh no, I found another aspect of this which is still broken :(. I think it's still covered under this issue, so I think we should reopen this one rather than file another, is that okay? There's still a problem when you have a command in the command: the layers from the base image aren't present. Here's my repro from above with that addition: If you run and look at the build output, you'll see the output of the command. Because the base image I'm using has an user named "user", you should see a line like this: but due to the regression from you don't see that line. This is preventing me from doing some extra setup that depends on stuff in the base image. Any chance you can see a fix ? :)
Does fix this issue?
Yes , that seems to work! Thanks again

Related discussion:
text: imageJson=$(cat ${baseJson} | jq ". + {"rootfs": {"diff_ids": [], "type": "layers"}}") manifestJson=$(jq -n "[{"RepoTags":["$imageName:$imageTag"]}]") <del> for layerTar in $(cat ./layer-list); do </del> <ins> for layerTar in $(tac ./layer-list); do </ins> layerChecksum=$(sha256sum image/$layerTar | cut -d ' ' -f1) imageJson=$(echo "$imageJson" | jq ".history |= [{"created": "$(jq -r .created ${baseJson})"}] + .") imageJson=$(echo "$imageJson" | jq ".rootfs.diff_ids |= ["sha256:$layerChecksum"] + .")
Code change:
References to (5) should have hyperlinks to the article/section.
These are references to man pages so there can't easily be a hyperlink. I made a PR that makes sure these are referenced to using , though. So that they at least carry some semantic meaning.
My bad I didn't think about the man pages. There are man pages online, too. I found this site: but it'd be nice to have them generated into the NixOS documentation. Having the man page sources piped into HTML would be useful I not a huge space waster.

Related discussion:
text: networks are set, it will default to using a configuration file at <literal>/etc/wpa_supplicant.conf</literal>. You should edit this file yourself to define wireless networks, WPA keys and so on (see <del> wpa_supplicant.conf(5)). </del> <ins> <citerefentry> <refentrytitle>wpa_supplicant.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>). </ins> </para> <para>
Code change:
References to (5) should have hyperlinks to the article/section.
These are references to man pages so there can't easily be a hyperlink. I made a PR that makes sure these are referenced to using , though. So that they at least carry some semantic meaning.
My bad I didn't think about the man pages. There are man pages online, too. I found this site: but it'd be nice to have them generated into the NixOS documentation. Having the man page sources piped into HTML would be useful I not a huge space waster.

Related discussion:
text: ''; description = '' Use this option to configure advanced authentication methods like EAP. <del> See wpa_supplicant.conf(5) for example configurations. </del> <ins> See <citerefentry> <refentrytitle>wpa_supplicant.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry> for example configurations. </ins> Mutually exclusive with <varname>psk</varname> and <varname>pskRaw</varname>. '';
Code change:
References to (5) should have hyperlinks to the article/section.
These are references to man pages so there can't easily be a hyperlink. I made a PR that makes sure these are referenced to using , though. So that they at least carry some semantic meaning.
My bad I didn't think about the man pages. There are man pages online, too. I found this site: but it'd be nice to have them generated into the NixOS documentation. Having the man page sources piped into HTML would be useful I not a huge space waster.

Related discussion:
text: ''; description = '' Extra configuration lines appended to the network block. <del> See wpa_supplicant.conf(5) for available options. </del> <ins> See <citerefentry> <refentrytitle>wpa_supplicant.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry> for available options. </ins> ''; };
Code change:
References to (5) should have hyperlinks to the article/section.
These are references to man pages so there can't easily be a hyperlink. I made a PR that makes sure these are referenced to using , though. So that they at least carry some semantic meaning.
My bad I didn't think about the man pages. There are man pages online, too. I found this site: but it'd be nice to have them generated into the NixOS documentation. Having the man page sources piped into HTML would be useful I not a huge space waster.

Related discussion:
text: ''; description = '' Extra lines appended to the configuration file. <del> See wpa_supplicant.conf(5) for available options. </del> <ins> See <citerefentry> <refentrytitle>wpa_supplicant.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry> for available options. </ins> ''; }; };
Code change:
the python binding for krita are not build correctly. Please run and paste the results.
more details wouldn't hurt...
well I don't exactly know what is happening here, to build the python binding, it requires and . So when are to the buildInputs, cmake finds all the dependencies correctly; however, at around 98% the compilation fails due to not finding some sip bindings. Alternatively, if is to the buildInputs, everything works fine as intended. But the python interpreter overwrite the python interpreter in the nix-env, so that doesn't seem to be the right fix.
also tried setting the variable, but that didn't work either.
cc who worked on / in

Related discussion:
text: <del> { mkDerivation, lib, stdenv, fetchurl, cmake, extra-cmake-modules </del> <ins> { mkDerivation, lib, stdenv, makeWrapper, fetchurl, cmake, extra-cmake-modules </ins> , karchive, kconfig, kwidgetsaddons, kcompletion, kcoreaddons , kguiaddons, ki18n, kitemmodels, kitemviews, kwindowsystem , kio, kcrash