Opened 18 years ago

Closed 16 years ago

#11897 closed defect (fixed)

BUG: base-1.4.3 variants.conf not applied to "build" target

Reported by: gwhitney@… Owned by: gwhitney
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.4.3
Keywords: haspatch Cc: raimue (Rainer Müller), jmroot (Joshua Root), blb@…
Port:

Description

The documentation of variants.conf, contained right in the sample variants.conf file, specifies:

# To specify global variants to use for all port builds,
# customize this file to list variant settings you want.

However, I have +no_static in my variants.conf file, and "expat" has a no_static variant which adds --disable-static to the configure.args. Nevertheless, the behavior is:

chickadee$ port -k install expat
--->  Fetching expat
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat with target all
--->  Staging expat into destroot
--->  Installing expat 2.0.0_1+no_static
--->  Activating expat 2.0.0_1+no_static
chickadee$ head -8 /opt/mpq/var/db/dports/build/_opt_mpq_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_textproc_expat/work/expat-2.0.0/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by expat configure 2.0.0, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ./configure --prefix=/opt/mpq --mandir=${prefix}/share/man --disable-static

All OK so far. However:

chickadee$ port build expat
Error: Requested variants do not match original selection.
Please perform 'port clean expat' or specify the force option.
Error: Status 1 encountered during processing.
chickadee$ port clean expat
--->  Cleaning expat
chickadee$ port build expat
--->  Fetching expat
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat with target all
chickadee$ head -8 /opt/mpq/var/db/dports/build/_opt_mpq_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_textproc_expat/work/expat-2.0.0/config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by expat configure 2.0.0, which was
generated by GNU Autoconf 2.59.  Invocation command line was

  $ ./configure --prefix=/opt/mpq --mandir=${prefix}/share/man

Now the --disable-static is missing. Since variants.conf supposedly applied to "all port builds", I would expect the build to be in harmony with the install. Indeed, if I had tried to build first, I would expect a subsequent install to be able to use the build I just did, not have to redo everything from configure on.

I see in "port" there is code to insert the global_variations in action_upgrade and in action_target, where it is specifically limited to the "install" target. Wouldn't it be simpler and less error-prone to remove that condition and always insert the global_variations regardless of which target is specified?

Attachments (1)

buildvariants.patch (729 bytes) - added by gwhitneycom1@… 18 years ago.
Proposed patch to resolve this issue

Download all attachments as: .zip

Change History (9)

Changed 18 years ago by gwhitneycom1@…

Attachment: buildvariants.patch added

Proposed patch to resolve this issue

comment:1 Changed 18 years ago by gwhitney@…

In the spirit of clarity, I've just attached the patch I'd propose to resolve the situation -- simply remove the check that the target is "install" around the code in action_target which adds in the variants.conf variants. Since these variants are always supposed to apply, it seems they should be included for all targets. I have been running with this change for the past week and have not observed any ill effects from adding the variants.conf variants to all targets. Hope this helps.

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

Cc: gwhitney@… added
Owner: changed from macports-dev@… to gwhitney@…

comment:3 Changed 17 years ago by nox@…

Milestone: MacPorts base bugs
Priority: ExpectedNormal

comment:4 Changed 17 years ago by raimue (Rainer Müller)

Cc: raimue@… added

What about committing this patch eventually? As I am using variants.conf myself I would really appreciate to see this fixed. I think it is staying long enough here in Trac and the fix is reasonable. Or does anyone have any objections?

comment:5 Changed 17 years ago by gwhitney

Well, I've been unfortunately pre-empted from spending time on MacPorts for the last 6 months or so, but actually I hope to get back up to speed soon. I think I could be back up to speed and have the patch applied by the end of March. If that's too long for you and you can find someone else to do it quicker, I don't mind. Thanks for your understanding.

comment:6 Changed 17 years ago by jmroot (Joshua Root)

Cc: jmr@… added; gwhitney@… removed
Keywords: haspatch added
Milestone: MacPorts base bugsMacPorts 1.6.1

Nominating for the upcoming release.

comment:7 Changed 16 years ago by blb@…

Cc: blb@… added

Cc Me!

comment:8 Changed 16 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

Applied in r41157.

Note: See TracTickets for help on using tickets.