Skip to content
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

missing require "zlib" in deb.rb makes big deb package creation fail with error #1739

Closed
lancerinf opened this issue Dec 14, 2020 · 5 comments

Comments

@lancerinf
Copy link
Contributor

I've encountered an issue with the DEB target for a NodeJS application, converting from DIR.
We are packaging all the node_modules folder together with our application code, so the starting DIR is pretty huge.

FPM smartly tries using zlib to deflate our package, but fails hard with this output:

Doing `require 'backports'` is deprecated and will not load any backport in the next major release.
Require just the needed backports instead, or 'backports/latest'.
Setting workdir {:workdir=>"/tmp", :level=>:info}
Setting from flags: epoch= {:level=>:info}
Setting from flags: iteration=1162 {:level=>:info}
Setting from flags: name=****** {:level=>:info}
Setting from flags: url=http://example.com/no-uri-given {:level=>:info}
Setting from flags: version=1.1.0 {:level=>:info}
Converting dir to deb {:level=>:info}
/home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/lib/fpm/package/deb.rb:495:in `block in output': uninitialized constant FPM::Package::Deb::Zlib (NameError)
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/lib/fpm/package/deb.rb:494:in `tap'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/lib/fpm/package/deb.rb:494:in `output'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/lib/fpm/command.rb:487:in `execute'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/lib/fpm/command.rb:574:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
	from /home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/bin/fpm:7:in `<top (required)>'
	from /home/travis/.rvm/gems/ruby-2.4.1/bin/fpm:23:in `load'
	from /home/travis/.rvm/gems/ruby-2.4.1/bin/fpm:23:in `<main>'

I've experimented monkey-patching a require "zlib" into https://github.com/jordansissel/fpm/blob/master/lib/fpm/package/deb.rb and realized that after that, it does the job excellently.

So I guess I'm opening this Issue, and proposing the solution and can have a PR up for that in a heartbeat.
Let me know what you think and if I can open a PR to fix it.

@inside
Copy link

inside commented Dec 17, 2020

Hi! I've got the same error. I will monkey patch too in the meantime.

@lancerinf
Copy link
Contributor Author

Glad that this helped out someone!

For completeness, the way I've monkey patched it is this:

sudo sed -i '/require "digest"/a require "zlib"' /home/travis/.rvm/gems/ruby-2.4.1/gems/fpm-1.11.0/lib/fpm/package/deb.rb

@speque
Copy link

speque commented Dec 22, 2020

This affected us too, hoping to see the PR merged.

@frebib
Copy link

frebib commented Jan 12, 2021

Ditto, also affecting us on Debian Bullseye

@frebib
Copy link

frebib commented Jan 12, 2021

@jordansissel Any chance of this being merged please?

gitlab-runner-bot pushed a commit to gitlabhq/gitlab-runner that referenced this issue Oct 13, 2023
Version 1.10.2 of fpm has the following bug, which prevents it from
building debs:

    jordansissel/fpm#1739

for example https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/5089983316#L169

Bumping the version to the latest fixes this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants