-
-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Added ruby gem postrunner #113317
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
base: master
Are you sure you want to change the base?
Added ruby gem postrunner #113317
Conversation
|
Result of 1 package built:
1 suggestion:
Result of 1 package built:
1 suggestion:
|
3255898 to
55a3059
Compare
SuperSandro2000
left a comment
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.
You forgot to add the gemfile which pins the version number.
|
Added Gemfile. Really a stupid error by me. Thanks a lot for the reviews. |
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.
Can we pin the version here?
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.
I pinned the version there. But I think this violates an assumption of the bundler-update-script (see pkgs/development/ruby-modules/bundler-update-script/default.nix).
But bundler-update-script is not documented and I am still a novice NixOS user.
I would appreciate if @nicknovitski could answer this question.
I would suggest to add
in https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/ruby.section.md#packaging-executables-that-require-wrapping
a few lines to mention the purpose of bundler-update-script and when it is called. Probably somewhere via another script at a given point for each NixOS release.
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.
I wrote it to follow the convention that I saw in other packages and the manual (including in that linked section), where no version specification is added to the Gemfile, since committing the lockfile pins the version anyway.
63a203d to
9847ceb
Compare
SuperSandro2000
left a comment
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.
Please update the package init commit to postrunner: init at 1.0.4.
nixos/tests/postrunner.nix
Outdated
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.
A "test" like this can be implemented as an installCheck.
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.
Sorry, but this is beyond my novice NixOS level.
As I understand, I should
- Remove the file
nixos/tests/postrunner.nixand - Add somehow a derivation of bundlerApp where I add some lines like
doInstallCheck = true;
installCheckPhase = ''
if [[ "$out/bin/postrunner --version)" == "postrunner version 1.0.4" ]]; then
echo 'postrunner smoke check passed'
else
echo 'postrunner smoke check failed'
return 1
fi
'';But I found no file under nixpks where a bundlerApp has a checkInstall. And I am not versed enough to make this happen.
Can you give me hint or a sketch of the solution?
Thanks in advance.
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.
Alternately, you can use passthru.tests with runCommand helper, see https://nixos.org/manual/nixpkgs/unstable/#sec-package-tests
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/howto-run-a-postinstall-check-for-a-ruby-bundlerapp/13780/1 |
|
Thanks jtojnar for your tipp. But I thinks these kind of tests work for python and haskell, but not for ruby gem packaged via bundlerEnv or bundlerApp. passthru.doInstallCheck = true;
passthru.installCheckPhase = ''
echo doInstallCheck is true
'';Did not produce any output neither. |
|
The point of |
|
I marked this as stale due to inactivity. → More info |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
Result of 1 package built:
|
raboof
left a comment
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.
Looks good, one more thing to look at
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.
https://github.com/scrapper/postrunner#license looks like gpl2Only to me?
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.
My understanding was, that with the GPL v2 you are entitled to use it also with a later version of the GPL. But I am not a license specialist.
But on github pkgs/tools/text/unoconv/default.nix which has licenses.gpl2 points to same license GPL v20 as the gpl2only marked in pkgs/tools/typesetting/htmldoc/default.nix.
And in https://github.com/NixOS/nixpkgs/blob/master/lib/licenses.nix we have
gpl2Only = {
spdxId = "GPL-2.0-only";
fullName = "GNU General Public License v2.0 only";
};
I do not find any mentioning of GPL-2.0-only in the postrunner code
.
So I am confused. Do you now how can get a definitive answer?
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.
My understanding was, that with the GPL v2 you are entitled to use it also with a later version of the GPL. But I am not a license specialist.
If https://github.com/scrapper/postrunner/blob/master/lib/postrunner.rb#L8-L10 would mention or later. So gpl2Only is correct.
I do not find any mentioning of GPL-2.0-only in the postrunner code
Only is defined by the absence of or at your option any later version.
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.
Do you now how can get a definitive answer?
I think the license text is pretty clear: https://github.com/scrapper/postrunner/blob/master/COPYING#L242
If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
So AFAICS that confirms that, since they do specify 'version 2' but don't specify 'or any later version', we should interpret that as gpl2Only.
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.
| homepage = "https://github.com/scrapper/postrunner.git"; | |
| homepage = "https://github.com/scrapper/postrunner"; |
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.
| license = licenses.gpl2only; | |
| license = licenses.gpl2Only; |
|
As we don't squash on merge, perhaps the last 3 commits could be squashed into one |
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.
Starting to look good, but postrunner version gives me:
ERROR: Permission denied @ rb_sysopen - /home/aengelen/.postrunner/html/icons/last.png
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1415:in `initialize'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1415:in `open'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1415:in `block in copy_file'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1414:in `open'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1414:in `copy_file'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1379:in `copy'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:497:in `block in copy_entry'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1513:in `wrap_traverse'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1516:in `block in wrap_traverse'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1515:in `each'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1515:in `wrap_traverse'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:494:in `copy_entry'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:468:in `block in cp_r'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1589:in `block in fu_each_src_dest'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1603:in `fu_each_src_dest0'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:1587:in `fu_each_src_dest'
/nix/store/55ywcfngxkymn252792i5mg6zd8glaqb-ruby-2.7.6/lib/ruby/2.7.0/fileutils.rb:467:in `cp_r'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/ActivitiesDB.rb:339:in `create_auxdir'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/ActivitiesDB.rb:83:in `block in create_directories'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/ActivitiesDB.rb:82:in `each'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/ActivitiesDB.rb:82:in `create_directories'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/ActivitiesDB.rb:36:in `initialize'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/Main.rb:646:in `new'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/Main.rb:646:in `import_legacy_archive'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/Main.rb:311:in `execute_command'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner/Main.rb:79:in `main'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner.rb:24:in `<module:PostRunner>'
/nix/store/l962hj6g01y4xp8n4hdzh7jih5y4pw5z-ruby2.7.6-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/lib/postrunner.rb:22:in `<top (required)>'
/nix/store/zgfbxq6bsvf35bx5870b3cizd9w8n4wl-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/bin/postrunner:4:in `require'
/nix/store/zgfbxq6bsvf35bx5870b3cizd9w8n4wl-postrunner-1.0.5/lib/ruby/gems/2.7.0/gems/postrunner-1.0.5/bin/postrunner:4:in `<top (required)>'
/nix/store/fp9xmpa031yf4agzv04kicdnlkp4nj7d-postrunner-1.0.5/bin/postrunner:35:in `load'
/nix/store/fp9xmpa031yf4agzv04kicdnlkp4nj7d-postrunner-1.0.5/bin/postrunner:35:in `<main>'
*******************************************************************************
You have triggered a bug in PostRunner 1.0.5!
That does not seem good?
This file was just created by postrunner itself:
-r--r--r-- 1 aengelen users 1.2K Jul 29 17:18 /home/aengelen/.postrunner/html/icons/last.png
|
I cannot reproduce your problem. On my checkout I run |
That works for me as well
This gives the Anyway, since the documented behavior seems to work (and it's just the error reporting when using an invalid command that seems rather loud on my side) I guess this PR LGTM after fixing the test condition. |
|
Running the tests works for me as well: I have nix (Nix) 2.8.1 |
Interesting - that is surprising since it does
(I'm on 2.9.1, if that matters) |
|
I tried rebasing this on nixos-unstable but now got: |
|
@raboof: I think my old way to add the postrunner gem is too complicated. |
Motivation for this change
Add a ruby gem I use for importing FIT data after jogging
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)I am puzzled, that testing it locally does not work, as show by
Running the tests via
nix-build nixos/tests/postrunner.nixshows not problem.But this is the same with gollum (another ruby gem) I tested with.