[MacPorts] #68940: qgis3 @3.34.1_1 +grass: default GRASS GISBASE path not correct and error message not helpful

MacPorts noreply at macports.org
Mon Dec 18 23:51:15 UTC 2023


#68940: qgis3 @3.34.1_1 +grass: default GRASS GISBASE path not correct and error
message not helpful
---------------------------------+-----------------------------
 Reporter:  bal-agates           |      Owner:  (none)
     Type:  enhancement          |     Status:  new
 Priority:  Normal               |  Milestone:
Component:  ports                |    Version:  2.8.1
 Keywords:  qgis3 grass GISBASE  |       Port:  qgis3 qgis3-ltr
---------------------------------+-----------------------------
 I had trouble getting the GRASS plugin to work in QGIS.  After enabling
 the GRASS 8 plugin there was an error:

 {{{GRASS init error: GRASS was not found in '/opt/local/bin' (GISBASE),
 provider and plugin will not work.}}}

 Opening Plugins > GRASS > GRASS Options > General I saw my installed GRASS
 Version (it seemed to find the executable) but at the bottom was a
 message:

 {{{Currently selected GRASS installation is not valid}}}

 The default GISBASE was /opt/local/bin.  That makes sense to me because
 that is where the GRASS startup executable lives, however, that may not be
 what QGIS needs?  The large suite of scripts that make up GRASS live
 elsewhere.

 I dug into the QGIS 3.43.1 code and the function that generated the
 message above was looking for the existence of a file
 $(GISBASE)/etc/element_list.  On my system I found that file in
 /opt/local/lib/grass83/etc/element_list.  In the dialog setting "Custom =
 /opt/local/lib/grass83" seems to fix the problem.  It at least got rid of
 the error.  I have not run any GRASS functions yet.

 I am unsure of how to fix this in general.  The Portfile effectively sets
 a variable "grass_gis_base = /opt/local/bin/grass".  Is that where the
 default GISBASE is coming from?  Would changing that to
 "/opt/local/lib/grass83" be a valid solution?  If so how would you get
 that path, with GRASS version, in this portfile?  Another possible
 solution would be to just display a note to the user to manually check the
 GISBASE path?  Such a note would have saved me hours of troubleshooting.

 Note that the same problem exists in QGIS3-LTR 3.28.13.

 Also note the QGIS master source branch has a recent change, not included
 in QGIS 3.34.1, to the function that checks the validity of GISBASE.  I am
 not sure when that will be incorporated into a release or if it would have
 any impact on this.

-- 
Ticket URL: <https://trac.macports.org/ticket/68940>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list