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

CI rules_nodejs is failing with bazel 0.10.0 RC1 #4421

Closed
iirina opened this issue Jan 10, 2018 · 9 comments
Closed

CI rules_nodejs is failing with bazel 0.10.0 RC1 #4421

iirina opened this issue Jan 10, 2018 · 9 comments
Labels
P1 I'll work on this now. (Assignee required)

Comments

@iirina
Copy link
Contributor

iirina commented Jan 10, 2018

rules_nodejs does not build on Windows. The reported error is:

FAILED: Build did NOT complete successfully

java.lang.IllegalArgumentException: Cannot create Unix-style paths on Windows.

	at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.getCachedChildPathInternalImpl(WindowsFileSystem.java:112)

	at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.access$300(WindowsFileSystem.java:85)

	at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory$1.getCachedChildPathInternal(WindowsFileSystem.java:100)

	at com.google.devtools.build.lib.vfs.Path.getCachedChildPath(Path.java:299)

	at com.google.devtools.build.lib.vfs.Path.getCanonicalPath(Path.java:682)

	at com.google.devtools.build.lib.vfs.Path.getRelative(Path.java:718)

	at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.relativize(OutputDirectoryLinksUtils.java:185)

	at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.getPrettyPath(OutputDirectoryLinksUtils.java:158)

	at com.google.devtools.build.lib.buildtool.BuildResultPrinter.formatArtifactForShowResults(BuildResultPrinter.java:161)

	at com.google.devtools.build.lib.buildtool.BuildResultPrinter.showBuildResult(BuildResultPrinter.java:100)

	at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:495)

	at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:258)

	at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:353)

	at com.google.devtools.build.lib.runtime.commands.RunCommand.processRequest(RunCommand.java:127)

	at com.google.devtools.build.lib.runtime.commands.RunCommand.exec(RunCommand.java:166)

	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:489)

	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:218)

	at com.google.devtools.build.lib.runtime.CommandExecutor.exec(CommandExecutor.java:58)

	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:851)

	at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:109)

	at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:916)

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

	at java.lang.Thread.run(Thread.java:748)

java.lang.IllegalArgumentException: Cannot create Unix-style paths on Windows.

	at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.getCachedChildPathInternalImpl(WindowsFileSystem.java:112)

	at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.access$300(WindowsFileSystem.java:85)

	at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory$1.getCachedChildPathInternal(WindowsFileSystem.java:100)

	at com.google.devtools.build.lib.vfs.Path.getCachedChildPath(Path.java:299)

	at com.google.devtools.build.lib.vfs.Path.getCanonicalPath(Path.java:682)

	at com.google.devtools.build.lib.vfs.Path.getRelative(Path.java:718)

	at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.relativize(OutputDirectoryLinksUtils.java:185)

	at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.getPrettyPath(OutputDirectoryLinksUtils.java:158)

	at com.google.devtools.build.lib.buildtool.BuildResultPrinter.formatArtifactForShowResults(BuildResultPrinter.java:161)

	at com.google.devtools.build.lib.buildtool.BuildResultPrinter.showBuildResult(BuildResultPrinter.java:100)

	at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:495)

	at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:258)

	at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:353)

	at com.google.devtools.build.lib.runtime.commands.RunCommand.processRequest(RunCommand.java:127)

	at com.google.devtools.build.lib.runtime.commands.RunCommand.exec(RunCommand.java:166)

	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:489)

	at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:218)

	at com.google.devtools.build.lib.runtime.CommandExecutor.exec(CommandExecutor.java:58)

	at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:851)

	at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:109)

	at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:916)

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

	at java.lang.Thread.run(Thread.java:748)

script returned exit code 37

The entire console output is here.

This is blocking the 0.10.0 release (#3958).

@jin
Copy link
Member

jin commented Jan 11, 2018

This is a hard crash on Windows. @meteorcloudy @laszlocsomor any ideas?

@laszlocsomor
Copy link
Contributor

I'll take a look.

@laszlocsomor
Copy link
Contributor

Repro'd locally using 0.10.0rc1:

C:\work\rules_nodejs>c:\work\bazel-releases\0.10.0\rc1\bazel.exe --output_user_root=c:\tmp4 run @yarn//:yarn
Extracting Bazel installation...
.......................
DEBUG: C:/tmp4/4lb88amd/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: 'BAZEL_VC' is not set, start looking for the latest Visual C++ installed.
DEBUG: C:/tmp4/4lb88amd/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Looking for VS%VERSION%COMNTOOLS environment variables,eg. VS140COMNTOOLS
DEBUG: C:/tmp4/4lb88amd/external/bazel_tools/tools/cpp/lib_cc_configure.bzl:37:3:
Auto-Configuration Warning: Visual C++ build tools found at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\
INFO: Analysed target @yarn//:yarn (8 packages loaded).
INFO: Found 1 target...
Target @yarn//:yarn up-to-date:
Unhandled exception thrown during build; message: Cannot create Unix-style paths on Windows.
INFO: Elapsed time: 79.336s, Critical Path: 0.02s
FAILED: Build did NOT complete successfully
java.lang.IllegalArgumentException: Cannot create Unix-style paths on Windows.
        at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.getCachedChildPathInternalImpl(WindowsFileSystem.java:112)
        at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.access$300(WindowsFileSystem.java:85)
        at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory$1.getCachedChildPathInternal(WindowsFileSystem.java:100)
        at com.google.devtools.build.lib.vfs.Path.getCachedChildPath(Path.java:299)
        at com.google.devtools.build.lib.vfs.Path.getCanonicalPath(Path.java:682)
        at com.google.devtools.build.lib.vfs.Path.getRelative(Path.java:718)
        at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.relativize(OutputDirectoryLinksUtils.java:185)
        at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.getPrettyPath(OutputDirectoryLinksUtils.java:158)
        at com.google.devtools.build.lib.buildtool.BuildResultPrinter.formatArtifactForShowResults(BuildResultPrinter.java:161)
        at com.google.devtools.build.lib.buildtool.BuildResultPrinter.showBuildResult(BuildResultPrinter.java:100)
        at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:495)
        at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:258)
        at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:353)
        at com.google.devtools.build.lib.runtime.commands.RunCommand.processRequest(RunCommand.java:127)
        at com.google.devtools.build.lib.runtime.commands.RunCommand.exec(RunCommand.java:166)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:489)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:218)
        at com.google.devtools.build.lib.runtime.CommandExecutor.exec(CommandExecutor.java:58)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:851)
        at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:109)
        at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:916)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
java.lang.IllegalArgumentException: Cannot create Unix-style paths on Windows.
        at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.getCachedChildPathInternalImpl(WindowsFileSystem.java:112)
        at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory.access$300(WindowsFileSystem.java:85)
        at com.google.devtools.build.lib.windows.WindowsFileSystem$WindowsPathFactory$1.getCachedChildPathInternal(WindowsFileSystem.java:100)
        at com.google.devtools.build.lib.vfs.Path.getCachedChildPath(Path.java:299)
        at com.google.devtools.build.lib.vfs.Path.getCanonicalPath(Path.java:682)
        at com.google.devtools.build.lib.vfs.Path.getRelative(Path.java:718)
        at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.relativize(OutputDirectoryLinksUtils.java:185)
        at com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils.getPrettyPath(OutputDirectoryLinksUtils.java:158)
        at com.google.devtools.build.lib.buildtool.BuildResultPrinter.formatArtifactForShowResults(BuildResultPrinter.java:161)
        at com.google.devtools.build.lib.buildtool.BuildResultPrinter.showBuildResult(BuildResultPrinter.java:100)
        at com.google.devtools.build.lib.buildtool.ExecutionTool.executeBuild(ExecutionTool.java:495)
        at com.google.devtools.build.lib.buildtool.BuildTool.buildTargets(BuildTool.java:258)
        at com.google.devtools.build.lib.buildtool.BuildTool.processRequest(BuildTool.java:353)
        at com.google.devtools.build.lib.runtime.commands.RunCommand.processRequest(RunCommand.java:127)
        at com.google.devtools.build.lib.runtime.commands.RunCommand.exec(RunCommand.java:166)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:489)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:218)
        at com.google.devtools.build.lib.runtime.CommandExecutor.exec(CommandExecutor.java:58)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:851)
        at com.google.devtools.build.lib.server.GrpcServerImpl.access$2100(GrpcServerImpl.java:109)
        at com.google.devtools.build.lib.server.GrpcServerImpl$2.lambda$run$0(GrpcServerImpl.java:916)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Server terminated abruptly (error code: 14, error message: '', log file: 'c:\tmp4\4lb88amd/server/jvm.out')

I'll look for the culprit.

@laszlocsomor
Copy link
Contributor

Culprit: https://github.com/bazelbuild/rules_nodejs/blob/8c11abc21a96a5305004307e3d98f1d05985ac75/tools/bazel.rc#L2

Bazel picks up this bazelrc because it's in the //tools directory.
(This is a legacy from Blaze; the global blazerc in the internal depot is also under //tools.)

The build succeeds with --symlink_prefix= using Bazel 0.10.0rc1.
Strangely the build succeeds even with --symlink_prefix= using Bazel 0.9.0, so this is indeed a regression.

Next I'll find the commit that introduced the regression.

@meteorcloudy
Copy link
Member

I suspect 8b3ba50, where we move the MSYS path support to DependencySet, so Bazel isn't able to parse unix path on Windows.

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Jan 12, 2018

The culprit is 8b3ba50, which removed support for Unix-style paths on Windows. That is actually WAI.

That commit uncovered a latent bug: that Bazel doesn't actually special-case --symlink_prefix=/, even though the docs recommend that value to disable symlink creation. I think that recommendation relies on / being read-only on Unixes.

The solution is to special-case / and not attempt to create any symlinks, rather than relying on the filesystem permissions.

@iirina : This will need a bugfix and that you cherrypick it into 0.10.0

@iirina
Copy link
Contributor Author

iirina commented Jan 12, 2018

@laszlocsomor Noted. Thanks for looking into it.

@laszlocsomor
Copy link
Contributor

I found a very simple bugfix, sending for internal review.

@laszlocsomor
Copy link
Contributor

@iirina , fix is pushed as e543674, please cherrypick into the RC!

iirina pushed a commit that referenced this issue Jan 15, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 15, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 18, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 19, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 23, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 24, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 26, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 26, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 30, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Jan 30, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
iirina pushed a commit that referenced this issue Feb 12, 2018
Fixes #4421

RELNOTES: none
PiperOrigin-RevId: 181742216
werkt pushed a commit to werkt/bazel that referenced this issue Mar 2, 2018
Fixes bazelbuild#4421

RELNOTES: none
PiperOrigin-RevId: 181742216
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    Fixes bazelbuild/bazel#4421

    RELNOTES: none
    PiperOrigin-RevId: 181742216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required)
Projects
None yet
Development

No branches or pull requests

4 participants