Opened 14 years ago

Closed 14 years ago

#29050 closed defect (fixed)

groff universal variant fails

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: universal Cc: drkp (Dan Ports), sobucni@…, daitakahashi, arnaud.antkowiak@…, bayonne, siavashsf@…, fracai, rmstonecipher@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: groff

Description

groff 1.21's universal variant fails:

gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags

groff 1.20.1's universal variant did not have this problem.

Attachments (3)

main.log (31.0 KB) - added by ryandesign (Ryan Carsten Schmidt) 14 years ago.
Portfile.diff (461 bytes) - added by daitakahashi 14 years ago.
This is quick hack, but it seems to work.
Portfile.2.diff (1.2 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 14 years ago.

Download all attachments as: .zip

Change History (23)

Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log added

comment:1 Changed 14 years ago by drkp (Dan Ports)

Cc: dports@… added

Cc Me!

comment:2 Changed 14 years ago by sobucni@…

Cc: sobucni@… added

Cc Me!

comment:3 Changed 14 years ago by daitakahashi

Cc: dtakahashi42@… added

Cc Me!

comment:4 Changed 14 years ago by arnaud.antkowiak@…

Cc: arnaud.antkowiak@… added

Cc Me!

comment:5 Changed 14 years ago by drkp (Dan Ports)

Looks like it's trying to do dependency tracking (gcc -M) and can't with multiple arch flags. I feel like we must have dealt with this before, but the only references I can find are to automake programs that support --disable-dependency-tracking, which this does not.

comment:6 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

I'm not familiar enough with gcc to know what "gcc -M" is about and whether there is an alternative we could use. One could compare the 0.20.1 source with the 0.21 source to see what changes were made that caused this, and if they can be reversed. Or we could see if using the muniversal portgroup is a viable option for groff.

comment:7 Changed 14 years ago by drkp (Dan Ports)

I just tried muniversal, actually. It failed with:

Error: Target org.macports.destroot returned: /opt/local/share/doc/groff-1.21/pdf/pdfmark.pdf differs in /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_sysutils_groff/work/destroot-i386 and /opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_sysutils_groff/work/destroot-x86_64 and cannot be merged

I wonder if the pdf files differ only because they are compressed, in which case we should decompress them and rerun the comparison, as we do for .gz files (although I don't know if there's a way to easily decompress a pdf without pulling in esoteric dependencies). Or it's possible they just legitimately differ.

(Of course, if there were a solution that didn't require muniversal that would obviously be preferable.)

comment:8 Changed 14 years ago by bayonne

Cc: porter@… added

Cc Me!

comment:9 Changed 14 years ago by daitakahashi

The origin of this problem seems to be a supplemental call of configure at src/libs/gnulib, which was introduced at 1.21.

See Makefile.in:770,

$(GNULIBDIRS): FORCE
 ...
	test -f Makefile || $(SHELL) $$srcdir/configure ; \               <-- here
	$(MAKE) ACLOCAL=: AUTOCONF=: AUTOHEADER=: AUTOMAKE=: $(do) ;; \
	esac

a supplemental configure script is called without any options, therefore, it ignores --disable-dependency-tracking, --prefix and so on.

I think the evaluation of this configure script (with appropriate options) at post-configure phase will solve the problem.

comment:10 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: siavashsf@… added

Has duplicate #29066.

comment:11 Changed 14 years ago by fracai

Cc: arno+macports@… added

Cc Me!

Changed 14 years ago by daitakahashi

Attachment: Portfile.diff added

This is quick hack, but it seems to work.

comment:12 Changed 14 years ago by rmstonecipher@…

dtakahashi,
Some of the commands in your patch are not yet documented in the MacPorts Guide.
Could you explain what your patch does?

This could also be resolved by adding configure.cflags or configure.universal_cflags to Makefile.in using a patchfile and a post-patch reinplace.

Index: files/patch-Makefile.in.diff
===================================================================
--- files/patch-Makefile.in.diff        (revision 0)
+++ files/patch-Makefile.in.diff        (revision 0)
@@ -0,0 +1,11 @@
+--- Makefile.in.orig   2011-04-09 23:21:32.000000000 -0500
++++ Makefile.in        2011-04-09 23:22:27.000000000 -0500
+@@ -767,7 +767,7 @@
+       case $(do) in \
+       all) \
+       cd $@; \
+-      test -f Makefile || $(SHELL) $$srcdir/configure ; \
++      test -f Makefile || $(SHELL) $$srcdir/configure %%CONFIGURE_ARGS%%; \
+       $(MAKE) ACLOCAL=: AUTOCONF=: AUTOHEADER=: AUTOMAKE=: $(do) ;; \
+       esac
+ 
Index: Portfile
===================================================================
--- Portfile    (revision 77708)
+++ Portfile    (working copy)
@@ -15,10 +15,20 @@
 master_sites     gnu
 checksums        sha1    a513aca4a7530a6e63325addd6ba2d282c8f1608 \
                  rmd160  d050f886291a53ea46875887e5641e510e1aecf6
+depends_build    port:psutils
 configure.args   --infodir=${prefix}/share/info \
                  --mandir=${prefix}/share/man \
                  --without-x
+patchfiles      patch-Makefile.in.diff
 
+post-patch {
+    if {[variant_isset universal]} {
+        reinplace "s|%%CONFIGURE_ARGS%%|${configure.universal_args}|g" ${worksrcpath}/Makefile.in
+    } else {
+        reinplace "s|%%CONFIGURE_ARGS%%|${configure.args}|g" ${worksrcpath}/Makefile.in
+    }
+}
+
 post-destroot {
     delete ${destroot}${prefix}/lib/charset.alias
 }

dtakahashi's way is more terse.
Does it matter which solution is used?

Ryan Stonecipher
P.S. The other change in my Portfile diff, adding 'depends_build port:psutils', allows the documentation to build html per a configure-time warning.

comment:13 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

His patch says: run the configure phase with the settings set in the portfile, then run the configure phase again in a different directory. Ryan, you're right this is not a command listed in the guide or approved for use in portfiles. I am of course also guilty of using this in the php5extension portgroup, and a similar method in the php5 portfile, but I'd rather not proliferate its use if at all possible.

Does this second configure script really need all the arguments passed to the main one? Does it for example matter whether --prefix is passed to it? If not, and if the only thing we're concerned with is disabling dependency tracking, then just write a simple one-line patch that unconditionally adds that flag to that configure script invocation; there's no harm in disabling dependency tracking even when not building universal. Dependency tracking is only relevant when a build directory is reused, which in MacPorts it never is; it's cleaned after every successful build.

comment:14 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

In fact, Ryan, if your intention with your patch was to pass all the usual args to that second configure script, you haven't succeeded. In the universal case, you're not passing configure.args, and in neither case are you passing configure.pre_args.

comment:15 Changed 14 years ago by rmstonecipher@…

Cc: rmstonecipher@… added

Cc Me!

comment:16 Changed 14 years ago by daitakahashi

Thank you for the better fix. As you pointed, portconfigure::configure_main is not documented (but it is exported to global namespace from ${prefix}/share/macports/Tcl/port1.0/portconfigure.tcl), so I should not have used it...

In my observation, Makefile at src/libs/gnulib does not install anything, but just build libgnu.a that is statically linked to main binaries. So passing all the configure options is not needed, and I agree to add a small patch that unconditionally disables dependency tracking.

comment:17 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.2.diff added

comment:18 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attached is another possible solution.

comment:19 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Yes, but we were trying to avoid the muniversal variant if possible.

comment:20 in reply to:  16 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

Replying to dtakahashi42@…:

So passing all the configure options is not needed, and I agree to add a small patch that unconditionally disables dependency tracking.

Seems to work. r77723

Note: See TracTickets for help on using tickets.