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

staticcheck: Support for Go 1.22 #43

Closed
ewhauser opened this issue Apr 26, 2024 · 2 comments
Closed

staticcheck: Support for Go 1.22 #43

ewhauser opened this issue Apr 26, 2024 · 2 comments

Comments

@ewhauser
Copy link

When switching to Go 1.22, I get the following errors compiling nogo on MacOS:

ERROR: /Users/ewhauser/working/cadencerpm/monorepo/go/BUILD.bazel:8:5: GoLink go/nogo_actual_/nogo_actual [for tool] failed: (Exit 1): sandbox-exec failed: error execut11:42:38 [727/1906]
  (cd /private/var/tmp/_bazel_ewhauser/c1fee43d9f70be2c9377b78115996411/sandbox/darwin-sandbox/11292/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=14.2 \
    CGO_ENABLED=1 \
    DEVELOPER_DIR=/Applications/XCode.app/Contents/Developer \
    GOARCH=arm64 \
    GOEXPERIMENT=nocoverageredesign \
    GOOS=darwin \
    GOPATH='' \
    GOROOT=bazel-out/darwin_arm64-opt-exec-ST-13d3ddad9198/bin/external/io_bazel_rules_go/stdlib_ \
    GOROOT_FINAL=GOROOT \
    GOTOOLCHAIN=local \
    PATH=external/local_config_apple_cc:/bin:/usr/bin \
    RELATIVE_AST_PATH=true \
    SDKROOT=/Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk \
    TMPDIR=/var/folders/rl/v9dqv4mx1jsgwx81qjy74scc0000gn/T/ \
    XCODE_VERSION_OVERRIDE=15.2.0.15C500b \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_ewhauser/c1fee43d9f70be2c9377b78115996411/sandbox/darwin-sandbox/11292/sandbox.sb /var/tmp/_bazel_ewhauser/install/c235141d88c168b049a19
1acefbb1f54/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_ewhauser/c1fee43d9f70be2c9377b78115996411/sandbox/darwin-sandbox/11292/stats.out' bazel-out/da
rwin_arm64-opt-exec-ST-1a88b5d644a4/bin/external/go_sdk/builder_reset/builder '-param=bazel-out/darwin_arm64-opt-exec-ST-1a88b5d644a4/bin/go/nogo_actual_/nogo_actual-0.params' -- -extld e
xternal/local_config_apple_cc/cc_wrapper.sh '-buildid=redacted' -s -w -extldflags '-Wl,-oso_prefix,__BAZEL_EXECUTION_ROOT__/ -headerpad_max_install_names -no-canonical-prefixes -target ar
m64-apple-macosx14.2 -fobjc-link-runtime -dead_strip -framework Foundation -Wl,-no_warn_duplicate_libraries')
runtime/cgo(__TEXT/__text): relocation target pthread_sigmask not defined
runtime/cgo(__TEXT/__text): relocation target pthread_self not defined
runtime/cgo(__TEXT/__text): relocation target pthread_get_stacksize_np not defined
runtime/cgo(__TEXT/__text): relocation target pthread_attr_init not defined
runtime/cgo(__TEXT/__text): relocation target pthread_attr_setstacksize not defined
runtime/cgo(__TEXT/__text): relocation target free not defined
runtime/cgo(__TEXT/__text): relocation target __stderrp not defined
runtime/cgo(__TEXT/__text): relocation target strerror not defined
runtime/cgo(__TEXT/__text): relocation target fprintf not defined
runtime/cgo(__TEXT/__text): relocation target abort not defined
runtime/cgo(__TEXT/__text): relocation target pthread_create not defined
runtime/cgo(__TEXT/__text): relocation target nanosleep not defined
runtime/cgo(__TEXT/__text): relocation target pthread_detach not defined
runtime/cgo(__TEXT/__text): relocation target pthread_mutex_lock not defined
runtime/cgo(__TEXT/__text): relocation target pthread_cond_wait not defined
runtime/cgo(__TEXT/__text): relocation target pthread_key_create not defined
runtime/cgo(__TEXT/__text): relocation target pthread_mutex_unlock not defined
runtime/cgo(__TEXT/__text): relocation target __stderrp not defined
runtime/cgo(__TEXT/__text): relocation target fprintf not defined

Removing staticcheck(ANALYZERS) from my nogo dependencies solves the issue.

@ewhauser
Copy link
Author

ewhauser commented May 4, 2024

This also appears to be affecting Gazelle: bazelbuild/bazel-gazelle#1793

@sluongng
Copy link
Owner

sluongng commented May 4, 2024

This is not a problem with staticcheck afaik. It's a problem with Uber Zig toolchain. uber/hermetic_cc_toolchain#171

In https://github.com/buildbuddy-io/buildbuddy we are using staticcheck with nogo and 1.22 without any issue.

@sluongng sluongng closed this as completed May 4, 2024
@sluongng sluongng closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2024
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

2 participants