DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th May 2014
moisespedro moisespedro is offline
Port Guard
 
Join Date: May 2014
Posts: 15
Default [SOLVED] What am I doing wrong? (multiple compilation errors)

Hi, I am on a fresh 5.5 install fully patched and I got to be doing something wrong because I just can't use ports on a reliable way. It always fail at some package.

I was trying to install Firefox as my first package and, while installing db the post-install process failed because of a "file not found" error. Ok, got to be something wrong with the port itself, lets install the binary. Then it goes to another package (I forgot, I am sorry and by the way where can I find the compilation logs?) and it fails because the system run out of my virtual memory. During llvm compilation basically the same error ('unable to allocate memory"). All of the errors I "fixed" by installing the binary package. And now, finally, on Firefox I get this:

Code:
-Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -std=gnu++0x -fdeprecated-macro -ferror-limit 19 -fmessage-length 106 -pthread -stack-protector 1 -mstackrealign -fno-rtti -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fdiagnostics-show-option -backend-option -vectorize-loops -o nsGlobalWindow.o -x c++ /usr/ports/pobj/firefox-26.0/mozilla-release/dom/base/nsGlobalWindow.cpp 
1.      <eof> parser at end of file
2.      Code generation
clang-3.3: error: unable to execute command: Segmentation fault (core dumped)
clang-3.3: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.3 (tags/RELEASE_33/final)
Target: amd64-unknown-openbsd5.5
Thread model: posix
clang-3.3: note: diagnostic msg: PLEASE submit a bug report to  and include the crash backtrace, preprocessed source, and associated run script.
clang-3.3: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.3: note: diagnostic msg: /tmp/nsGlobalWindow-2io4Oj.cpp
clang-3.3: note: diagnostic msg: /tmp/nsGlobalWindow-2io4Oj.sh
clang-3.3: note: diagnostic msg: 

********************
/usr/ports/pobj/firefox-26.0/mozilla-release/config/rules.mk:1129: recipe for target 'nsGlobalWindow.o' failed
gmake[4]: *** [nsGlobalWindow.o] Error 254
gmake[4]: Leaving directory '/usr/ports/pobj/firefox-26.0/build-amd64/dom/base'
/usr/ports/pobj/firefox-26.0/mozilla-release/config/recurse.mk:44: recipe for target 'base_compile' failed
gmake[3]: *** [base_compile] Error 2
gmake[3]: Leaving directory '/usr/ports/pobj/firefox-26.0/build-amd64/dom'
/usr/ports/pobj/firefox-26.0/mozilla-release/config/recurse.mk:44: recipe for target 'compile' failed
gmake[2]: *** [compile] Error 2
gmake[2]: Leaving directory '/usr/ports/pobj/firefox-26.0/build-amd64/dom'
/usr/ports/pobj/firefox-26.0/mozilla-release/config/recurse.mk:16: recipe for target 'compile' failed
gmake[1]: *** [compile] Error 2
gmake[1]: Leaving directory '/usr/ports/pobj/firefox-26.0/build-amd64'
/usr/ports/pobj/firefox-26.0/mozilla-release/config/rules.mk:694: recipe for target 'all' failed
gmake: *** [all] Error 2
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2673 '/usr/ports/pobj/firefox-26.0/build-amd64/.build_done')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:1874 '/usr/ports/packages/amd64/all/firefox-2
I grabbed my ports tree following, exactly, the instructions here

Steps I've done:

$ cd /tmp
$ ftp http://ftp.openbsd.org/pub/OpenBSD/5.5/ports.tar.gz
$ ftp http://ftp.openbsd.org/pub/OpenBSD/5.5/SHA256.sig
$ signify -C -p /etc/signify/openbsd-55-base.pub -x SHA256.sig ports.tar.gz
$ cd /usr
$ sudo tar xzf /tmp/ports.tar.gz

Last edited by moisespedro; 18th May 2014 at 02:38 PM. Reason: Including steps
Reply With Quote
  #2   (View Single Post)  
Old 18th May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Hi again.

From the fragment you've posted, all we are able to see is that the compiler clang has failed with a segmentation fault while compiling firefox. I certainly don't have enough information from this fragment to tell you why.

To install firefox on your amd64 -release system, you need only:
Code:
# export PKG_PATH=http://<your.nearest.mirror>/pub/OpenBSD/5.5/packages/amd64/
# pkg_add firefox
If the pkg_add fails, a console log from that would be very helpful.

To create a console log, use script(1). The saved file can be filtered through col(1) with the -b option, then edited for copy/paste here.
Code:
$ script
Script started, output file is typescript
$ <command>
$ <command>
$ <command>
$ exit
Script done, output file is typescript
$ col -b < typescript > my.log
There are only two reasons a -release or -stable user needs to create a package from its port:
  1. The package is unavailable from the project, either due to a licensing issue or an unusual $FLAVOR was not packaged
  2. A -stable port was developed but the project does not have a package for it.
Packages you build from ports are operationally identical to the packages the project makes available. There is no advantage to building from ports yourself. See FAQ 15.4.6.

Last edited by jggimi; 18th May 2014 at 12:35 PM. Reason: clarity, typo
Reply With Quote
  #3   (View Single Post)  
Old 18th May 2014
moisespedro moisespedro is offline
Port Guard
 
Join Date: May 2014
Posts: 15
Default

pkg_add works fine but well I am a former Gentoo user, I like to compile stuff from source. Even knowing the binary packages works fine it is a problem that still bothers me, don't the errors I am getting (unable to allocate memory, out of virtual memory) means there is something wrong with my system?
Reply With Quote
  #4   (View Single Post)  
Old 18th May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

There's nothing wrong with your system. You're attempting to compile one of the larger ports, and I'll guess that you're doing so as a user with limited resources. Let's examine your /etc/login.conf file.

For amd64, the default class has:
Code:
default:\
    :path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin /usr/local/sbin:\
    :umask=022:\
    :datasize-max=512M:\
    :datasize-cur=512M:\
    :maxproc-max=256:\
    :maxproc-cur=128:\
    :openfiles-cur=512:\
    :stacksize-cur=4M:\
    :localcipher=blowfish,6:\
    :ypcipher=old:\
    :tc=auth-defaults:\
    :tc=auth-ftp-defaults:
The staff class has:
Code:
staff:\
    :datasize-cur=512M:\
    :datasize-max=infinity:\
    :maxproc-max=512:\
    :maxproc-cur=128:\
    :ignorenologin:\
    :requirehome@:\
    :tc=default:
There is also a daemon class.

Check your userid's class and your shell's ulimit -a (for bourne-based shells) or limit (for C-based shells).

Last edited by jggimi; 18th May 2014 at 01:34 PM. Reason: typo, clarity
Reply With Quote
  #5   (View Single Post)  
Old 18th May 2014
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Quote:
Originally Posted by moisespedro View Post
pkg_add works fine but well I am a former Gentoo user, I like to compile stuff from source. Even knowing the binary packages works fine it is a problem that still bothers me, don't the errors I am getting (unable to allocate memory, out of virtual memory) means there is something wrong with my system?
While you're free to waste your own time building ports on a release (http://funroll-loops.info/), this one is simple:

Code:
$ ulimit -d
524288
$ ulimit -d 1048576
$ cd /usr/ports/www/mozilla-firefox && make install-all
You can keep raising it until you find what works for you.

I like this better than messing with /etc/login.conf because you'll only raise limits if and when you need them, and it's impossible to make any subtle mistakes in that file.

The relevant man page here is ksh(1) and grep for ulimit. I'd highly suggest you learn it first on the default shell before moving on to other shells.
Reply With Quote
  #6   (View Single Post)  
Old 18th May 2014
moisespedro moisespedro is offline
Port Guard
 
Join Date: May 2014
Posts: 15
Default

I am part of the staff class and I was running the port as root with sudo (even root is limited?) And what exactly does "cur" size stands for? English is not my native language and I am failing to grasp its meaning. Well, I think it would be better to stick to binary packages then.
Reply With Quote
  #7   (View Single Post)  
Old 18th May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by ibara View Post
I like this better than messing with /etc/login.conf ...
My apologies if my advice appeared to suggest editing the file. I was attempting to suggest the use of the proper class selection and ulimit setting.
Reply With Quote
  #8   (View Single Post)  
Old 18th May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by moisespedro View Post
And what exactly does "cur" size stands for?
cur = current.

You can adjust the current limitation in your shell, up to the maximum of the class, as shown in ibara's example.
Reply With Quote
  #9   (View Single Post)  
Old 18th May 2014
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

login.conf(5)
But really, it's better to do it via your shell.

Of course root is/can be limited. I also think your understanding of sudo is limited...

Sticking to binaries packages is overwhelmingly recommended on releases. There's no difference between what you get from the default ports build and packages and attempts to "tweak" ports will garner you no help. And people will probably laugh at you when you don't understand why something is broken.

TL;DR: We do all the hard work for you for a reason. Hard work is hard and the vast majority of people don't understand it sufficiently.
Reply With Quote
Old 18th May 2014
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Quote:
Originally Posted by jggimi View Post
My apologies if my advice appeared to suggest editing the file. I was attempting to suggest the use of the proper class selection and ulimit setting.
Ah, no worries. It did come across like that but I see what you were getting at now.
Reply With Quote
Old 18th May 2014
moisespedro moisespedro is offline
Port Guard
 
Join Date: May 2014
Posts: 15
Default

Oh, so sudo works like a non-login shell (I.know it is not a exact comparation but I don't know how to word that better)? And from now I will stick to binary packages
Reply With Quote
Old 18th May 2014
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

This is the last time I'm going to do this. You're running OpenBSD, you have the man(1) command. Use it:
sudo(8)

Last edited by ibara; 18th May 2014 at 02:44 PM. Reason: sudo is in section 8
Reply With Quote
Old 18th May 2014
moisespedro moisespedro is offline
Port Guard
 
Join Date: May 2014
Posts: 15
Default

Thanks and sorry man. I will mark the thread as solved.
Reply With Quote
Old 18th May 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by moisespedro View Post
pkg_add works fine but well I am a former Gentoo user, I like to compile stuff from source. Even knowing the binary packages works fine it is a problem that still bothers me...
While others have addressed most of the most probable issues (login.conf(5)), compiling as root is highly frowned upon. One may be able to successfully navigate builds like this for awhile, but at some point, errors can & will be made.

Section 15.3.3 discusses the general rule of ports tree preparation such that ports can be compiled as a regular user. I will even add that setting the SUDO variable to the following in mk.conf(5):

Code:
SUDO=/usr/bin/sudo -E
...is a worthy modification to the information found in the FAQ. Source:

http://marc.info/?l=openbsd-ports&m=139418997803709&w=2

...but to reiterate, unless there is a specific reason to do so, -release users have few reasons to compile from the ports tree. Use packages instead.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
why would such a compilation error occur ? daemonfowl OpenBSD Packages and Ports 3 26th October 2013 09:54 PM
[Link] Distributed compilation on NetBSD s0xxx NetBSD General 1 19th August 2011 09:03 PM
can some one tell me what's wrong with this picture? qmemo Off-Topic 19 17th March 2011 10:26 PM
Kernel Compilation --> Error code 2 --> geom_part_pc98 (FreeBSD 7.0) stou FreeBSD Installation and Upgrading 15 11th October 2008 04:43 AM
link: `libtheora_la-common.lo' is not a valid libtool object error during compilation pax FreeBSD Ports and Packages 2 29th July 2008 11:30 AM


All times are GMT. The time now is 02:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick