-
Notifications
You must be signed in to change notification settings - Fork 180
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
Compile error: /usr/include/signal.h:92:1: error: unknown type name 'procset_t' on SmartOS and ruby 2.3.0 #236
Comments
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged). Hey, thanks for the lovely and detailed description of the problem. I'll look into your feature suggestion; mkmf is somewhat of a black box, but I think it should be possible to do what you suggest. If not, I can add that CPPFLAG when |
Original comment by Filip Hajny (Bitbucket: mamash, GitHub: mamash). Yes, please add _EXTENSIONS_ to CPPFLAGS to fix build with Ruby 2.3 on any SunOS platform. procset_h is only defined on SunOS for legacy pre-XPG4v2 code or if SunOS extensions are requested. However, as of Ruby 2.3.0, the default CPPFLAGS set the standard to 200809L (via _XOPEN_SOURCE=700) unconditionally, so you need to go the other way around this. (Speaking for Joyent/SmartOS.) |
Original comment by Martin Carpenter (Bitbucket: mjcarpenter, GitHub: mjcarpenter). Hi, I've hit the same issue in other gems (eg unf_ext) so was wondering if perhaps this should be addressed upstream in ruby's Fumbling around with the macros very much like the OP I managed to build a SIGSEGV-happy ruby-pg (which is what brought me here); doubtless other folks will fumble this in other modules. Or is there some reason this isn't |
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged). I think you're right @MartinCarpenter, but I don't know enough about the OS in question to submit it upstream. I'd also like to make it possible to use I've looked around, but I couldn't find a definitive source for what I should be looking for in |
Original comment by Andrew Bennett (Bitbucket: potatosalad, GitHub: potatosalad). @ged Your patch works perfectly on SmartOS version For anyone else who needs to have this working temporarily until the fix has been released, you can use github.com/potatosalad/ruby-pg@smartos along with bundler: gem 'pg', github: 'potatosalad/ruby-pg', branch: 'smartos' |
Original comment by DANoWAR (Bitbucket: DANoWAR, GitHub: DANoWAR). Hello, this issue is still unsolved, at least on
Still have to
to make it work... After doing it this way, the gem pg doesn't show up when I type |
Original comment by Michael Granger (Bitbucket: ged, GitHub: ged). The fix isn't in a released version of the library yet. I thought I'd released it already, but I dropped the ball. I'll rectify that by Friday. As for |
Original comment by DANoWAR (Bitbucket: DANoWAR, GitHub: DANoWAR). I have installed the prerelease. When I want to install the dependencies of Redmine 3.3.0 via "bundle install", bundler still wants to download and compile pg 0.18.4. I haven't found the step to take to tell bundler to instead use the prerelease version. Can you help? EDIT: To whoever wants to know this after googling... I solved my problem by changing the application Gemfile. It required pg as "~>0.18.1". I had to change it to ">=" to allow 0.19 and to "0.18.1.beta" to allow the prerelease. |
Original report by kigster (Bitbucket: kigster, GitHub: kigster).
Issue
Unfortunately,
pg
gem currently fails to compile on SmartOS against ruby 2.3. It builds againstruby 2.2.4
.Solution
After digging through compile output and various Solaris build reports from other projects, trying million things to get it built, I was able to build it by doing the following:
ext
folder where previous build failed.Makefile
, and append-D__EXTENSIONS__
to theCPPFLAGS
field, resulting in this:After this modification, running
make
andmake install
completes installation of this gem.Details
I am deploying a Rails application, which is syntax-level dependent on ruby 2.3.0 on SmartOS (an open source descendant of the former Solaris OS https://smartos.org/), and I am running into a surprising compile issue.
This issue happens only when building with ruby 2.3.0, which I previous installed from the sources on the same OS using
rbenv
.When I use package-supplied ruby 2.2, the gem installs without any problem. Unfortunately, at this time Joyent does not offer ruby 2.3.0 package, which is why I resort to building it from sources. That said, it builds cleanly without any issues.
Here is what I know:
gem install pg -- --with-pg-config=/opt/local/bin/pg_config
.However, during another compilation attempt, different file triggered the same error:
So the error happens in the same place – it's unable to find the symbol
procset_t
.Now, I followed the include files starting from line 41 in
poll.h
, and that file includessys/procset.h
which does indeed define this symbol, but it's surrounded by two #defines:here is a complete header file
I did a quick search on these symbols, and found this helpful thread:
http://stackoverflow.com/questions/1034587/how-does-xpg4-2-and-other-defines-work-on-solaris
Basically, they are saying that Solaris has an interesting way of including various features into
the compiled binary, which are controlled by
-D
flags. The above discussion recommends adding the following defines:-D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1
I looked at the Makefile, and noticed that it already sets
D_XOPEN_SOURCE=700
, so I spent good amount of time trying to add the second flag-D_XOPEN_SOURCE_EXTENDED=1
, to no avail. Now I was getting a very interesting message:At this point I understood that I am fighting with Solaris features/compiled combination pairings, or something along those lines, and so I went back to the failing header file, and there was only one more flag to try:
-D__EXTENSIONS__
I thought that the
-D_XOPEN_SOURCE_EXTENDED=1
is, perhaps, responsible for setting__EXTENSIONS__
, but as it turns out – no, it's not. And so I went ahead and just added the-D__EXTENSIONS__
to the CPPFLAGS and ran make, everything compiled without a single warning:Now, this is obviously a workaround, so I am hoping that someone figures out what is going on.
I will say one thing:
Feature Request
I found it very frustrating that there could be no way, other than manually modifying Makefile, to play with various options on the
gem
command line. I really wanted to do something like this:CPPFLAGS="-D__EXTENSION__" gem install pg
OR
gem install pg -- --cppflags=-D__EXTENSIONS__
etc. I think it would be really nice to give users of the gem ways to supply various compile options without having to go and find the sources. Make it only available to power users, put it in the advanced README hidden inside a Makefile (LOL), but leave it there so that it's possible.
Thank you very much for building and maintaining this lovely gem.
Using it and PostgreSQL since 2004.
Konstantin
https://github.com/kigster
The text was updated successfully, but these errors were encountered: