Skip to content

//src/test/py/bazel{:runfiles_test,windows_remote_test} #5315

Closed

Description

@buchgr

When trying to move Bazel's host javabase to JDK9 (#5312) these two tests fail:

//src/test/py/bazel:runfiles_test
//src/test/py/bazel:windows_remote_test

Here's a detailed log:

https://source.cloud.google.com/results/invocations/bb12c897-b46a-4e75-938f-1d956699d8dc/targets

The errors all look like:

11:1: //bar:bar-java: missing input file '@local_jdk//:jre/lib/jce.jar'
ERROR: C:/users/b/_bazel_b/1fz8gp--/execroot/io_bazel/_tmp/c3b0bbd16b12dcab62c45e413ccc8e32/tests_root/tmp9u5kc82s/bar/BUILD:11:1 1 input file(s) do not exist

IIUC correctly files like jre/lib/jce.jar no longer exist in JDK9.

cc: @jasharpe @meteorcloudy @cushon @laszlocsomor

Activity

  1. cushon commented on Jun 1, 2018

    @cushon
    Contributor

    Are they only failing on windows?

  2. buchgr commented on Jun 2, 2018

    @buchgr
    ContributorAuthor

    @cushon yes! The windows_remote_test is also only run on Windows, but the runfiles_test runs on all platforms.

  3. aehlig commented on Jun 4, 2018

    @aehlig
    Contributor

    @laszlocsomor can you help triaging further and assign as appropriate? Thanks.

  4. meteorcloudy commented on Jun 4, 2018

    @meteorcloudy
    Member

    @aehlig Laszlo is on vacation this week, I can take a look at this.

  5. self-assigned this
    on Jun 4, 2018
  6. meteorcloudy commented on Jun 4, 2018

    @meteorcloudy
    Member

    @buchgr

    # TODO(cushon): this isn't compatible with JDK 9
    filegroup(
    name = "bootclasspath",
    srcs = ["jre/lib/%s" % jar for jar in BOOTCLASS_JARS],
    )

    Did you see this?

    @cushon Not sure why it's only failing on Windows, any idea how to fix for JDK 9?

  7. cushon commented on Jun 4, 2018

    @cushon
    Contributor

    We shouldn't be using JDK 9 as a --javabase yet, just as a --host_javabase, so that TODO shouldn't be a problem.

    Can you confirm that the JAVA_HOME environment variable is being set correctly for those windows tests, and that this logic is locating the local JDK 8 instead of the embedded JDK 9?

    workspaceEnv.update(
    "DEFAULT_SYSTEM_JAVABASE",
    defaultSystemJavabaseDir != null
    ? defaultSystemJavabaseDir.toString()
    : javaHome.toString());

  8. meteorcloudy commented on Jun 5, 2018

    @meteorcloudy
    Member

    @buchgr Can you confirm the Windows setup for JAVA_HOME?

  9. cushon commented on Jun 5, 2018

    @cushon
    Contributor

    I saw there's some windows-specific JAVA_HOME handling, but I don't totally understand how it all fits together:

    Since both of the failing tests as python integration tests, maybe there's some setup that needs to handle for python tests that isn't currently happening? Maybe something needs to happen for py tests here?

    def _EnvMap(self, env_remove=None, env_add=None):

  10. meteorcloudy commented on Jun 6, 2018

    @meteorcloudy
    Member

    The JAVA_HOME set in bazel/src/test/shell/testenv.sh should be irrelevant to python tests.
    --test_env=JAVA_HOME will pass JAVA_HOME to all tests. But looks like we are not respecting it in test_base.py
    So, maybe adding a env['JAVA_HOME'] = TestBase.GetEnv('JAVA_HOME') will fix it?

  11. cushon commented on Jun 6, 2018

    @cushon
    Contributor

    @meteorcloudy thanks!

    I got the python tests passing on windows with this patch:

    diff --git a/src/test/py/bazel/test_base.py b/src/test/py/bazel/test_base.py
    index 5e279da9ef..f3c361a030 100644
    --- a/src/test/py/bazel/test_base.py
    +++ b/src/test/py/bazel/test_base.py
    @@ -360,7 +360,9 @@ class TestBase(unittest.TestCase):
               # TODO(pcloudy): Remove this after no longer need to debug
               # https://github.com/bazelbuild/bazel/issues/3273
               'CC_CONFIGURE_DEBUG':
    -              '1'
    +              '1',
    +          'JAVA_HOME':
    +              TestBase.GetEnv('JAVA_HOME'),
           }
         else:
           env = {'HOME': os.path.join(self._temp, 'home')}
    diff --git a/src/test/py/bazel/windows_remote_test.py b/src/test/py/bazel/windows_remote_test.py
    index fc9a03a139..5ffdc6434d 100644
    --- a/src/test/py/bazel/windows_remote_test.py
    +++ b/src/test/py/bazel/windows_remote_test.py
    @@ -203,7 +203,7 @@ class WindowsRemoteTest(test_base.TestBase):
     
         # Test.
         exit_code, stdout, stderr = self._RunRemoteBazel([
    -        'test', '--test_output=all', '--host_javabase=//foo:jdk8',
    +        'test', '--test_output=all',
             '--javabase=//foo:jdk8', '//foo:foo_test'
         ])
         self.AssertExitCode(exit_code, 0, stderr, stdout)
    

    @buchgr can you include that change in #5312?

  12. added a commit that references this issue on Jun 11, 2018
  13. laszlocsomor commented on Jul 3, 2018

    @laszlocsomor
    Contributor

    Can we close this bug?

  14. buchgr commented on Jul 3, 2018

    @buchgr
    ContributorAuthor

    Yep!

  15. added a commit that references this issue on Aug 2, 2018
  16. added a commit that references this issue on Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions