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

_ksp_compiler_plugin_repository_impl Fails on Windows #1193

Open
Poligun opened this issue Jul 10, 2024 · 6 comments
Open

_ksp_compiler_plugin_repository_impl Fails on Windows #1193

Poligun opened this issue Jul 10, 2024 · 6 comments

Comments

@Poligun
Copy link

Poligun commented Jul 10, 2024

First of all I think we should check the exec_result at this line since it's quite common that mv would fail.

        result = repository_ctx.execute(args, quiet = False)
        if result.return_code != 0:
            fail("Failed to move jar: %s" % result.stderr)

Now if I run bazel build //kotlin/compiler:symbol-processing-api, the error I got after adding the lines above:

Error in fail: Failed to move jar: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("mv" com/google/devtools/ksp/symbol-processing/1.9.23-1.0.20/symbol-processing-1.9.23-1.0.20.jar symbol-processing.jar): The system cannot find the file specified.

The issue not reproducible on MacOS or on Linux.

@esm-p
Copy link

esm-p commented Sep 20, 2024

@restingbull I still receive the following error with rules_kotlin version 1.9.6:
ERROR: D:/bazel_tmp/33apilyc/external/rules_kotlin/kotlin/compiler/BUILD.bazel:23:17: no such target '@com_github_google_ksp//:symbol-processing-cmdline.jar': target 'symbol-processing-cmdline.jar' not declared in package '' defined by D:/bazel_tmp/33apilyc/external/com_github_google_ksp/BUILD.bazel (Tip: use query "@com_github_google_ksp//:*" to see all the targets in that package) and referenced by '@rules_kotlin//kotlin/compiler:symbol-processing-cmdline'

Is there something that needs to be done to get this issue resolved?
I am using windows 10 22H2

@restingbull restingbull reopened this Sep 20, 2024
@restingbull
Copy link
Collaborator

Interesting. It must not be related to the symlink, as that code path is unused.

@esm-p
Copy link

esm-p commented Sep 25, 2024

Tested this also on windows 11. First it did work, but after updating to version 23H2 it throws the same error again.

@esm-p
Copy link

esm-p commented Oct 21, 2024

Hi @restingbull, is there any update on this topic?

@restingbull
Copy link
Collaborator

restingbull commented Oct 21, 2024

Given that it worked before the 23H2 update, and I have yet to repro it myself, I'm afraid it exists as an exercise for the user. I'd suggest ensuring the bazel cache is clean and shutdown.

The revised implementation does not rely on any bash functions... meaning any error may be a bazel bug. I'll give it another round, but I do not have a clear understanding why windows fails.

@esm-p
Copy link

esm-p commented Nov 13, 2024

I did now also receive this error when running ubuntu 22.04 within WSL2. So this seems not to be caused by windows. I have not changed anything within my project, so bazel and rules_kotlin version stayed the same.

Is it possible to get rid of the KSP? I dont even need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants