google / perf_data_converter

Tool to convert Linux perf files to the profile.proto format used by pprof
BSD 3-Clause "New" or "Revised" License
295 stars 55 forks source link

failed to compile in linux environment #133

Open xujihui1985 opened 1 year ago

xujihui1985 commented 1 year ago

bazel version: 3.5.0

/root/.cache/bazel/_bazel_root/a08c2e4811c846650b733c6fc815a920/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in ERROR: /root/.cache/bazel/_bazel_root/a08c2e4811c846650b733c6fc815a920/external/boringssl/BUILD:203:11: @platforms//os:linux is not a valid configuration key for @boringssl//:crypto

cc_library( name = "crypto", srcs = crypto_sources + crypto_internal_headers + crypto_sources_asm, hdrs = crypto_headers + fips_fragments, copts = boringssl_copts_c11, includes = ["src/include"], linkopts = select({

Android supports pthreads, but does not provide a libpthread

    # to link against.
    "@platforms//os:android": [],
    "@platforms//os:macos": [],
    "@platforms//os:ios": [],
    "@platforms//os:tvos": [],
    "@platforms//os:watchos": [],
    "@platforms//os:windows": ["-defaultlib:advapi32.lib"],
    "//conditions:default": ["-lpthread"],
}),
visibility = ["//visibility:public"],

)

shantuo commented 1 year ago

I can't reproduce this, could you provide a bit more on which command you were running?

bazel build src:all
bazel build src/quipper:all

both succeeds for me. I also have bazel version 5.3.2. Could you try to update your bazel and see if that works?

GavinRay97 commented 1 year ago

I also get compile errors, FWIW:

/usr/bin/ccache: invalid option -- 'U'

This is with bazelisk/bazel version 6.0:

EDIT: Nevermind, I think this is something broken with ccache and not an issue with the build, as I'm seeing the below now too:

ccache: error: Failed to create temporary file for /home/user/.cache/ccache/tmp/inode-cache-64.v1.tmp.eVaABr.tmp: Read-only file system
[user@MSI perf_data_converter]$ bazelisk --version
bazel 6.0.0
[user@MSI perf_data_converter]$ bazelisk build src:perf_to_profile
INFO: Analyzed target //src:perf_to_profile (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/user/.cache/bazel/_bazel_user/ca4327f72acbaba3e49bb9ab64aaca71/external/com_google_protobuf/BUILD:155:11: Compiling src/google/protobuf/generated_message_tctable_lite.cc [for tool] failed: (Exit 1): ccache failed: error executing command (from target @com_google_protobuf//:protobuf_lite) /usr/bin/ccache -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 ... (remaining 33 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/usr/bin/ccache: invalid option -- 'U'
ERROR: /home/user/.cache/bazel/_bazel_user/ca4327f72acbaba3e49bb9ab64aaca71/external/com_google_protobuf/BUILD:155:11: Compiling src/google/protobuf/stubs/bytestream.cc [for tool] failed: (Exit 1): ccache failed: error executing command (from target @com_google_protobuf//:protobuf_lite) /usr/bin/ccache -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 ... (remaining 33 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/usr/bin/ccache: invalid option -- 'U'
Target //src:perf_to_profile failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.148s, Critical Path: 0.06s
INFO: 20 processes: 20 internal.
FAILED: Build did NOT complete successfully
alex88 commented 1 year ago

I have the same problem on popOS but with windows in the error:

ERROR: /root/.cache/bazel/_bazel_root/ae8fea7311d419a0748ee3b71cb69bba/external/boringssl/BUILD:133:11: @platforms//os:windows is not a valid configuration key for @boringssl//:crypto
ERROR: Analysis of target '//src:perf_to_profile' failed; build aborted: Analysis failed
INFO: Elapsed time: 8.269s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (21 packages loaded, 632 targets configured)

Easily reproducible by running a docker container ubuntu:latest, installing the deps in the readme and bazel-bootstrap and running bazel build src:perf_to_profile

UPDATE: installing latest bazel via bazelisk fixed it

admiyo commented 12 months ago

On a x86_64 Ubuntu 22.04.3 LTS (x86_64)

bazel build src:perf_to_profile DEBUG: Rule 'boringssl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "ea58709ddfa7d2c63627abc2127471962a3cb4f33f96d246efbc4f832900a720" DEBUG: Repository boringssl instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule http_archive defined at: /home/ayoung/.cache/bazel/_bazel_ayoung/baa21aa92728e2469fe19f438390c93e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in ERROR: /home/ayoung/.cache/bazel/_bazel_ayoung/baa21aa92728e2469fe19f438390c93e/external/boringssl/BUILD:133:11: @platforms//os:windows is not a valid configuration key for @boringssl//:crypto DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "7372397031f356341e932c4b0489489e4111152fc3a9e03660ede951e9b2d84d" DEBUG: Repository com_google_protobuf instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule http_archive defined at: /home/ayoung/.cache/bazel/_bazel_ayoung/baa21aa92728e2469fe19f438390c93e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: Rule 'rules_python' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "4eaf5193ac92b198fd8c3e25d60b9469918be93bd780a32fc05935fc64eef9da" DEBUG: Repository rules_python instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule http_archive defined at: /home/ayoung/.cache/bazel/_bazel_ayoung/baa21aa92728e2469fe19f438390c93e/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in ERROR: Analysis of target '//src:perf_to_profile' failed; build aborted: Analysis failed INFO: Elapsed time: 0.039s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\ igured)

shantuo commented 12 months ago

Does updating Bazel work for you?

haohanyuzmx commented 8 months ago

I use docker to compile it, and get error

image