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

[remote][windows]tries to create temp folder in C:\Windows #23466

Closed
p00f opened this issue Aug 29, 2024 · 5 comments
Closed

[remote][windows]tries to create temp folder in C:\Windows #23466

p00f opened this issue Aug 29, 2024 · 5 comments
Assignees
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team type: support / not a bug (process)

Comments

@p00f
Copy link

p00f commented Aug 29, 2024

Description of the bug:

When building using remote execution with a linux "client" and windows "server", bazel tries to create a temporary directory in C:\Windows and fails because it doesn't have permissions

Which category does this issue belong to?

Remote execution

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

sorry, i can't share the toolchain because it's work
.bazelrc:

# disable default C++ toolchains. we always provide our own!
common --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

# enable platform-based toolchain resolution
build --incompatible_enable_cc_toolchain_resolution

# disable bzlmod because we use WORKSPACE
common --noenable_bzlmod

# turn off sandboxing because a dependency we use doesn't build
build --spawn_strategy=local

extra .remote.rc for remote execution:

build --enable_platform_specific_config
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
build:remote --spawn_strategy=remote
build:remote --define=EXECUTOR=remote
build:remote --extra_execution_platforms=//toolchains/mingw:windows_platform
build:remote --host_platform=//toolchains/mingw:windows_platform
build:remote --remote_executor=grpc://192.168.99.1:8080
build --remote_instance_name=main
build:remote --remote_timeout=3600
build:remote --auth_enabled=false
build --experimental_platform_in_output_dir

client command:
bazelisk --bazelrc=.remote.rc build //foo/bar:bar --config=remote --verbose_failures

server command: i built the worker (src/tools/remote:worker from this repo) then ran it like this:
bazel-bin/src/tools/remote/worker.exe --listen_port=8080 --work_path=C:\Users\username\bazel-remote-work --debug --cas_path=C:\Users\username\bazel-remote-cas --jobs=10 --remote_download_all

Which operating system are you running Bazel on?

linux on the client, windows on the server

What is the output of bazel info release?

7.1.1 on the client (we use bazelisk), 7.1.2 on the server inside the bazel repository which built the worker

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

N/A

What's the output of git remote get-url origin; git rev-parse HEAD ?

https://github.com/bazelbuild/bazel.git
5caacf1130c95d93adf79cd947c307441c14504e

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

N/A

Have you found anything relevant by searching the web?

there's a similar issue #1243

Any other information, logs, or outputs that you want to share?

N/A

@p00f p00f changed the title tries to create temp folder in [remote][windows]tries to create temp folder in C:\Windows Aug 29, 2024
@sgowroji sgowroji added more data needed team-Remote-Exec Issues and PRs for the Execution (Remote) team labels Aug 29, 2024
@sgowroji
Copy link
Member

Hi @p00f, Could you please provide complete steps to reproduce this issue?

@p00f
Copy link
Author

p00f commented Aug 29, 2024

@sgowroji done, i pressed enter by mistake without filling it out

@p00f
Copy link
Author

p00f commented Aug 29, 2024

also

  • it tries to concatenate something on windows to my linux PATH
  • PWD is /proc/self/PWD instead of whatever it is on windows
ERROR: repo/foo/bar/BUILD:18:10: Compiling foo/bar.cpp failed: (Exit -1073740791): g++.exe failed: error executing CppCompile command (from target //foo/bar:bar)
  (cd <execroot>/foo && \
  exec env - \
    PATH=C:/bazel/downloads/sha256/d93508529d41136065c7b1e5ff555fbfb9d18fd00e768886f2fc7dfb53b05b43/bin:<PATH_on_linux> \
    PWD=/proc/self/cwd \
  external/mingw64_10_0_0_rev0/bin/g++.exe @bazel-out/windows_platform-fastbuild/bin/foo/bar/_objs/bar/bar.o.params)
# Configuration: a14686e87bbf0bcaba60e475eef17625015dfe5ed3493d9cd8ae680f77215f10
# Execution platform: //toolchains/mingw:windows_platform
Cannot create temporary file in C:\WINDOWS\: Permission denied
Target //foo/bar:bar failed to build
INFO: Elapsed time: 20.239s, Critical Path: 19.41s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully

@p00f
Copy link
Author

p00f commented Aug 29, 2024

i'm open to trying other tools - i tried nativelink but it fails to find the params file:

TraceMachina/nativelink#485 (comment)

@tjgq
Copy link
Contributor

tjgq commented Sep 10, 2024

I do not recommend using //src/tools/remote:worker. It's not a production-quality implementation, it's only meant to be used by Bazel's own integration tests. I encourage you to choose one of the options from https://bazel.build/community/remote-execution-services.

Please ask questions about them on their respective support channels. If you're unsure about which one is appropriate for your use case, asking for advice on the Bazel Slack channel might also be worthwhile.

@tjgq tjgq closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Remote-Exec Issues and PRs for the Execution (Remote) team type: support / not a bug (process)
Projects
None yet
Development

No branches or pull requests

5 participants