-
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
OS X can't build rpm with noarch and linux as the target #707
Comments
Looks like $ fpm --rpm-os darwin --architecture all -t rpm -s dir -n test -v 1.0 testdir
Process failed: rpmbuild failed (exit code 1). Full command was:["rpmbuild", "-bb", "--target", "noarch", "--target", "noarch-unknown-darwin", "--define", "buildroot /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55820-1d9oui/BUILD", "--define", "_topdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55820-1d9oui", "--define", "_sourcedir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55820-1d9oui", "--define", "_rpmdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55820-1d9oui/RPMS", "/var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55820-1d9oui/SPECS/test.spec"] {:level=>:error}
$ fpm --rpm-os darwin --architecture noarch -t rpm -s dir -n test -v 1.0 testdir
Process failed: rpmbuild failed (exit code 1). Full command was:["rpmbuild", "-bb", "--target", "noarch", "--target", "noarch-unknown-darwin", "--define", "buildroot /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55880-vn0sr/BUILD", "--define", "_topdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55880-vn0sr", "--define", "_sourcedir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55880-vn0sr", "--define", "_rpmdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55880-vn0sr/RPMS", "/var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55880-vn0sr/SPECS/test.spec"] {:level=>:error}
$ fpm --rpm-os darwin --architecture x86_64 -t rpm -s dir -n test -v 1.0 testdir
Created package {:path=>"test-1.0-1.x86_64.rpm"} |
Can you include the output when running this with the |
The gist link includes --debug, should I still run with --verbose? |
doh, I didn't see that, thanks! |
Ok so here's where rpmbuild is complaining:
|
Based on this, I don't believe it to be an architecture issue, but instead something about how fpm is writing files, I guess? I have a mac laptop so I will try to reproduce. |
On the debug gist, lines 153 and 158 are missing the arch. I wonder if it's getting stripped by accident before those steps? |
@alanthing any news ? i am interested on building rpms on mac |
Nothing yet, but I'm not much of a rubyist. I'll see if I can set up an environment here locally and get something going. |
If I comment out lines 315-319 of lib/fpm/package/rpm.rb I am able to run I'll see if I can clean up that block so it works as intended but still allows --rpm-os to be set with --architecture changes and submit a PR. |
It also works if I comment out 311-313. Also, this is from my debug output from the original comment: Running rpmbuild {:args=>["rpmbuild", "-bb", "--target", "noarch", "--target", "noarch-unknown-linux", "--define", "buildroot /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy/BUILD", "--define", "_topdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy", "--define", "_sourcedir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy", "--define", "_rpmdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy/RPMS", "/var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy/SPECS/test.spec"], :level=>:info, :file=>"fpm/package/rpm.rb", :line=>"387"}
Running command {:args=>["rpmbuild", "-bb", "--target", "noarch", "--target", "noarch-unknown-linux", "--define", "buildroot /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy/BUILD", "--define", "_topdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy", "--define", "_sourcedir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy", "--define", "_rpmdir /var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy/RPMS", "/var/folders/97/qtcflz1s6_q54cp2blsl06n80000gn/T/package-rpm-build20140516-55110-b1gyy/SPECS/test.spec"], :level=>:debug, :file=>"fpm/util.rb", :line=>"59"} At this point, I'm thinking it's because |
This seems to do it, pull request coming shortly... if %x{uname -m}.chomp != self.architecture
rpm_target = self.architecture
end
# issue #309
if !attributes[:rpm_os].nil?
rpm_target = "#{architecture}-unknown-#{attributes[:rpm_os]}"
end
# issue #707
if !rpm_target.nil?
args += ["--target", rpm_target]
end |
Pull request #716 submitted. Hopefully this works out @jordansissel |
See jordansissel#716 for more information * pr/716: Fixes jordansissel#707
With rpms, if `--architecture` and `--rpm-os` are specified and different than the host, `--target` would be passed to `rpmbuild` twice, causing an error. Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture building for `--rpm-os linux` and `--architecture noarch`. This change only adds `--target` to the `rpmbuild` args once, fixing this specific error.
See jordansissel#716 for more information * pr/716: Fixes jordansissel#707
With rpms, if `--architecture` and `--rpm-os` are specified and different than the host, `--target` would be passed to `rpmbuild` twice, causing an error. Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture building for `--rpm-os linux` and `--architecture noarch`. This change only adds `--target` to the `rpmbuild` args once, fixing this specific error.
With rpms, if `--architecture` and `--rpm-os` are specified and different than the host, `--target` would be passed to `rpmbuild` twice, causing an error. Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture building for `--rpm-os linux` and `--architecture noarch`. This change only adds `--target` to the `rpmbuild` args once, fixing this specific error.
With rpms, if `--architecture` and `--rpm-os` are specified and different than the host, `--target` would be passed to `rpmbuild` twice, causing an error. Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture building for `--rpm-os linux` and `--architecture noarch`. This change only adds `--target` to the `rpmbuild` args once, fixing this specific error.
With rpms, if `--architecture` and `--rpm-os` are specified and different than the host, `--target` would be passed to `rpmbuild` twice, causing an error. Example: an OS X host (`uname -s` = "Darwin") with x86_64 architecture building for `--rpm-os linux` and `--architecture noarch`. This change only adds `--target` to the `rpmbuild` args once, fixing this specific error.
I'm writing simple bash scripts on my OS X machine that will ultimately be installed on Linux servers but ran into this problem. I isolated it down to where it breaks down.
Using OS X as the build host, you can specify
--rpm-os linux
:You can specify
--architecture all
:But, they don't work together:
The debug output is in this gist: https://gist.github.com/alanthing/5d8313a0645919faba01
I built
rpm
with Homebrew, which I have installed in/Users/alan/.homebrew
instead of/usr/local/
but that hasn't been a problem and I doubt it's what's going on here. Also, I'm using fpm 1.1, installed via gem. I'm using ruby 1.9.3 via RVM and a gemset specifically for fpm.The text was updated successfully, but these errors were encountered: