New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ruby built #28083
Fix ruby built #28083
Conversation
@@ -49,12 +49,12 @@ let | |||
rev = tag; | |||
sha256 = sha256.git; | |||
} else fetchurl { | |||
url = "http://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this works for me, if you take a look at ruby-version.nix
, you see __toString
.
If I add:
url = lib.traceVal "http://cache.ruby-lang.org/pub/ruby/${ver.majMin}/ruby-${ver}.tar.gz";
I see:
trace: http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.gz
Could this error happen when using an old version of nix?
cc: @zimbatm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method was introduced here: NixOS/nix#721
This does not explain, why it happened to you in 16.09
.
I cannot reproduce this, on which commit are you? |
He must have used a quite old version of nix. |
Strange, there should be a check on minimal Nix version before evaluating rest of nixpkgs |
Sorry I couldn't reply earlier, I was on holidays last week. More info about the issue: If I check v16.09 of nixpkgs, the command works fine: $ git co 16.09 -b v16.09
$ git log -1
commit f22817d8d2bc17d2bcdb8ac4308a4bce6f5d1d2b
Author: Susan Potter <me@susanpotter.net>
Date: Sat Oct 1 14:45:22 2016 -0500
kibana: fix 4.6.0 for i686
(cherry picked from commit c3e57f3095d3c5e4631a5978702226ee2b6bd8cd)
$ nix-build -A ruby
/nix/store/g2yx0xc7phhx9ldzj7hasbglrdq8xxs9-ruby-2.3.1-p0 If I check v17.03 of nixpkgs, I can reproduce the issue: $ git co 17.03 -b v17.03
Switched to branch 'v17.03'
Your branch is behind 'origin/release-17.03' by 884 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
$ git log -1
commit 7dcd3c471f7b2b69135ff93696ff4bf62ee71fb7
Merge: e4b0992 05a2866
Author: Domen Kožar <domen@dev.si>
Date: Tue Mar 28 16:06:57 2017 +0200
Merge branch 'staging-17.03' into release-17.03
$ nix-build -A ruby
error: cannot coerce a set to a string, at /home/dpino/workspace/nixpkgs/pkgs/development/interpreters/ruby/default.nix:57:17 If I switch to 17.03 and pull, I can reproduce the issue too:
Originally my motivation for "fixing" this issue was that when update the nixos channel from 16.09 to 17.03, if I searched for a package (any package), I got the error stated above. I've tried now to switch to 17.03 from 16.09 and search for a package, and it works fine. $ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-17.03
$ nix-env -qaP '.*tcpdump.*'
nixos-16.09.tcpdump tcpdump-4.9.0 I hope this info can shed some light. |
@dpino can you post the output of |
OTOH, I cannot reproduce the issue anymore. I've to work on this machine, so I cannot keep it on the same state. I don't know what I've done that fixed the issue. I believe it was a |
did you reboot your machine after upgrade to 17.03? |
This language feature has been introduced in nix 1.11 NixOS/nix@14080f3 After some point the best upgrade path would be to install a new version of nix and then re-build the system based on that. |
@danbst No, I didn't. @zimbatm OK, sounds reasonable. In /etc/nixos/configuration.nix, I can see the following:
Likely this system was using 15.09 although as far as I recall I was using 16.03 as nixos channel (which would include the Nov 2015 changes), but perhaps I add the channel and I didn't update or upgrade the system. According to what you said, this seemed to be the issue. |
yup, reproduced the error on 15.09 vagrant nixbox, which has nix 1.10 |
So, I've bumped Nix version for future 17.09 to Nix 1.11 (hope it will be merged soon), but it won't go into 17.03. Unfortunately, that doesn't solve a problem, it only can help people when they update from 15.09 to 17.09 in one go. So this PR is still valid for 17.03. |
Motivation for this change
When trying to build package ruby from master, I got the following error:
Actually I for this error after upgrading from 16.09 to 17.03. Running a nix-env command returned the same error:
$ nix-env -qaP ruby error: cannot coerce a set to a string, at /nix/store/v1zvii5pzvx76dgkb8ifdsyp8fwj6ng6-nixos-17.03.1661.1f7114aec3/nixos/pkgs/development/interpreters/ruby/default.nix:57:17
This happened not only when searching package ruby, but any other package.
Things done
Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers.
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)