Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4726: On Windows, inform or warn about 'programs' path with space #4801

Merged
merged 1 commit into from
May 6, 2019

Conversation

mpilgrem
Copy link
Member

@mpilgrem mpilgrem commented May 4, 2019

In module Stack.Config, function configFromConfigMonoid, a stack user is informed if the stack 'programs' path contains a space character. If the path also does not have an alternative short ('8 dot 3') name, the user is further warned of the implications for packages that make use of the GNU project's configure shell script.

New modules System.Info are added to src/windows and src/unix to re-export getShortPathName from the System.Win32.Info module of the Win32 package in the case of Windows and do nothing in the case of Unix-like operating systems. This avoids the need for C preprocessor (CPP) directives in Stack.Config.

ChangeLog.md is updated, accordingly.

Tested on Windows 10 with 'programs' paths that do and do not contain space characters and, in the latter case, with paths that do and do not have '8 dot 3' names. Tested with paths that do not yet exist when stack is first run.

Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.

Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests! See above.

@mpilgrem mpilgrem force-pushed the 8dot3 branch 2 times, most recently from 4da27d2 to 3054eee Compare May 5, 2019 14:00
src/Stack/Config.hs Outdated Show resolved Hide resolved
@snoyberg
Copy link
Contributor

snoyberg commented May 5, 2019

Note that the CI build failed:

stack> /home/vsts/work/1/s/src/unix/System/Info.hs:9:33: error:
stack>     Not in scope: type constructor or class ‘IO’
stack>   |
stack> 9 | getShortPathName :: FilePath -> IO FilePath

@mpilgrem mpilgrem force-pushed the 8dot3 branch 3 times, most recently from 59d9a52 to c1ed243 Compare May 5, 2019 21:17
…space, no 8dot3 name

In module `Stack.Config`, function `configFromConfigMonoid`, a stack user is warned if the stack 'programs' path contains a space character and does not have an alternative short ('8 dot 3') name,warned of the implications for packages that make use of the GNU project's `configure` shell script.

New modules `System.Info.ShortPathName` are added to `src/windows` and `src/unix` to rexport `getShortPathName` from the `System.Win32.Info` module of the `Win32` package in the case of Windows and do nothing in the case of Unix-like operating systems. This avoids the need for C preprocessor (CPP) directives in `Stack.Config`.

`ChangeLog.md` is updated, accordingly.

Tested on Windows 10 with 'programs' paths that do and do not contain space characters and, in the latter case, with paths that do and do not have '8 dot 3' names. Tested with paths that do not yet exist when stack is first run.
Copy link
Contributor

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@snoyberg snoyberg merged commit a6768d0 into commercialhaskell:master May 6, 2019
@mpilgrem mpilgrem deleted the 8dot3 branch May 6, 2019 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants