View Issue Details

IDProjectCategoryView StatusLast Update
0004182Slicer4Core: Extensionspublic2017-08-03 14:38
Reportermsmolens Assigned Tojcfr  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionSlicer 4.5.0-1 
Target VersionFixed in VersionSlicer 4.6.2 
Summary0004182: Running slicerExtensionWizard on Windows fails to set up proper environment
Description

Running the extension wizard on Windows from the Git Bash prompt provided by Git for Windows (https://git-for-windows.github.io/) gives the following error:

john@michael MINGW64 /f/3DSlicer/SuperBuild/Slicer-build 
$ bin/slicerExtensionWizard 
Traceback (most recent call last): 
  File "F:/3DSlicer/SuperBuild/Slicer-build/libexec/ExtensionWizard.py", line 10, in <module> 
w.execute() 
  File "F:\3DSlicer\SuperBuild\Slicer-build\bin\Python\SlicerWizard\ExtensionWizard.py", line 715, in execute 
self._execute(args if len(args) else None) 
  File "F:\3DSlicer\SuperBuild\Slicer-build\bin\Python\SlicerWizard\ExtensionWizard.py", line 664, in _execute 
if args.publish: 
AttributeError: 'Namespace' object has no attribute 'publish' 

As reported on mailing list:
http://slicer-users.65878.n3.nabble.com/A-problem-when-I-try-to-invoke-ExtensionWizard-td4030358.html
(Archive link on http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users gives 404?)

The specific AttributeError results from a minor bug in the ExtensionWizard itself. But the root cause is that the PATH that reaches Python is incorrect, so Python doesn't find required DLLs.

Steps To Reproduce

Install Git for Windows
Open Git Bash
Navigate to Slicer-build directory
./bin/slicerExtensionWizard

Additional Information

The following call in slicerExtensionWizard sets the PATH, along with other environment variables:

eval $("F:/3DSlicer/SuperBuild/Slicer-build/Slicer" --launcher-show-set-environment-commands)

The MSYS2 environment that Git for Windows uses converts the contents of PATH to Unix format when launching a process, such as when slicerExtensionWizard runs Python. That conversion corrupts the PATH. A Windows path like "C:/foo/bar" is converted to two separate paths (/C and /c/foo/bar) because MSYS2 considers the colon as a separator.

This wasn't a problem with the older Git Bash, provided by msysGit, because its MSYS didn't perform this conversion.

MSYS2 provides some control over this path conversion for command-line arguments (MSYS2_ARG_CONV_EXCL, MSYS_NO_PATHCONV), but there is no such control for the PATH environment variable.

TagsNo tags attached.

Activities

msmolens

msmolens

2016-06-01 12:54

developer   ~0013912

A followup issue with the --publish option on Windows is:
http://massmail.spl.harvard.edu/public-archives/slicer-users/2016/010529.html

johan.andruejol

johan.andruejol

2016-06-01 13:17

manager   ~0013914

There is an active PR that will most likely address this here: https://github.com/Slicer/Slicer/pull/496

msmolens

msmolens

2017-04-27 13:31

developer   ~0014444

Tested with Slicer at revision 25977 (http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25977)

and Git for Windows 64-bit with the following version:
$ git --version
git version 2.12.2.windows.2

The AttributeError and path interpretation problems are no longer issues, and the command line extension wizard functions as expected, after the following minor related changes:
https://github.com/Slicer/Slicer/pull/714

msmolens

msmolens

2017-05-15 12:33

developer   ~0014481

http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26012

Issue History

Date Modified Username Field Change
2016-05-03 09:41 msmolens New Issue
2016-05-03 09:41 msmolens Status new => assigned
2016-05-03 09:41 msmolens Assigned To => jcfr
2016-06-01 12:54 msmolens Note Added: 0013912
2016-06-01 13:17 johan.andruejol Note Added: 0013914
2016-10-13 02:04 jcfr Product Version Slicer 4.5.1 => Slicer 4.5.0-1
2017-04-27 13:31 msmolens Note Added: 0014444
2017-04-27 13:31 msmolens Status assigned => resolved
2017-04-27 13:31 msmolens Resolution open => fixed
2017-05-15 12:33 msmolens Note Added: 0014481
2017-08-03 14:38 jcfr Status resolved => closed
2017-08-03 14:38 jcfr Fixed in Version => Slicer 4.6.2