Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#8456 - Pacman fails to build on os x.

Attached to Project: Pacman
Opened by eliott (cactus) - Tuesday, 30 October 2007, 03:30 GMT
Last edited by Dan McGee (toofishes) - Friday, 06 June 2008, 04:46 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version 3.0.6
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

Trying to build pacman on os x.


Steps to Reproduce:

Get an os X system (ha).
Install macports.
Install autoconf, automake, libarchive.

Currently using Dan's freebsd branch.

git clone http://code.toofishes.net/gitprojects/pacman.git
cd pacman.git
git checkout -b bsd origin/freebsd
./autogen.sh
Edit lib/libalpm/handle.c
- realroot = realpath(root, NULL);
+ realroot = strdup(root);
/configure --enable-debug --disable-nls LDFLAGS='-L/opt/local/lib -L/usr/lib -L/usr/libexec' CFLAGS='-I/opt/local/include -I/usr/include'

Attached output of configure, as well as make.



This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 06 June 2008, 04:46 GMT
Reason for closing:  Fixed
Additional comments about closing:  Original bug report has been fixed
Comment by Dan McGee (toofishes) - Tuesday, 30 October 2007, 04:56 GMT
This should be resolved with this commit: "When printing size_t, use %zd".

Leaving the bug open for future issues, such as possible problems in "make check" and pactest usage.
Comment by eliott (cactus) - Thursday, 01 November 2007, 07:19 GMT
After some assistance from Dan, and using the freebsd branch, pacman builds on os x now.
However, due to the lack of fakeroot (not even in macports), I can't run any of the pactests.

Oddly, when I do 'pacman --help', I get the following output..

$ cd /Users/eliott/Projects/pacman/pacman/
$ ./src/pacman/pacman --help
usage: /Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman <operation> [...]
options:
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-h --help}
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-V --version}
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-A --add} [options] <file>
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-F --freshen} [options] <file>
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-Q --query} [options] [package]
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-R --remove} [options] <package>
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-S --sync} [options] [package]
/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman {-U --upgrade} [options] <file>

use '/Users/eliott/Projects/pacman/pacman/src/pacman/.libs/pacman --help' with other options for more syntax

Any idea why it is including the full path to the .libs/pacman binary?
Comment by Dan McGee (toofishes) - Thursday, 01 November 2007, 12:04 GMT
You haven't coded C much, have you? :)

That is what removing those basename calls does for you. Try the latest code off my freebsd branch.
Comment by eliott (cactus) - Thursday, 01 November 2007, 17:32 GMT
It has been a long time since I have coded C.
I am thinking...mmmm... 8 years maybe?
Even then, I didn't do a huge amount of it.

Thanks for the lesson though Dan. ;)
Comment by Aaron Griffin (phrakture) - Thursday, 01 November 2007, 19:50 GMT
It's because of the OSX /Capitalized/Directories/And/Things I'm sure!
Comment by Dan McGee (toofishes) - Friday, 02 November 2007, 00:48 GMT
If you get a chance, can you fetch my freebsd branch tonight and try building on both OS X and FreeBSD? Note that the only difference between that and my working branch is the libdownload->libfetch changes, everything else has been worked into the real build so all systems are compatible. You may need to use the --disable-pacman-static flag to ./configure on one or both platforms (we know building static pacman fails on FreeBSD because of missing static libraries, I believe).
Comment by eliott (cactus) - Saturday, 03 November 2007, 19:17 GMT
./configure --disable-pacman-static --disable-nls LDFLAGS='-L/opt/local/lib -L/usr/lib -L/usr/libexec' CFLAGS='-I/opt/local/include -I/usr/include'

The above seems to work on OS X (tiger).
Without fakeroot though, pactests can't be run. :(
Comment by Dan McGee (toofishes) - Sunday, 04 November 2007, 20:47 GMT
OK, so next steps appear to be enabling NLS and seeing if we can get that to work. I think it fails on symbol resolution, which is kind of weird because I am sure other packages build with gettext enabled. We might have to look into how those work and how their build systems set everything up.
Comment by eliott (cactus) - Monday, 05 November 2007, 01:15 GMT
word.
I got pactests running with sudo (after talking with dan), and got the test results.

--------------------------------------------------------------------------------
[FAIL] fileconflict001 Rules: OK = 0 FAIL = 3 SKIP = 0
Fileconflict with symlinks
[FAIL] fileconflict002 Rules: OK = 0 FAIL = 3 SKIP = 0
Fileconflict with symlinks (2)
[FAIL] sync044 Rules: OK = 4 FAIL = 1 SKIP = 0
A dependency induces a replacement
[FAIL] sync1003 Rules: OK = 0 FAIL = 2 SKIP = 0
Induced removal would break dependency
[FAIL] sync1004 Rules: OK = 0 FAIL = 2 SKIP = 0
Induced removal would break dependency (2)
[FAIL] sync403 Rules: OK = 1 FAIL = 3 SKIP = 0
Choice between two providers (2)
[FAIL] upgrade051 Rules: OK = 0 FAIL = 3 SKIP = 0
Upgrade to a package that provides another package
--------------------------------------------------------------------------------
TOTAL = 138
PASS = 131 ( 94.93%)
FAIL = 7 ( 5.07%)


Apparently this is pretty inline with the arch test results.

That was being built with nls disabled, as dan mentioned.
Comment by Xilon (Xilon) - Monday, 14 April 2008, 13:44 GMT
I went a bit further (the warnings were ignored) and failed with a message about undefined symbols but somehow I can't get there anymore. Anyway I tried compiling it fails at a warning, for whatever reason. Logs are attached. I'll keep trying and see what I can come up with.
Comment by eliott (cactus) - Monday, 14 April 2008, 15:54 GMT
I don't know what you mean by 'went a bit further'.
I got it to compile just fine with the config standa I noted on nov 3rd.
Not having fakeroot sucks though.
fakeroot-ng might work, but I haven't tried it yet (still seems pretty newish).
Comment by Xilon (Xilon) - Monday, 14 April 2008, 16:01 GMT
By "went a bit further" I meant that it ignored the warnings and kept compiling. It errored out when trying to compile add.c, iirc, because some gettext related symbols were undefined. Somehow it errors out straight away now though. I'll try changing LDFLAGS and CFLAGS and see how that goes.
Did you use MacPorts or something to install the libraries?
Comment by Xilon (Xilon) - Monday, 14 April 2008, 16:31 GMT
Ok, I get undefined symbols again. I configured with:
./configure --prefix=/usr/local LDFLAGS='-L/usr/local/lib -L/usr/lib -L/usr/libexec' CFLAGS='-I/usr/local/include -I/usr/include'

I don't have anything in /opt and I installed gettext to /usr/local. I'm not sure why it's not picking it up (I think that's the problem). It might be something to do with how I installed libfetch or libarchive though. I installed gettext after libarchive.

This is Leopard (10.5) btw.
   make.log (41.7 KiB)
Comment by eliott (cactus) - Monday, 14 April 2008, 17:12 GMT
I think I do recall using macports to install some stuff..which makes sense when I see my use of 'opt' in the flags.
It was a while ago though, so I don't fully remember what I did with it.
Comment by Dan McGee (toofishes) - Monday, 14 April 2008, 19:46 GMT
I've seen problems with gettext on Cygwin as well, so I'm thinking we have some libtool issues with it and we don't have stuff set up all right. This should be fixable (maybe playing with the stuff in lib/libalpm/Makefile.am?).
Comment by Dan McGee (toofishes) - Tuesday, 15 April 2008, 01:41 GMT
Think I got this fixed. Try this patch against whatever source you are working from (it will apply to maint or master and probably any tarball since v3.1.0).
Comment by Dan McGee (toofishes) - Tuesday, 15 April 2008, 02:00 GMT
Updated from above- you should no longer need the '--disable-pacman-static' option anymore if you use this version of the patch. Let me know how it works out. This is getting a lot cleaner for building on other platforms- I'm down to './configure --enable-debug --disable-doc --disable-internal-download' on Cygwin now (and the only real required flag is disabling the internal downloader).
Comment by Xilon (Xilon) - Tuesday, 15 April 2008, 05:42 GMT
That worked. There's still a problem though, possibly two. The compilation appears to complete successfully, but it fails to build the doc target:
---
Making all in doc
make[2]: *** No rule to make target `pacman.8', needed by `all-am'. Stop.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
---

The second problem appears to be with enabling debugging. This seems to be why I couldn't compile in my first comment here.
---
gcc -std=gnu99 -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I../.. -pedantic -D_GNU_SOURCE -fvisibility=internal -I/usr/local/include -I/usr/include -fstack-protector-all -Wall -Werror -MT add.lo -MD -MP -MF .deps/add.Tpo -c add.c -fno-common -DPIC -o .libs/add.o
cc1: warnings being treated as errors
add.c: In function '_alpm_add_loadtarget':
add.c:114: warning: internal and protected visibility attributes not supported in this configuration; ignored
make[3]: *** [add.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
---

libalpm is compiled though, so that's awesome :)
Comment by Dan McGee (toofishes) - Tuesday, 15 April 2008, 12:58 GMT
You didn't tell it to build the doc target. Use either --disable-doc or --enable-asciidoc.

Your line number is absolutely worthless to me- I have no clue what revision or anything you are building, or what you even mean by "enabling debugging".
Comment by Xilon (Xilon) - Tuesday, 15 April 2008, 13:30 GMT
Sorry, let me revise that.
I am using your freebsd branch with the latest HEAD. By "enabling debugging" I mean using the --enable-debug switch for ./configure, ie.:
./configure --enable-debug
Without this switch compilation succeeds, but as soon as I enable debugging it errors out on that warning. There are many occurrences of that warning, as seen in a previously attatched make.log.

As for the doc target, if I use --enable-asciidoc I get the same error. Of course if I use --disable-doc it finishes compiling successfully.
Comment by eliott (cactus) - Sunday, 20 April 2008, 19:00 GMT
With the latest master branch (thanks Dan), and hand editing src/pacman/Makefile after autogen and configure, I got pacman to compile and link statically and dynamically on a FreeBSD 7.x box.

[eliott@freebsdbox /]$ uname -sr; pacman.static -V; pacman -V
FreeBSD 7.0-RELEASE

.--. Pacman v3.2.0devel - libalpm v2.3.1
/ _.-' .-. .-. .-. Copyright (C) 2002-2008 Judd Vinet
\ '-. '-' '-' '-'
'--'
This program may be freely redistributed under
the terms of the GNU General Public License


.--. Pacman v3.2.0devel - libalpm v2.3.1
/ _.-' .-. .-. .-. Copyright (C) 2002-2008 Judd Vinet
\ '-. '-' '-' '-'
'--'
This program may be freely redistributed under
the terms of the GNU General Public License

Loading...