cqfn / pdd

Command line toolkit for collecting TODO markers from your code, known as Puzzle Driven Development (PDD)
https://www.0pdd.com
MIT License
77 stars 26 forks source link

Can't run pdd: Error loading shared library liblzma.so.5 #191

Open g4s8 opened 2 years ago

g4s8 commented 2 years ago

I'm trying to run pdd CLI tool from Docker after updating base image from alpine:3.10 to alpine:3.13 - on 3.10 image, it's working fine until gem fails to install pdd with warning that Ruby version is old and has some security bugs. On a new image ruby version is 2.7.0 and pdd can be installed successfully. But now it's failing in runtime on pdd call with strange error (see stack trace below). It looks like pdd uses some native platform dependent-shared objects. I don't really know why Ruby uses binary objects, and how can I fix it on my side.

/usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require': Error loading shared library liblzma.so.5: No such file or directory (needed by /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/nokogiri.so) - /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/nokogiri.so (LoadError)
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/extension.rb:30:in `rescue in <top (required)>'
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/extension.rb:4:in `<top (required)>'
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri.rb:10:in `require_relative'
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri.rb:10:in `<top (required)>'
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /usr/lib/ruby/gems/2.7.0/gems/pdd-0.20.8/bin/pdd:28:in `<top (required)>'
    from /usr/bin/pdd:23:in `load'
    from /usr/bin/pdd:23:in `<main>'
/usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/extension.rb:7:in `require_relative': cannot load such file -- /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/2.7/nokogiri (LoadError)
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri/extension.rb:7:in `<top (required)>'
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri.rb:10:in `require_relative'
    from /usr/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.1/lib/nokogiri.rb:10:in `<top (required)>'
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /usr/lib/ruby/gems/2.7.0/gems/pdd-0.20.8/bin/pdd:28:in `<top (required)>'
    from /usr/bin/pdd:23:in `load'
    from /usr/bin/pdd:23:in `<main>'

Full log: https://github.com/artipie/artipie/runs/4892946070?check_suite_focus=true

Docker image: https://github.com/artipie/artipie/runs/4892946070?check_suite_focus=true

yegor256 commented 2 years ago

@mbao01 can you please take a look?

mbao01 commented 2 years ago

@g4s8 Hi, I could not reproduce this issue using macOS, docker v20.10.6, alpine:3.13 and ruby v2.7.0. Please let me know if you still face this issue and if possible provide additional info. Here are the steps I used on macOS.

Pre-installation steps

docker run -it alpine:3.13 /bin/sh
/# apk update
/# apk add --no-cache build-base
/# apk add ruby ruby-dev
/# gem install json
/# gem install pdd

Run pdd

g4s8 commented 2 years ago

@mbao01 @yegor256 this issue was fixed by @baudoliver7 in this PR: https://github.com/g4s8/pdd-action/pull/4

I think it would be good to point in readme what runtime dependencies pdd require (maybe without specifying distro, just say which shared lib should be installed).

mbao01 commented 2 years ago

@g4s8 Super! We will add these dependencies to the readme. Thank you.

mbao01 commented 2 years ago

@g4s8 please can you close this issue?

g4s8 commented 2 years ago

@g4s8 please can you close this issue?

@mbao01 I think issue is not really solved: new users may have the same problem. Can you please add installation details to the readme file?

yegor256 commented 2 years ago

@mbao01 ping

mbao01 commented 2 years ago

@g4s8 I will take a second look at this. Thank you)