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

On Windows: Automatically run autoreconf -i when needed #4778

Closed
mpilgrem opened this issue Apr 27, 2019 · 0 comments
Closed

On Windows: Automatically run autoreconf -i when needed #4778

mpilgrem opened this issue Apr 27, 2019 · 0 comments

Comments

@mpilgrem
Copy link
Member

I think this is a stack feature request (and not a bug). It may be a bug if #3598 was intended to work on Windows as it does on Unix-like operating systems.

In a clean clone of the process library from GitHub, on Windows 10 with stack --version Version 2.0.0, Git revision dfbf85ad7e8af5b01cf7b51367290870ffc2c90e (7456 commits) x86_64 hpack-0.31.1 , stack build fails with (extracts):

Trying to generate configure with autoreconf in C:\Users\mikep\Documents\Code\GitHub\process\
Unable to run autoreconf: Executable named autoreconf not found on path: ...

Configuring process-1.6.5.0...
Warning: The 'build-type' is 'Configure' but there is no 'configure' script.
You probably need to run 'autoreconf -i' to generate it.
setup.exe: configure script not found.

Following up, I discovered #3598. I think that feature does not work on Windows because autoreconf is a shell script file, not an executable (I get the same error message even if the autoreconf file is on the path).

My feature request is to make #3598 work for Windows users of stack. That is, automatically run the autoreconf -i script when needed. That would require the stack MSYS2 to come with autoconf and perl (see below).

I could build process on Windows using stack if I did the following:

  1. Add both autoconf and perl to stack's MSYS2, using stack exec pacman -- -S. stack's version of MSYS2 does not come with them as standard.
  2. Execute stack exec sh -- autoreconf -i.
  3. Execute stack build.
mpilgrem added a commit to mpilgrem/stack that referenced this issue Apr 28, 2019
In module `Stack.Setup`, `pacman` is used to add the `perl` and `autoconf` packages to stack's MSYS2.

In module `Stack.Build.Execute`, the code uses command `sh autoreconf -i` for Windows, instead of just `autoreconf -i`.

The implementation involves two hacks:

1. `pacman` and `sh autoreconf -i` seem to clear and not restore ANSI capability on native Windows terminals. A hack restores the ANSI capability (using the same hack that was once used for `git clone` - fix commercialhaskell#4121).
2. MSYS2's current `perl` package (5.28.1-2) is broken. So the `perl` installed by stack is downgraded to 5.28.0-1, which works. This will need to be revisited once `perl` is fixed on MSYS2.

This has been tested on Windows 10 (only) by deleting stack's MSYS2 (so that stack reinstalls it) and by then building the `process` package (which makes use of `configure`) using stack.
mpilgrem added a commit to mpilgrem/stack that referenced this issue Apr 29, 2019
In module `Stack.Build.Execute`, the code uses command `sh autoreconf -i` for Windows, instead of just `autoreconf -i`. A comprehensive help message is added if `sh autoreconf -i` throws an exception on Windows.

The implementation involves a hack: `sh autoreconf -i` seems to clear and not restore ANSI capability on native Windows terminals. A hack restores the ANSI capability (using the same hack that was once used for `git clone` - fix commercialhaskell#4121).

This has been tested on Windows 10 (only) by deleting stack's MSYS2 (so that stack reinstalls it) and by then building the `process` package (which makes use of `configure`) using stack.
mpilgrem added a commit to mpilgrem/stack that referenced this issue Apr 29, 2019
In module `Stack.Build.Execute`, the code uses command `sh autoreconf -i` for Windows, instead of just `autoreconf -i`. A comprehensive help message is added if `sh autoreconf -i` throws an exception on Windows.

The implementation involves a hack: `sh autoreconf -i` seems to clear and not restore ANSI capability on native Windows terminals. A hack restores the ANSI capability (using the same hack that was once used for `git clone` - fix commercialhaskell#4121).

This has been tested on Windows 10 (only) by deleting stack's MSYS2 (so that stack reinstalls it) and by then building the `process` package (which makes use of `configure`) using stack.
snoyberg added a commit that referenced this issue May 4, 2019
Fix #4778: autorun `autoreconf` on Windows too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants