From 210aa040b5893aa637bd362d8065166f789ef753 Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 7 Apr 2025 11:15:47 +0200 Subject: [PATCH 1/3] 8244533: Configure should abort on missing short names in Windows --- doc/building.html | 33 +++++++++++++++++---- doc/building.md | 49 +++++++++++++++++++++---------- doc/hotspot-unit-tests.html | 14 ++++----- make/autoconf/basic_windows.m4 | 6 ++-- make/autoconf/util_paths.m4 | 53 ++++++++++++++++++++++++---------- make/scripts/fixpath.sh | 14 +++++++-- 6 files changed, 120 insertions(+), 49 deletions(-) diff --git a/doc/building.html b/doc/building.html index 722fe6b8d1256..07e02d55497a5 100644 --- a/doc/building.html +++ b/doc/building.html @@ -282,9 +282,29 @@

Special Considerations

having slow disk access will significantly increase build times. If you need to use a network share for the source code, see below for suggestions on how to keep the build artifacts on a local disk.

-
  • On Windows, if using Cygwin, extra care -must be taken to make sure the environment is consistent. It is -recommended that you follow this procedure:

    +
  • On Windows, extra care must be taken to have a smooth building +experience:

    +
  • - -

    Failure to follow this procedure might result in hard-to-debug build -problems.

    +

    Build Hardware Requirements

    The JDK is a massive project, and require machines ranging from diff --git a/doc/building.md b/doc/building.md index 56bc860a13d97..dd926f973cbc4 100644 --- a/doc/building.md +++ b/doc/building.md @@ -83,19 +83,39 @@ on where and how to check out the source code. for the source code, see below for suggestions on how to keep the build artifacts on a local disk. -* On Windows, if using [Cygwin](#cygwin), extra care must be taken to make sure - the environment is consistent. It is recommended that you follow this - procedure: - - * Create the directory that is going to contain the top directory of the JDK - clone by using the `mkdir` command in the Cygwin bash shell. That is, do - *not* create it using Windows Explorer. This will ensure that it will have - proper Cygwin attributes, and that it's children will inherit those - attributes. - - * Do not put the JDK clone in a path under your Cygwin home directory. This - is especially important if your user name contains spaces and/or mixed - upper and lower case letters. +* On Windows, extra care must be taken to have a smooth building experience: + + * Make sure that all relevant paths have short names. Short names are used by + the build system to create space-free alternative paths. Short name + creation is enabled per volume. The default setting can be checked with the + command: `fsutil 8dot3name query`. If short name creation was turned off + when a directory was created, it will not have a short name. Whether a + short name exists can be checked by running `dir /X` in the containing + directory (in cmd.exe). If a short path is present you should see something + like 'ASDF~1' being displayed in one of the columns of the ouput. If a + directory is missing a short name, the safest way to get one is to enable + short names for that particular volume with `fsutil 8dot3name set : 0` (note that you need to run as administrator for this), and then + re-create the particular directory. A short name should be generated + automatically then. Another option is to manually assign a short name to + the directory using `fsutil file setShortName `. + + * If using [Cygwin](#cygwin), you must make sure the file permissions and + attributes between Windows and Cygwin are consistent. It is recommended + that you follow this procedure: + + * Create the directory that is going to contain the top directory of the + JDK clone by using the `mkdir` command in the Cygwin bash shell. That is, + do *not* create it using Windows Explorer. This will ensure that it will + have proper Cygwin attributes, and that it's children will inherit those + attributes. + + * Do not put the JDK clone in a path under your Cygwin home directory. This + is especially important if your user name contains spaces and/or mixed + upper and lower case letters. + + Failure to follow this procedure might result in hard-to-debug build + problems. * You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice. @@ -113,9 +133,6 @@ on where and how to check out the source code. make sure you set `core.autocrlf` to `false` (this is asked during installation). - Failure to follow this procedure might result in hard-to-debug build - problems. - ## Build Hardware Requirements The JDK is a massive project, and require machines ranging from decent to diff --git a/doc/hotspot-unit-tests.html b/doc/hotspot-unit-tests.html index fcd4a93f8e485..b3700abb3ac27 100644 --- a/doc/hotspot-unit-tests.html +++ b/doc/hotspot-unit-tests.html @@ -189,7 +189,7 @@

    Nearness

    Prefer having checks inside test code.

    Not only does having test logic outside, e.g. verification method, depending on asserts in product code contradict with several items above -but also decreases test’s readability and stability. It is much easier +but also decreases test's readability and stability. It is much easier to understand that a test is testing when all testing logic is located inside a test or nearby in shared test libraries. As a rule of thumb, the closer a check to a test, the better.

    @@ -198,7 +198,7 @@

    Several checks

    Prefer EXPECT over ASSERT if possible.

    This is related to the informativeness property of tests, information for other checks can help to better -localize a defect’s root-cause. One should use ASSERT if it +localize a defect's root-cause. One should use ASSERT if it is impossible to continue test execution or if it does not make much sense. Later in the text, EXPECT forms will be used to refer to both ASSERT/EXPECT.

    @@ -235,7 +235,7 @@

    Floating-point comparison

    eps.

    C string comparison

    Use string special macros for C strings comparisons.

    -

    EXPECT_EQ just compares pointers’ values, which is +

    EXPECT_EQ just compares pointers' values, which is hardly what one wants comparing C strings. GoogleTest provides EXPECT_STREQ and EXPECT_STRNE macros to compare C string contents. There are also case-insensitive versions @@ -293,7 +293,7 @@

    Test group names

    This naming scheme helps to find tests, filter them and simplifies test failure analysis. For example, class Foo - test group Foo, compiler logging subsystem - test group -CompilerLogging, G1 GC — test group G1GC, and +CompilerLogging, G1 GC - test group G1GC, and so forth.

    Filename

    A test file must have test_ prefix and .cpp @@ -345,7 +345,7 @@

    Fixture classes

    Friend classes

    All test purpose friends should have either Test or Testable suffix.

    -

    It greatly simplifies understanding of friendship’s purpose and +

    It greatly simplifies understanding of friendship's purpose and allows statically check that private members are not exposed unexpectedly. Having FooTest as a friend of Foo without any comments will be understood as a necessary @@ -435,7 +435,7 @@

    Test-specific flags

    Flag restoring

    Restore changed flags.

    It is quite common for tests to configure JVM in a certain way -changing flags’ values. GoogleTest provides two ways to set up +changing flags' values. GoogleTest provides two ways to set up environment before a test and restore it afterward: using either constructor and destructor or SetUp and TearDown functions. Both ways require to use a test fixture @@ -444,7 +444,7 @@

    Flag restoring

    be used in such cases to restore/set values.

    Caveats:

    -

    Failure to follow this procedure might result in hard-to-debug build -problems.

    +

    Failure to follow these procedures might result in hard-to-debug +build problems.

  • You need to install a git client. You have two choices, Cygwin git or Git for Windows. Unfortunately there are pros and cons with each choice.