-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add default platform value to #fetch_local_hash #12
Conversation
Not having this pulls in the wrong `target` value into gemset.nix for gems like so: coderay = { groups = ["default"]; platforms = []; source = { remotes = ["https://rubygems.org"]; sha256 = "0jvxqxzply1lwp7ysn94zjhh57vc14mcshw1ygw14ib8lhc00lyw"; target = null; type = "gem"; }; targets = []; version = "1.1.3"; }; Whereas it should be "ruby" instead: coderay = { groups = ["default"]; platforms = []; source = { remotes = ["https://rubygems.org"]; sha256 = "0jvxqxzply1lwp7ysn94zjhh57vc14mcshw1ygw14ib8lhc00lyw"; target = "ruby"; type = "gem"; }; targets = []; version = "1.1.3"; }; Which results in a weird Nix shell error: error: … while calling the 'derivationStrict' builtin at /builtin/derivation.nix:9:12: (source not available) … while evaluating derivation 'nix-shell' whose name attribute is located at /nix/store/6nfpbajyzwxq6wrhn20l13rhckhv26rc-source/pkgs/stdenv/generic/make-derivation.nix:348:7 … while evaluating attribute 'buildInputs' of derivation 'nix-shell' at /nix/store/6nfpbajyzwxq6wrhn20l13rhckhv26rc-source/pkgs/stdenv/generic/make-derivation.nix:395:7: 394| depsHostHost = elemAt (elemAt dependencies 1) 0; 395| buildInputs = elemAt (elemAt dependencies 1) 1; | ^ 396| depsTargetTarget = elemAt (elemAt dependencies 2) 0; (stack trace truncated; use '--show-trace' to show the full trace) error: cannot coerce null to a string
@inscapist , thank you for the wonderful work on this! I am wondering if I am going in a right direction, and what else needs to be done for this PR to land? |
@@ -111,6 +111,7 @@ def format_hash(hash) | |||
end | |||
|
|||
def fetch_local_hash(spec) | |||
platform = Gem::Platform::RUBY # default platform value |
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.
Ultimately, the issue seems to stem from this value remaining nil
as never assigned for the gems that don't have platform dependent versions. This nil
ended up being returned on https://github.com/inscapist/bundix/pull/12/files#diff-6c1d40dc95e017380bc6a0cd183b22f63fef5ac09356ae7ba8a288009a6355c7R128 .
I've amended it by pre-assigning the default value.
sorry @SkyWriter I was swarmed in work! let me review this |
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.
lgtm
No worries! Thank you for your hard work! |
Not having this pulls in the wrong
target
value into gemset.nix for gems like so:Whereas it should be "ruby" instead:
Which results in a weird Nix shell error:
One can reproduce it by:
It may fail to reproduce on the first take since it seems to be caused by the branch fetching gems from the local store.