Bug 100555 - [patch] bsd.port.mk - DESTDIR support
Summary: [patch] bsd.port.mk - DESTDIR support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-19 17:20 UTC by Gabor Kovesdan
Modified: 2006-08-14 14:24 UTC (History)
1 user (show)

See Also:


Attachments
destdir_mk.diff (44.70 KB, patch)
2006-07-19 17:20 UTC, Gabor Kovesdan
no flags Details | Diff
file.diff (3.35 KB, patch)
2006-07-19 17:20 UTC, Gabor Kovesdan
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kovesdan freebsd_committer freebsd_triage 2006-07-19 17:20:14 UTC
The attached patches implement DESTDIR support in the ports infrastructure, which can be
used to install ports into separate jail environments.  Besides, some ports need a slight
modification to work with DESTDIR.  I did a lot of effort so that individual ports
need the least modification, but I had to change the behaviour of LOCALBASE, LINUXBASE,
X11BASE a bit.  They contain DESTDIR in itself, thus we can just leave lines like
BUILD_DEPENDS= ${LOCALBASE}/bin/foo:${PORTSDIR}/misc/foo alone.  I introduced
LOCALBASE_REL, LINUXBASE_REL and X11BASE_REL for the old functionality.  Note, that
LOCALBASE, LINUXBASE and X11BASE are still overrideable with my workaround, so this change
doesn't break compatibility!  Simpler ports like net/csup already work with this
implementation, but e.g. shells/bash needs just a little bit of modification.

This PR supersedes ports/28155.

Sponsored by: Google Summer of Code 2006
Reviewed by: erwin
Wiki: http://wikitest.freebsd.org/DESTDIR
See also: http://perforce.freebsd.org/depotTreeBrowser.cgi?FSPC=//depot/projects/soc2006/gabor%5fdocs/porters%2dhandbook&HIDEDEL=NO
	(I wrote some sentences for porters-handbook, how one can write DESTDIR-respective ports)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-07-19 17:20:37 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk is port manager territory
Comment 2 Erwin Lansing freebsd_committer freebsd_triage 2006-07-19 18:19:17 UTC
State Changed
From-To: open->analyzed

Currently running on pointyhat in 6-exp.
Comment 3 Gabor Kovesdan freebsd_committer freebsd_triage 2006-07-24 15:04:46 UTC
Updated patches:

http://gabor.t-hosting.hu/patches/destdir_mk_4.diff
http://gabor.t-hosting.hu/patches/destdir_tools.diff

-- 
Cheers,

Gabor
Comment 5 Gabor Kovesdan freebsd_committer freebsd_triage 2006-08-03 10:47:35 UTC
Incremental patch for ports with some additional fixes:

http://gabor.t-hosting.hu/patches/destdir_ports_2_b.diff

-- 
Cheers,

Gabor
Comment 6 Gabor Kovesdan freebsd_committer freebsd_triage 2006-08-04 10:48:15 UTC
Another fix for two ports:

http://gabor.t-hosting.hu/patches/destdir_ports_2_c.diff

-- 
Cheers,

Gabor
Comment 7 Michael Nottebrock freebsd_committer freebsd_triage 2006-08-07 21:58:27 UTC
The part of this PR that recently got committed to bsd.port.mk seems to
cause breakage with KDE ports on pointyhat, see
http://pointyhat.freebsd.org/errorlogs/i386-errorlogs/e.4.2006071303/kdelibs-nocups-3.5.3.log
for an example.

I get the same error ("cp: /var/db/pkg/<portname>/+MTREE_DIRS: No such
file or directory") on our own small

build cluster, which runs a fork of the pointyhat scripts. Reverting bsd.port.mk to the
previous revision got rid of the problem there. I'm not really sure whether KDE is actually the common
thing for these errors - I've seen them myself for qt and arts, the pointyhat error is for kdehier - none
of these three ports has much in common, kdehier doesn't even include bsd.kde.mk (although the failure
on pointyhat as seen in the log above happens during the kdelibs build, which does).


Please take a look at this as soon as possible.
Comment 8 Michael Nottebrock freebsd_committer freebsd_triage 2006-08-07 22:22:32 UTC
Update:

I found the trigger for the bug: FORCE_PKG_REGISTER.

kdelibs fails on pointyhat because it depends on kdehier via the old
DEPENDS mechanism, which sets this flag.
The failures I've been seeing on the KDE cluster happen because our
custom automatic plist building script sets it as well.

You can easily reproduce this with any port though via make
-DFORCE_PKG_REGISTER package.
Comment 9 Gabor Kovesdan freebsd_committer freebsd_triage 2006-08-07 22:56:04 UTC
Michael Nottebrock wrote:
> Update:
>
> I found the trigger for the bug: FORCE_PKG_REGISTER.
>
> kdelibs fails on pointyhat because it depends on kdehier via the old
> DEPENDS mechanism, which sets this flag.
> The failures I've been seeing on the KDE cluster happen because our
> custom automatic plist building script sets it as well.
>
> You can easily reproduce this with any port though via make
> -DFORCE_PKG_REGISTER package.
>   
Thanks, I'm already working on the issue, the dependencies of kdelibs3 
are just being built on my test machine, but this observation might help 
a lot.

-- 
Cheers,

Gabor
Comment 10 Michael Nottebrock freebsd_committer freebsd_triage 2006-08-07 23:10:15 UTC
G=E1bor K=F6vesd=E1n schrieb:
> Michael Nottebrock wrote:
>>
>> You can easily reproduce this with any port though via make
>> -DFORCE_PKG_REGISTER package.
>>  =20
> Thanks, I'm already working on the issue, the dependencies of kdelibs3
> are just being built on my test machine, but this observation might
> help a lot.
It's actually a little more tricky to reproduce than just doing make
-DFORCE_PKG_REGISTER package, but I found this sequence to be readily
reproducable:

cd /usr/ports/audio/yell
make package                                                    # succeed=
s
make clean
make package                                                    # fails,
already installed
make -DFORCE_PKG_REGISTER  package   # fails, with the error as seen on
pointyhat
make deinstall clean

(redo from start)
Comment 11 Gabor Kovesdan freebsd_committer freebsd_triage 2006-08-07 23:49:41 UTC
Michael Nottebrock wrote:
> Gábor Kövesdán schrieb:
>   
>> Michael Nottebrock wrote:
>>     
>>> You can easily reproduce this with any port though via make
>>> -DFORCE_PKG_REGISTER package.
>>>   
>>>       
>> Thanks, I'm already working on the issue, the dependencies of kdelibs3
>> are just being built on my test machine, but this observation might
>> help a lot.
>>     
> It's actually a little more tricky to reproduce than just doing make
> -DFORCE_PKG_REGISTER package, but I found this sequence to be readily
> reproducable:
>
> cd /usr/ports/audio/yell
> make package                                                    # succeeds
> make clean
> make package                                                    # fails,
> already installed
> make -DFORCE_PKG_REGISTER  package   # fails, with the error as seen on
> pointyhat
> make deinstall clean
>
> (redo from start)
>
>   
This patch seems to fix it:
http://gabor.t-hosting.hu/patches/destdir_package.diff

Could you confirm it? Unfortunately, I don't have too much resource to 
test kdelibs3, the dependencies are still being built. Anyway, I dont' 
actually know yet why this ${RM} invocation was necessary and why this 
worked before.

-- 
Cheers,

Gabor
Comment 12 Gabor Kovesdan freebsd_committer freebsd_triage 2006-08-08 12:16:16 UTC
Here's the fix: http://gabor.t-hosting.hu/patches/destdir_fix.diff

- s/${DESTDIR}${PREFIX}/${TARGETDIR}/
- Fix FORCE_PKG_REGISTER issues [1]
- Make USE_RCORDER respect DESTDIR [2]
- Make ldconfig stuff respect DESTDIR


Reported by:   lofi [1]
Submitted by: sem [2]

-- 
Cheers,

Gabor
Comment 13 Erwin Lansing freebsd_committer freebsd_triage 2006-08-14 14:24:38 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!