Open kschzt opened 7 months ago
Maybe got a bit further, but still failling
kschzt@LAPTOP-7EEIPMUM UCRT64 /c/src/reclient
$ bazel.exe build -s --verbose_failures //cmd/...
INFO: Repository io_opencensus_go_contrib_exporter_stackdriver instantiated at:
C:/src/reclient/WORKSPACE:336:14: in <toplevel>
Repository rule go_repository defined at:
C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/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:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/external/bazel_gazelle/internal/go_repository.bzl", line 311, column 10, in _go_repository_impl
patch(ctx)
File "C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/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:
ERROR: C:/src/reclient/WORKSPACE:336:14: fetching go_repository rule //external:io_opencensus_go_contrib_exporter_stackdriver: Traceback (most recent call last):
File "C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/external/bazel_gazelle/internal/go_repository.bzl", line 311, column 10, in _go_repository_impl
patch(ctx)
File "C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/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:
INFO: Repository go_googleapis instantiated at:
C:/src/reclient/WORKSPACE:166:22: in <toplevel>
C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/external/io_bazel_rules_go/go/private/repositories.bzl:247:12: in go_rules_dependencies
C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/external/io_bazel_rules_go/go/private/repositories.bzl:297:18: in _maybe
Repository rule http_archive defined at:
C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/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:/src/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:
ERROR: Analysis of target '//cmd/metricsuploader:metricsuploader_lib' failed; build aborted:
INFO: Elapsed time: 2.602s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (13 packages loaded, 192 targets configured)
Fetching C:/msys64/home/kschzt/_bazel_kschzt/sd2lufjt/external/go_googleapis; Extracting 53377c165584e84c410a0905d9effb3fe5df2806.zip
Fetching repository @com_github_google_pprof; running Gazelle
Fetching repository @org_golang_google_api; starting
Fetching repository @llvm-project; starting
Fetching repository @com_github_karrick_godirwalk; running Gazelle
I tried to reproduce this on my machine, but I've so far not been able to hit an error in applying the patch.
Also, I just wanted to comment on:
This is after installing GNU patch and hardcoding the Python3 path:
The .bazelrc
file is setup to work with msys2 / mingw64 version of tools (and this is also what I tested with). This is a remote possibility, but do you refer to https://packages.msys2.org/package/patch when you say GNU patch
tool? https://packages.msys2.org/package/patch is what we use in our setup for applying the patches.
I have reproduced the patch crash building with mysys2/mingw64. Pasting Dockerfile for reference:
FROM mcr.microsoft.com/windows/servercore:ltsc2022
RUN reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
RUN powershell `
Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Required for building the Goma client.
RUN choco install -y visualstudio2019buildtools `
&& choco install -y visualstudio2019-workload-vctools --params "--no-includeRecommended --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348" `
&& "C:\ProgramData\Package Cache\{63ca8fb0-603f-4442-aa8b-48659a9338f5}\winsdksetup.exe" /features OptionId.WindowsDesktopDebuggers /q /norestart
RUN choco install -y git `
&& "C:\Program Files\Git\cmd\git.exe" config --system core.autocrlf false `
&& "C:\Program Files\Git\cmd\git.exe" config --system core.longpaths true
RUN choco install -y bazelisk
RUN choco install -y python3
RUN choco install -y msys2 && del /f /s /q "C:\$Recycle.Bin" `
&& C:\tools\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm base-devel mingw-w64-x86_64-gcc" `
&& setx /M PATH "C:\tools\msys64\usr\bin;%PATH%;C:\tools\msys64\mingw64\bin"
# HACK: Copy the MINGW64 DLLs to the Windows system directory. This is required
# for the Protobuf compiler to work, since it uses the MINGW64 toolchain.
RUN cd /d C:\tools\msys64\mingw64\bin `
&& copy libwinpthread-1.dll C:\Windows\System32\ `
&& copy "libstdc++-6.dll" C:\Windows\System32\ `
&& copy libgcc_s_seh-1.dll C:\Windows\System32\
looking into it. @gkousik is there a reference windows build that you would be willing to share?
full traceback:
ERROR: An error occurred during the fetch of repository 'io_opencensus_go_contrib_exporter_stackdriver':
Traceback (most recent call last):
File "C:/users/t-danielsu/_bazel_t-danielsu/sd2lufjt/external/bazel_gazelle/internal/go_repository.bzl", line 311, column 10, in _go_repository_impl
patch(ctx)
File "C:/users/t-danielsu/_bazel_t-danielsu/sd2lufjt/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:
<3>WSL (549) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (549) ERROR: CreateProcessEntryCommon:508: Create process not expected to return
ERROR: C:/src/reclient/WORKSPACE:372:14: fetching go_repository rule //external:io_opencensus_go_contrib_exporter_stackdriver: Traceback (most recent call last):
File "C:/users/t-danielsu/_bazel_t-danielsu/sd2lufjt/external/bazel_gazelle/internal/go_repository.bzl", line 311, column 10, in _go_repository_impl
patch(ctx)
File "C:/users/t-danielsu/_bazel_t-danielsu/sd2lufjt/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:
<3>WSL (549) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (549) ERROR: CreateProcessEntryCommon:508: Create process not expected to return
ERROR: C:/src/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:
<3>WSL (549) ERROR: CreateProcessEntryCommon:505: execvpe /bin/bash failed 2
<3>WSL (549) ERROR: CreateProcessEntryCommon:508: Create process not expected to return
@kschzt did you ever find a resolution?
Building with bazelisk on Windows 11 in git bash. This is after installing GNU
patch
and hardcoding the Python3 path: