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

"--fpm-options-file" fails with "undefined method `extract_value' for nil:NilClass" #2060

Open
manero6 opened this issue Apr 29, 2024 · 1 comment

Comments

@manero6
Copy link

manero6 commented Apr 29, 2024

Hi *

I want to create a .deb package out of a bin file.
To achieve that I created a custom options file called fpmdeb (I also tested without newlines):

--maintainer "Me Myself <[email protected]>"
--architecture all

-s dir
-t deb

--name blabla-github-yq
--license mit
--description "yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor"
--url "https://github.com/mikefarah/yq"

yq_linux_amd64=/usr/bin/yq

And run fpm as follows:

fpm --version 4.43.1 --fpm-options-file fpmdeb

Unfortunately I end up getting this error:

Loading flags from file {:path=>"fpmdeb", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"--maintainer \"Me Myself <[email protected]>\"", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"--architecture all", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"-s dir", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"-t deb", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"--name blabla-github-yq", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"--license mit", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"--description \"yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor\"", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"--url \"https://github.com/mikefarah/yq\"", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"", :level=>:info}
Processing flags from file {:path=>"fpmdeb", :line=>"yq_linux_amd64=/usr/bin/yq", :level=>:info}
/var/lib/gems/3.0.0/gems/fpm-1.15.1/lib/fpm/command.rb:662:in `block in load_options': undefined method `extract_value' for nil:NilClass (NoMethodError)
        from /var/lib/gems/3.0.0/gems/fpm-1.15.1/lib/fpm/command.rb:625:in `each'
        from /var/lib/gems/3.0.0/gems/fpm-1.15.1/lib/fpm/command.rb:625:in `load_options'
        from /var/lib/gems/3.0.0/gems/fpm-1.15.1/lib/fpm/command.rb:254:in `block in <class:Command>'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/attribute/declaration.rb:33:in `instance_exec'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/attribute/declaration.rb:33:in `block in define_simple_writer_for'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/attribute/instance.rb:59:in `take'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/option/parsing.rb:32:in `parse_options'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/command.rb:53:in `parse'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/command.rb:67:in `run'
        from /var/lib/gems/3.0.0/gems/fpm-1.15.1/lib/fpm/command.rb:591:in `run'
        from /var/lib/gems/3.0.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
        from /var/lib/gems/3.0.0/gems/fpm-1.15.1/bin/fpm:7:in `<top (required)>'
        from /usr/local/bin/fpm:25:in `load'
        from /usr/local/bin/fpm:25:in `<main>'

But if I rename fpmdeb to .fpm and run fpm as follows:

fpm --version 4.43.1

then everything works as expected and I get the desired .deb package.

However, with this config file fpmdeb:

--maintainer "Me Myself <[email protected]>"
--architecture all

-s dir
-t deb

--name blabla-github-yq
--license mit
--description "yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor"
--url "https://github.com/mikefarah/yq"

And running fpm this way:

fpm --version 4.43.1 --fpm-options-file fpmdeb yq_linux_amd64=/usr/bin/yq

I am able to create a .deb package using --fpm-options-file !

Am I doing something wrong?

Thanks :)

@jpiron
Copy link

jpiron commented May 27, 2024

I have the same error when I try to use a fpm-options-file that is located in a subfolder.

Moving the options file to the project root folder solved the issue.

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

2 participants