-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Perl CPAN Support, Fix All 5 Outstanding Issues, Second Try #1528
Conversation
Testing manually
The following tests fail on this PR but do not fail on master. +rspec ./spec/fpm/package/gem_spec.rb:26 # FPM::Package::Gem when :gem_version_bins? is true it should append the version to binaries
+rspec ./spec/fpm/package/gem_spec.rb:38 # FPM::Package::Gem when :gem_version_bins? is false it should not append the version to binaries
+rspec ./spec/fpm/package/gem_spec.rb:51 # FPM::Package::Gem when :gem_fix_name? is true and :gem_package_name_prefix is nil/default should prefix the package with 'gem-'
+rspec ./spec/fpm/package/gem_spec.rb:58 # FPM::Package::Gem when :gem_fix_name? is true and :gem_package_name_prefix is set should prefix the package name appropriately
+rspec ./spec/fpm/package/gem_spec.rb:72 # FPM::Package::Gem when :gem_fix_name? is false it should not prefix the name at all
+rspec ./spec/fpm/package/gem_spec.rb:83 # FPM::Package::Gem when :gem_shebang is nil/default should not change the shebang
+rspec ./spec/fpm/package/gem_spec.rb:96 # FPM::Package::Gem when :gem_shebang is set should change the shebang
+rspec ./spec/fpm/package/npm_spec.rb:17 # FPM::Package::NPM::default_prefix should provide a valid default_prefix
+rspec ./spec/fpm/package/pacman_spec.rb:100 # FPM::Package::Pacman#output Test that empty epoch is tested properly should have the correct iteration
+rspec ./spec/fpm/package/pacman_spec.rb:104 # FPM::Package::Pacman#output Test that empty epoch is tested properly should have the correct epoch
+rspec ./spec/fpm/package/pacman_spec.rb:186 # FPM::Package::Pacman#output normal tests script contents should be the same both with input as with original for after_install
+rspec ./spec/fpm/package/pacman_spec.rb:186 # FPM::Package::Pacman#output normal tests script contents should be the same both with input as with original for after_remove
+rspec ./spec/fpm/package/pacman_spec.rb:186 # FPM::Package::Pacman#output normal tests script contents should be the same both with input as with original for after_upgrade
+rspec ./spec/fpm/package/pacman_spec.rb:186 # FPM::Package::Pacman#output normal tests script contents should be the same both with input as with original for before_install
+rspec ./spec/fpm/package/pacman_spec.rb:186 # FPM::Package::Pacman#output normal tests script contents should be the same both with input as with original for before_remove
+rspec ./spec/fpm/package/pacman_spec.rb:186 # FPM::Package::Pacman#output normal tests script contents should be the same both with input as with original for before_upgrade
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /etc
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /etc/foo.conf
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/bin
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/bin/foo
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/lib
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/lib/libfoo.so
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/share
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/share/doc
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /usr/share/doc/foo.txt
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /var
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /var/lib
+rspec ./spec/fpm/package/pacman_spec.rb:210 # FPM::Package::Pacman#output normal tests file permissions should preserve file permissions for /var/lib/foo
+rspec ./spec/fpm/package/pacman_spec.rb:218 # FPM::Package::Pacman#output normal tests package attributes should have the correct name
+rspec ./spec/fpm/package/pacman_spec.rb:222 # FPM::Package::Pacman#output normal tests package attributes should have the correct version
+rspec ./spec/fpm/package/pacman_spec.rb:226 # FPM::Package::Pacman#output normal tests package attributes should have the correct iteration
+rspec ./spec/fpm/package/pacman_spec.rb:230 # FPM::Package::Pacman#output normal tests package attributes should have the correct epoch
+rspec ./spec/fpm/package/pacman_spec.rb:234 # FPM::Package::Pacman#output normal tests package attributes should not have bogus dependencies, just correct dependencies
+rspec ./spec/fpm/package/pacman_spec.rb:92 # FPM::Package::Pacman#output Test that empty epoch is tested properly should have the correct name
+rspec ./spec/fpm/package/pacman_spec.rb:96 # FPM::Package::Pacman#output Test that empty epoch is tested properly should have the correct version |
The pacman failures seem to be all identical:
|
@jordansissel |
@liger1978 |
@wbraswell I can't really help. To be honest I'm not sure the work on #1522 is the right approach now. I think we need to go back to basics and workout why the gcc sub-process hangs during the build when triggered from the ruby code. I think this is going to need help from @jordansissel or someone else. |
Running external programs seems to be a minefield in ruby and beyond my time/inclination/skills to fix this is a reliable non-hacky way. |
@liger1978 @jordansissel Can you please give some guidance on how to proceed? |
@jordansissel |
I will try to do soon. Other responsibilities have taken priority over this
the past few months.
…On Fri, Feb 22, 2019 at 10:38 AM William N. Braswell, Jr. < ***@***.***> wrote:
@jordansissel <https://github.com/jordansissel>
Can you please spare a few minutes to review the code and give your input?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1528 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIC6qt3-T16mlyardG8Zr4Fg75uJY-qks5vQDk_gaJpZM4VKFjX>
.
|
@jordansissel |
At first glance, this is a large PR which introduces many test failures and changes quite a number of things. I can spend some time trying to review, but with so much changing in a single PR with multiple objectives in this PR, it may be difficult for me to untangle all the changes. |
For the Inline::CPP hang (which takes several minutes before hanging as it installs a dozen or so Perl modules), I can confirm that
|
@jordansissel |
@wbraswell for tonight at least, I'm going to try and go through as many of the referenced issues as i can and figure out a solution (plus review the relevant changes in this PR, if need) |
@jordansissel |
@wbraswell do you know of any way to speed this up? Each |
@wbraswell figured out the performance as I remembered cpan runs the test suite by default. I found that
If I have to guess right now, |
This appears to fix Inline::CPP by closing diff --git a/lib/fpm/util.rb b/lib/fpm/util.rb
index 6ebfde2..117353c 100644
--- a/lib/fpm/util.rb
+++ b/lib/fpm/util.rb
@@ -153,9 +153,10 @@ module FPM::Util
process.io.stdout = stdout_w
process.io.stderr = stderr_w
- if block_given? and opts[:stdin]
- process.duplex = true
- end
+ # Always use duplex mode because we will always
+ # want to either write to stdin (if block_given?)
+ # or we will want to close stdin to prevent subprocesses from blocking on it.
+ process.duplex = true
process.start
@@ -170,10 +171,13 @@ module FPM::Util
yield(*args3)
- process.io.stdin.close if opts[:stdin] and not process.io.stdin.closed?
+ process.io.stdin.close if not process.io.stdin.closed?
stdout_r.close unless stdout_r.closed?
stderr_r.close unless stderr_r.closed?
else
+ # If no block given (not interactive) we should close stdin.
+ process.io.stdin.close
+
# Log both stdout and stderr as 'info' because nobody uses stderr for
# actually reporting errors and as a result 'stderr' is a misnomer.
logger.pipe(stdout_r => :info, stderr_r => :info)
|
The patch in #1528 (comment) appears to resolve #1519 and does not add any test failures (master currently has 13 failing tests on my workstation, and adding this patch keeps it at 13 failures aka no change) |
For #1518, if I take just one line, I think it fixes it: https://github.com/jordansissel/fpm/pull/1518/files#diff-2533a90976db66b6aaa59e0763508b96R317 % git diff
diff --git a/lib/fpm/package/cpan.rb b/lib/fpm/package/cpan.rb
index cbb786f..64eec8d 100644
--- a/lib/fpm/package/cpan.rb
+++ b/lib/fpm/package/cpan.rb
@@ -304,7 +304,8 @@ class FPM::Package::CPAN < FPM::Package
directory = build_path("module")
::Dir.mkdir(directory)
args = [ "-C", directory, "-zxf", tarball,
- "--strip-components", "1" ]
+ # "--strip-components", "1" ] # fails on removing leading ./Foo/ in tarball paths
+ %q{--transform=s,[./]*[^/]*/,,} ] # succeeds on removing leading ./Foo/ or /Foo/ or Foo/
safesystem("tar", *args)
return directory
end
|
I took the above diff and committed it to a branch as @wbraswell 9d774843aebd565abea36357951ae31e10edb0bf Two issues down. Three to go? ;) |
@wbraswell The stdin one was kind of a fun bug! Thank you for working on all of this. #1610 should fix many of these things. I excluded the SRPM because I'm unclear on the goal and also how not to confuse users, and I'd like us to discuss that separately from these CPAN bugs. Can you test #1610 and let me know how it goes? |
@jordansissel |
In hindsight, it was foolish of me to try and fix more than 1 or 2 bugs per pull request. |
I tried this pull request once before, but forgot to clean up the code in the last commit: #1527
@jordansissel
Please merge this pull request, it solves all 5 outstanding Perl issues:
Issue: #1517
Fixed: wbraswell@a1afdb7
Issue: #1519
Fixed:
wbraswell@4756a45
wbraswell@373cb65
Issue: #1522
Fixed:
wbraswell@3171ee9
wbraswell@985c39b
Issue: #1523
Fixed: wbraswell@f4f4b56
Issue: #1526
Fixed:
wbraswell@c01f67a
wbraswell@1d37ec3