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

LocalErrorResultStatus: path to windows SDK is not under out/Platform-win #34

Open
ekamwalia opened this issue Mar 5, 2024 · 3 comments

Comments

@ekamwalia
Copy link

ekamwalia commented Mar 5, 2024

Hello folks!

I am working on setting up buildfarm with reclient to build chromium. My req is to build chromium for windows. Hoping one of you wizards here can point me in the right direction.

My setup is as follows:

  • buildfarm-server running as java binary and redis running in the docker container on a linux VM.
  • Buildfarm-worker running as a java binary on a windows VM (since my requirement is to build on windows. Hoping to avoid the struggles of cross compiling just yet.
  • running chromium build using reclient from my windows desktop.
  • All VMs can connect with each other. The redis key Workers_execute shows the worker correctly.
  • I was able to run the quick start example from the docs so the setup itself is probably fine.

When I try to run the chromium build command with the recommended args, I see the following error. I think the error is happening because even though I am setting exec_root to C:\ in my rewrapper_windows.cfg config file taking reference from #23 (as confirmed in the rewrapper.info log file attached and the command arg --exec_root:C: in the log just below), when the commands are finally executed, the exec_root changes which out/Platform-win which is build output directory I am passing in my gn comand.

[20/58036] CXX obj/base/base_static/static_constants.obj
FAILED: obj/base/base_static/static_constants.obj 

..\..\buildtools\reclient\rewrapper -cfg=C:\Users\riturajs.CITRITE\chromium\src\buildtools\reclient_cfgs\linux\chromium-browser-clang\rewrapper_linux.cfg -exec_root=C: -labels=type=compile,compiler=clang-cl,lang=cpp  <args hidden for brevity, full command in logs>

reclient[c55e4b8e-3e51-4b71-90e7-f71d8c5bf70b]: LocalErrorResultStatus: path C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130\include is not under C:\Users\riturajs.CITRITE\chromium\src\out\Platform-win

My reproxy.cfg is

service=<Server IP>:8980
log_format=text
server_address=pipe://reproxy.ipc
service_no_auth=true
service_no_security=true
v=3
proxy_log_dir=<User Home>\chromium\src\buildtools\reclient\logs\

The rewrapper.cfg is

server_address=pipe://reproxy.ipc
labels=type=compile,compiler=clang,lang=cpp
exec_strategy=remote_local_fallback
dial_timeout=10m
exec_timeout=2m
reclient_timeout=2m
canonicalize_working_dir=true
exec_strategy=remote
v=3
log_env=true
exec_root=C:\
inputs:./Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.38.33130/include

The GN command which is executed is

gn gen out/Platform-win --args="blink_symbol_level=0 symbol_level=2 enable_nacl=false is_component_build=false is_debug=false target_cpu=\"x86\" target_os=\"win\" automation_build=false enable_hangout_services_extension=true disable_fieldtrial_testing_config=true target_os_only=\"True\" target_cpu_only=\"True\" "

Logs - logs.zip

Could someone here take a look and share any pointers on how to fix this?

@yehia996
Copy link

yehia996 commented Mar 7, 2024

Thank you

@MikeS-rec
Copy link
Contributor

MikeS-rec commented Mar 12, 2024

So I had a look through the logs, and for some reason the exec root isn't getting set to C:\ as you have specified, it appears to actually be this (from reproxy.exe.INFO):

exec_root: "C:\Users\riturajs.CITRITE\chromium\src\out\Platform-win"

So if the exec_root isn't set, then reclient will default to using the working directory, which is what seems to be happening here. But I noticed you've got exec_root set to C: on the rewrapper command, so I'm not sure why the . I did notice in the environment logged in reproxy.exe.INFO there is this:

environment: "=C:=C:\\Users\\riturajs.CITRITE\\chromium\\src\\out\\Platform-win"

I'm not a windows expert, but this seems possibly suspicious. What does an environment variable like this do? It looks like it intends to replace C: with the output directory but I'm not sure if that is the case.

Anyway, you can try taking the exec_root setting out of the cfg file and explicitly setting it as a gn argument. Add the following to your args.gn (or redo the gn gen with this):

rbe_exec_root=c:/

Let me know if that does the trick, and I'll try and figure out why this isn't getting picked up properly in the first place.

@ekamwalia
Copy link
Author

Thank you for your investigation and sharing some fixes @MikeS-rec !

This didn't resolve the issue either however, we still see the same error. In fact, we had already tried this taking a clue from #23 .

On the environment variable, I can't add a lot of windows insight either, not an expert, but I tried to see where its coming from and I noticed that

  1. It is not set in the system env vars, which suggests this is something being set during the build process , (maybe by gn/ninja)
  2. The env var has a value but not a name, which seems quite odd.

I tried to create a build of reclient with some additional logging to see whats happening in the rewrapper execution of the command, but when I try to build it for windows, I run into the following error. I think the issue is that in WSL the path for the file will be

/c/users/riturajs.citrite/reclient/third_party/patches/opencensus-go-exporter-stackdriver/opencensus-stackdriver-interval.patch

which is different from.

C:/Users/...

Do you know what needs to be done to be able to build reclient on windows?

PS C:\Users\riturajs.CITRITE\reclient> bazelisk build --config=goma //cmd/...
INFO: Repository io_opencensus_go_contrib_exporter_stackdriver instantiated at:
  C:/users/riturajs.citrite/reclient/WORKSPACE:351:14: in <toplevel>
Repository rule go_repository defined at:
  C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/bazel_gazelle/internal/go_repository.bzl:313:32: in <toplevel>
ERROR: An error occurred during the fetch of repository 'io_opencensus_go_contrib_exporter_stackdriver':
   Traceback (most recent call last):
        File "C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/bazel_gazelle/internal/go_repository.bzl", line 311, column 10, in _go_repository_impl
                patch(ctx)
        File "C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/bazel_gazelle/internal/go_repository.bzl", line 563, column 17, in patch
                fail("Error applying patch %s:\n%s%s" %
Error in fail: Error applying patch @//third_party/patches/opencensus-go-exporter-stackdriver:opencensus-stackdriver-interval.patch:
/bin/bash: line 1: C:/users/riturajs.citrite/reclient/third_party/patches/opencensus-go-exporter-stackdriver/opencensus-stackdriver-interval.patch: No such file or directory
ERROR: C:/users/riturajs.citrite/reclient/WORKSPACE:351:14: fetching go_repository rule //external:io_opencensus_go_contrib_exporter_stackdriver: Traceback (most recent call last):
        File "C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/bazel_gazelle/internal/go_repository.bzl", line 311, column 10, in _go_repository_impl
                patch(ctx)
        File "C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/bazel_gazelle/internal/go_repository.bzl", line 563, column 17, in patch
                fail("Error applying patch %s:\n%s%s" %
Error in fail: Error applying patch @//third_party/patches/opencensus-go-exporter-stackdriver:opencensus-stackdriver-interval.patch:
/bin/bash: line 1: C:/users/riturajs.citrite/reclient/third_party/patches/opencensus-go-exporter-stackdriver/opencensus-stackdriver-interval.patch: No such file or directory
INFO: Repository go_googleapis instantiated at:
  C:/users/riturajs.citrite/reclient/WORKSPACE:165:22: in <toplevel>
  C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/io_bazel_rules_go/go/private/repositories.bzl:247:12: in go_rules_dependencies
  C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/io_bazel_rules_go/go/private/repositories.bzl:297:18: in _maybe
Repository rule http_archive defined at:
  C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
INFO: repository @go_googleapis' used the following cache hits instead of downloading the corresponding file.
 * Hash '73831cbb41f2750f3181d126bbabcd3e58b5188e131ecbc309793fa54d5439c9' for https://mirror.bazel.build/github.com/googleapis/googleapis/archive/53377c165584e84c410a0905d9effb3fe5df2806.zip
If the definition of 'repository @go_googleapis' was updated, verify that the hashes were also updated.
ERROR: C:/users/riturajs.citrite/reclient/internal/pkg/monitoring/BUILD.bazel:3:11: //internal/pkg/monitoring:monitoring depends on @io_opencensus_go_contrib_exporter_stackdriver//:stackdriver in repository @io_opencensus_go_contrib_exporter_stackdriver which failed to fetch. no such package '@io_opencensus_go_contrib_exporter_stackdriver//': Error applying patch @//third_party/patches/opencensus-go-exporter-stackdriver:opencensus-stackdriver-interval.patch:
/bin/bash: line 1: C:/users/riturajs.citrite/reclient/third_party/patches/opencensus-go-exporter-stackdriver/opencensus-stackdriver-interval.patch: No such file or directory
ERROR: Analysis of target '//cmd/reproxy:reproxy' failed; build aborted:
INFO: Elapsed time: 4.310s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
    Fetching repository @org_golang_google_api; starting 4s
    Fetching repository @com_github_shirou_gopsutil; starting
    Fetching repository @goma; Cloning https://chromium.googlesource.com/infra/goma/client...
    Fetching C:/users/riturajs.citrite/_bazel_riturajs/wmsue5f3/external/go_googleapis; Extracting 53377c165584e84c410a0905d9effb3fe5df2806.zip

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

No branches or pull requests

3 participants