bazel-contrib / bazel-contrib/rules_go

gcc failed: error executing command,how to solve?

Open
#3,689 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

When I execute bazel build..., the following error is reported:

gcc failed: error executing command (from target @com_google_protobuf//:protoc_lib) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 41 arguments skipped)

![image](https://github.com/bazelbuild/rules_go/assets/23255488/4558fec3-723c-42a0-b650-d86b69448c64)

I have gcc installed on my server, the version is as follows:

![image](https://github.com/bazelbuild/rules_go/assets/23255488/032b04bc-5989-444e-8bac-b8bcb623fd84)

### What version of rules_go are you using?

v0.40.1

### What version of gazelle are you using?

v0.31.0

### What version of Bazel are you using?

bazel 6.3.2

### Does this issue reproduce with the latest releases of all the above?

### What operating system and processor architecture are you using?

### Any other potentially useful information about your toolchain?

my com_google_protobuf version is v3.14.0
The content is as follows:

http_archive(
name = "com_google_protobuf",
sha256 = "d0f5f605d0d656007ce6c8b5a82df3037e1d8fe8b121ed42e536f569dec16113",
strip_prefix = "protobuf-3.14.0",
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

### What did you do?

I want to use bazel to compile golang project

### What did you expect to see?

### What did you see instead?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Bazel build and capture the complete error for target @com_google_protobuf//:protoc_lib, including the omitted arguments and the operating system and processor architecture. Check the configured /usr/bin/gcc toolchain and the stated protobuf v3.14.0 dependency; done means identifying a reproducible cause and a verified build fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.