[131494] trunk/dports/_resources/port1.0/group/mpi-1.0.tcl

sean at macports.org sean at macports.org
Mon Jan 12 16:59:14 PST 2015


Revision: 131494
          https://trac.macports.org/changeset/131494
Author:   sean at macports.org
Date:     2015-01-12 16:59:14 -0800 (Mon, 12 Jan 2015)
Log Message:
-----------
mpi-1.0: fix silently failing to enforce mpi variants

Previously, the mpi portgroup would try to append a mpi variant to the
default_variants variable. Unfortunately, this would fail and silently be
ignored leading to build-time issues.

This patch changes that behavior to raise an error explaining that the user
must match the mpi variant. For example, if hdf5 is installed with +mpich, then
netcdf must be installed with +mpich.

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/mpi-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/mpi-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/mpi-1.0.tcl	2015-01-13 00:59:12 UTC (rev 131493)
+++ trunk/dports/_resources/port1.0/group/mpi-1.0.tcl	2015-01-13 00:59:14 UTC (rev 131494)
@@ -165,13 +165,18 @@
 }
 
 proc mpi.action_enforce_variants {args} {
+    global name
     foreach portname $args {
         if {![catch {set result [active_variants $portname "" ""]}]} {
             set otmpi  [mpi_active_variant_name $portname]
             set mympi  [mpi_variant_name]
 
             if {$otmpi ne "" && $mympi eq ""} {
-                default_variants +$otmpi
+                # instead of trying to append to a default variant (which fails
+                # silently for some cases), we should be explicit and tell the
+                # user about the error
+                ui_error "Need to select variant +$otmpi"
+                return -code error "$portname +$otmpi is installed, so +$otmpi needs to be selected for $name"
             } elseif {$otmpi ne $mympi} {
                 ui_error "Install $portname +$mympi"
                 return -code error "$portname +$mympi not installed"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150112/3279c3be/attachment.html>


More information about the macports-changes mailing list