It really does need to install into /opt/chef. The reason here is setting the RPATH in the binaries to only link to the libraries we build, rather than the operating system. If you aren’t building in place, things go very badly for you when it comes to link time. You could, in theory, post-process everything and override the RPATHs - but it’s not clear to me this would work in every situation, or even on every platform. Precreating /opt/chef seems like not a huge difference.
Adam
-----Original Message-----
From: Dimitri Aivaliotis [mailto:aglarond@gmail.com]
Sent: Thursday, April 4, 2013 8:00 AM
To: Scott Sanders
Cc: Bryan McLellan; chef-dev@lists.opscode.com
Subject: [chef-dev] Re: Re: FreeBSD Omnibus Support
Hi Scott,
On Fri, Mar 22, 2013 at 4:59 PM, Scott Sanders ssanders@taximagic.com wrote:
The ruby build step for omnibus requires a custom patch I added to
disable libexecinfo, since the autoconf scripts for libexecinfo
hardcode the LDFLAGS to point to /usr/local instead of the desired /opt/chef prefix.
I do realize this is kind of an uphill battle, but does Omnibus have to install into /opt/chef? The BSD’s don’t have /opt. This is evident in tickets like CHEF-3761.
Follow along on the freebsd branches of the following forks:
https://github.com/jssjr/bento
https://github.com/jssjr/omnibus-ruby
https://github.com/jssjr/omnibus-chef
https://github.com/jssjr/omnibus-software
Thanks for your work on these forks!
I was able to build Omnibus with these caveats, which have only to do with Omnibus itself, and not your “freebsd” branches in particular:
-
You have to pre-create the /opt/chef directory as root and then ‘chown’ to your build user (nobody’s building as root, right?). This could be solved by having a separate install_dir (place to be installed into during build) and prefix_dir (place to be installed into after extracting the archive).
-
omnibus-chef should ship with a safe omnibus.rb, maybe something like the following:
cat >omnibus.rb<<EOF
Omnibus.configure do |o|
o.use_s3_caching = false
o.cache_dir = "/home/builder/cache"
o.source_dir = "/home/builder/src"
o.build_dir = "/home/builder/build"
o.package_dir = "/home/builder/pkg"
end
EOF
Again to support building as a non-root user.
- On install, makeself.sh seems to require bash, otherwise you get the following error:
eval: ./makeselfinst: not found
and the install will fail.
@Bryan: should I open tickets for these, or are these issues that have been seen before, decided upon, and would be closed with “Won’t Fix”?
I’m very excited to see some interest in Chef on FreeBSD!
So am I. 