Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #11897 (new defect)

Opened 17 months ago

Last modified 2 weeks ago

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

Reported by: gwhitney@… Owned by: gwhitney@…
Priority: Normal Milestone: MacPorts 1.6.1
Component: base Version: 1.4.3
Keywords: haspatch Cc: raimue@…, jmr@…, 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

buildvariants.patch (0.7 kB) - added by gwhitneycom1@… 17 months ago.
Proposed patch to resolve this issue

Change History

Changed 17 months ago by gwhitneycom1@…

Proposed patch to resolve this issue

Changed 17 months 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.

Changed 15 months ago by ryandesign@…

  • cc gwhitney@… added
  • owner changed from macports-dev@… to gwhitney@…

Changed 14 months ago by nox@…

  • priority changed from Expected to Normal
  • milestone set to MacPorts base bugs

Changed 8 months ago by raimue@…

  • 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?

Changed 8 months 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.

Changed 5 months ago by jmr@…

  • cc jmr@… added; gwhitney@… removed
  • keywords haspatch added
  • milestone changed from MacPorts base bugs to MacPorts 1.6.1

Nominating for the upcoming release.

Changed 2 weeks ago by blb@…

  • cc blb@… added

Cc Me!

Note: See TracTickets for help on using tickets.