2024-11-22 04:51 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000203mercuryBugpublic2013-03-18 15:23
Reporterjuliensf 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000203: Problem with DESTDIR and Darwin
DescriptionReported by Jeremy Huddleston (jeremyhu@macports.org) on mercury-bugs:

--------

And one more bug to report...
                                                                                                                                                                                                             
mercury-11.01 fails to make install the first time.
                                                                                                                                                                                                             
This looks like some bad logic for making boehm_gc a second time during the make install.
                                                                                                                                                                                                             
cp ./libatomic_ops-install/lib/libatomic_ops.a gc.a
cp: ./libatomic_ops-install/lib/libatomic_ops.a: No such file or directory
gmake[3]: *** [gc.a] Error 1
gmake[3]: Leaving directory
`/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/mercury-11.01/install_grade_dir.hlc.gc/boehm_gc'
gmake[2]: *** [submake] Error 2
gmake[2]: Leaving directory
`/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/mercury-11.01/install_grade_dir.hlc.gc/boehm_gc'
To clean up from failed install, remove
/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/mercury-11.01/install_grade_dir.hlc.gc
gmake[1]: *** [install_grades] Error 1
gmake[1]: Leaving directory `/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/mercury-11.01'
make: *** [install] Error 2
make: Leaving directory `/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/mercury-11.01'
shell command " cd "/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/mercury-11.01" && /usr/bin/make -w install
DESTDIR=/opt/local/var/macports/build/_Volumes_Home_jeremy_src_macports_trunk_dports_lang_mercury/mercury/work/destroot " returned error 2
                                                                                                                                                                                                             
Here's the full log, but I'm just doing a fairly standard ./configure && make && make install DESTDIR=/path/to/stage
TagsNo tags attached.
Attached Files
  • gz file icon main.log.gz (131,988 bytes) 2011-07-11 14:24
  • patch file icon 0001-Fix-for-bug-203-DESTDIR-brokes-installation.patch (2,036 bytes) 2012-07-06 07:22 -
    From f5c3f2eadb221bd32b7224c3a7a4a72c016b1bad Mon Sep 17 00:00:00 2001
    From: Nikolay Orlyuk <virkony@gmail.com>
    Date: Thu, 5 Jul 2012 23:01:16 +0300
    Subject: [PATCH] Fix for bug 203 - DESTDIR brokes installation
    
    See http://bugs.mercury.csse.unimelb.edu.au/view.php?id=203
    Stripped DESTDIR when building boehm_gc/libatomic_ops
    Added DESTDIR to default values in scripts/mmc
    ---
     boehm_gc/build_atomic_ops.sh        |    2 +-
     boehm_gc/build_atomic_ops.sh.cygwin |    2 +-
     scripts/mmc.in                      |    4 ++--
     3 files changed, 4 insertions(+), 4 deletions(-)
    
    diff --git a/boehm_gc/build_atomic_ops.sh b/boehm_gc/build_atomic_ops.sh
    index faf19d0..638190b 100755
    --- a/boehm_gc/build_atomic_ops.sh
    +++ b/boehm_gc/build_atomic_ops.sh
    @@ -3,4 +3,4 @@ P=`pwd`/libatomic_ops-install
     cd libatomic_ops
     # Mercury-specific: allow additional arguments.
     ./configure --prefix=$P "$@"
    -$MAKE CC="$CC" install
    +$MAKE CC="$CC" DESTDIR= install
    diff --git a/boehm_gc/build_atomic_ops.sh.cygwin b/boehm_gc/build_atomic_ops.sh.cygwin
    index 158a3f3..d9b963f 100755
    --- a/boehm_gc/build_atomic_ops.sh.cygwin
    +++ b/boehm_gc/build_atomic_ops.sh.cygwin
    @@ -8,7 +8,7 @@ Q=`mktemp -d`
     ln -s "$P" $Q/dir
     cd $Q/dir/libatomic_ops
     ./configure --prefix=$Q/dir/libatomic_ops-install
    -$MAKE CC="$CC" install
    +$MAKE CC="$CC" DESTDIR= install
     cd /
     rm $Q/dir
     rmdir $Q
    diff --git a/scripts/mmc.in b/scripts/mmc.in
    index 510e018..d9d0e8b 100644
    --- a/scripts/mmc.in
    +++ b/scripts/mmc.in
    @@ -14,8 +14,8 @@
     # MERCURY_COMPILER, MERCURY_C_COMPILER, MERCURY_DEFAULT_GRADE,
     # MERCURY_DEFAULT_OPT_LEVEL.
     
    -MERCURY_COMPILER=${MERCURY_COMPILER-'@PREFIX@/bin/mercury_compile'}
    -MERCURY_CONFIG_DIR=${MERCURY_CONFIG_DIR-${MERCURY_STDLIB_DIR-'@CONFIG_LIBDIR@'}}
    +MERCURY_COMPILER=${MERCURY_COMPILER-${DESTDIR}'@PREFIX@/bin/mercury_compile'}
    +MERCURY_CONFIG_DIR=${MERCURY_CONFIG_DIR-${DESTDIR}${MERCURY_STDLIB_DIR-'@CONFIG_LIBDIR@'}}
     export MERCURY_COMPILER MERCURY_CONFIG_DIR
     
     # Set the MACOSX_DEPLOYMENT_TARGET environment variable if needed.
    -- 
    1.7.10.4
    
    

-Relationships
+Relationships

-Notes

~0000337

jeremyhu (reporter)

Adding a note in hopes that it will add me to a CC list, since I don't see any CC UI (I'm not familiar with Mantis).

~0000340

pbone (administrator)

I can confirm this.

~0000341

pbone (administrator)

DESTDIR was only ever made to work when building Mercury for a single grade, that's all I needed when I implemented it. It _should_ work for builds with more than one grade but I never implemented that.

What this means is that this problem probably isn't Darwin specific, It also means that the solution is going to be more difficult since it's now about implementing an incomplete feature rather than fixing a bug.

Thanks.

~0000472

ony (reporter)

That 0001-Fix-for-bug-203-DESTDIR-brokes-installation.patch is based on rotd-2012-07-01

~0000475

pbone (administrator)

Thanks for the patch, I promise to look at it, but I don't have a lot of time at the moment.

~0000494

pbone (administrator)

Hi ony.

Before reviewing your patches I want to make check some things with your experience with this bug. I want to ask about how you're using DESTDIR:

Are you giving a value for DESTDIR during make install?

Are you using more than one grade? (how is configure invoked?).

Thanks.

~0000495

ony (reporter)

Configure was invoked as: ./configure --prefix=/usr --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --docdir=/usr/share/doc/mercury-12.08_beta20120813 --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --enable-fast-install --libdir=/usr/lib64 --disable-most-grades

Library grades was intended to be built: asm_fast.gc, asm_fast.gc.debug, asm_fast.gc.decldebug, hlc.gc

After succesful reaching "make -j9". There was invoked: make -j9 -j1 DESTDIR=/var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/image/ install

That caused:

/usr/bin/install -c -m 644 libatomic_ops.a '/var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/image//var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/work/mercury-compiler-12.08-beta-2012-08-13/install_grade_dir.asm_fast.gc.debug/boehm_gc/libatomic_ops-install/lib'

And as result:

cp ./libatomic_ops-install/lib/libatomic_ops.a gc.a
cp: cannot stat './libatomic_ops-install/lib/libatomic_ops.a': No such file or directory
make[3]: *** [gc.a] Error 1
make[3]: Leaving directory `/var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/work/mercury-compiler-12.08-beta-2012-08-13/install_grade_dir.asm_fast.gc.debug/boehm_gc'
make[2]: *** [submake] Error 2
make[2]: Leaving directory `/var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/work/mercury-compiler-12.08-beta-2012-08-13/install_grade_dir.asm_fast.gc.debug/boehm_gc'
To clean up from failed install, remove /var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/work/mercury-compiler-12.08-beta-2012-08-13/install_grade_dir.asm_fast.gc.debug
make[1]: *** [install_grades] Error 1
make[1]: Leaving directory `/var/tmp/paludis/build/dev-lang-mercury-12.08_beta20120813/work/mercury-compiler-12.08-beta-2012-08-13'
make: *** [install] Error 2

~0000500

wangp (developer)

I applied a patch based on ony's. Thanks.
+Notes

-Issue History
Date Modified Username Field Change
2011-07-11 14:22 juliensf New Issue
2011-07-11 14:24 juliensf File Added: main.log.gz
2011-07-12 02:54 jeremyhu Note Added: 0000337
2011-07-28 12:36 pbone Note Added: 0000340
2011-07-28 12:36 pbone Assigned To => pbone
2011-07-28 12:36 pbone Reproducibility have not tried => always
2011-07-28 12:36 pbone Status new => assigned
2011-07-28 13:01 pbone Note Added: 0000341
2012-07-06 07:22 ony File Added: 0001-Fix-for-bug-203-DESTDIR-brokes-installation.patch
2012-07-06 07:24 ony Note Added: 0000472
2012-07-08 11:01 pbone Note Added: 0000475
2013-01-09 00:25 pbone Note Added: 0000494
2013-01-09 04:17 ony Note Added: 0000495
2013-03-18 15:23 wangp Note Added: 0000500
2013-03-18 15:23 wangp Status assigned => resolved
2013-03-18 15:23 wangp Resolution open => fixed
2013-03-18 15:23 wangp Assigned To pbone => wangp
+Issue History