jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.17k stars 1.07k forks source link

Build fails if using fish shell #1671

Open glindstedt opened 4 years ago

glindstedt commented 4 years ago

I encountered this while building an AUR package using this library:

  ⨯ cannot execute  cause=exit status 1
                    out={:timestamp=>"2019-11-27T19:36:17.539250+0100", :message=>"Process failed: /usr/bin/fish failed (exit code 127). Full command was:[\"/usr/bin/fish\", \"-c\", \"LANG=C bsdtar -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' .INSTALL .PKGINFO usr opt\"]", :level=>:error}

Which I've traced down to this line: https://github.com/jordansissel/fpm/blob/0c1ef4e106ecf9581db5bc6bd6d51eae56cd83dd/lib/fpm/package/pacman.rb#L325

It seems like safesystem assumes that whatever shell a system is using is bash-like. I think the only issue here is the way the environment variable LANG=C is set.

A workaround for this is to manually set the shell variable to point to bash before building. In the case of fish:

set -gx SHELL /usr/bin/bash
FWDekker commented 1 year ago

I thought I had this issue as well, but the issue was actually that I didn't have bsdtar installed. The error message is the same for both cases. I resolved my issue with apt install libarchive-tools.