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

Various build process fixes for native Windows #2940

Merged
merged 7 commits into from
May 24, 2017
Merged

Conversation

dra27
Copy link
Member

@dra27 dra27 commented May 13, 2017

Last tranche (for now) from my windows-build branch. These are most of the less-invasive patches for Windows support. Combined with the rest of today's PRs, this gets the build system to the point that it can correctly compile and install opam using opam-installer (however, that opam is not capable of running opam init at this stage).

@dra27 dra27 force-pushed the win-build branch 3 times, most recently from 3313e1c to 912ed2c Compare May 15, 2017 19:55
dra27 added 2 commits May 23, 2017 16:08
If an error occurs launching a process, OPAM doesn't close the file
handles (.err and .out) which on Windows results in error messages when
trying to delete the logging directory (since on Windows you can't remove
files which are still open).
If a file cannot be found, opam-installer will attempt to copy or delete
the .exe file instead (and display a warning). opam.install therefore
generated by configure.
dra27 added 5 commits May 23, 2017 16:10
Environment variable names are not case sensitive on Windows and PATH is
by default returned as Path. Fix OpamStd.Env.get to use a case insensitive
search on Windows (and similarly the internal function OpamSystem.env_var)
and ensure that code which manipulates a list of environment variables
allows for case-insensitive removal (opamState.add_to_env, etc.)
Windows builds of OPAM cannot rely on /bin/sh! Windows checks PATH
environment variable instead.
rm -rf is only available if the user enables Cygwin or some other
equivalent - converted to use cmd's rd command which is guaranteed to be
available.
Detection of ocamlopt and .opt tools doesn't take into account .exe
extensions on Windows.

Added OpamStd.Sys.executable_name which appends .exe to a filename on
Windows if it isn't already present. Use this to correct the detection
of the ocaml-native and ocaml-native-tools global variables.
Directory separator should always be Filename.dir_sep, not a hard-coded
"/"!
@dra27
Copy link
Member Author

dra27 commented May 23, 2017

Small correction to use String.uppercase_ascii instead of String.uppercase and rebased.

@AltGr
Copy link
Member

AltGr commented May 24, 2017

Thanks for taking the time to do all this! Only complaint I can find is a couple overly long lines ;)

@AltGr AltGr merged commit 1d14b11 into ocaml:master May 24, 2017
@dra27
Copy link
Member Author

dra27 commented May 24, 2017

Oops 😊 - I don't think these were as heinous!

Other PRs now all rebased - the inclusion of 352a51a means that the duplication of the EXE variable now disappears.

@dra27 dra27 deleted the win-build branch May 24, 2017 14:09
@dra27 dra27 mentioned this pull request Jun 13, 2024
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.

2 participants