building on WSL
Erik Joelsson
erik.joelsson at oracle.com
Wed Jan 30 00:51:19 UTC 2019
Hello Jon,
On 2019-01-29 16:42, Jonathan Gibbons wrote:
> This is a question for those folk that have been working on, and more
> importantly, using, the recently-support for WSL.
>
> I'm coming up to speed up actually using WSL myself, so that I can
> test the various new stuff going into jtreg.
>
> What is the typical way to build OpenJDK for Windows, with WSL? e.g.
> what commands, and do you get Windows binaries?
>
In a WSL shell you should be able to run configure as usual and it will
default to try to build for Windows. There are a few caveats as listed
in doc/building.md:
Windows 10 1809 or newer is supported due to a dependency on the wslpath
utility
and support for environment variable sharing through WSLENV. Version
1803 can
work but intermittent build failures have been observed.
It's possible to build both Windows and Linux binaries from WSL. To build
Windows binaries, you must use a Windows boot JDK (located in a
Windows-accessible directory). To build Linux binaries, you must use a Linux
boot JDK. The default behavior is to build for Windows. To build for
Linux, pass
`--build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu` to
`configure`.
If building Windows binaries, the source code must be located in a Windows-
accessible directory. This is because Windows executables (such as
Visual Studio
and the boot JDK) must be able to access the source code. Also, the
drive where
the source is stored must be mounted as case-insensitive by changing either
/etc/fstab or /etc/wsl.conf in WSL. Individual directories may be corrected
using the fsutil tool in case the source was cloned before changing the
mount
options.
> Although there is support going into the build for running jtreg, if
> one were to run jtreg directly, what would the typical/expected
> command be ... would it be to run the jtreg launch script in a
> WSL/bash window, pointing at a Windows JDK ... or something else?
>
That would be my assumption yes.
/Erik
> -- Jon
>
More information about the build-dev
mailing list