You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to generate a compile_commands.json compilation database using the ./xls/dev_tools/make-compilation-db.sh script fails with the following error:
> ./xls/dev_tools/make-compilation-db.sh
Target //xls/public:libxls.dylib failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: Analysis of target '//xls/public:libxls.dylib' failed; build aborted: Target //xls/public:libxls.dylib is incompatible and cannot be built, but was explicitly requested.
Dependency chain:
//xls/public:libxls.dylib (501e77) <-- target platform (@@internal_platforms_do_not_use//host:host) didn't satisfy constraint @@platforms//:incompatible
INFO: Elapsed time: 0.755s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
Traceback (most recent call last):
File "/home/schilkp/.cache/bazel/_bazel_schilkp/e4cc209945c2029dba88a1739abf7043/external/com_grail_bazel_compdb/generate.py", line 107, in <module>
subprocess.check_call(build_cmd, stdout=subprocess.DEVNULL)
File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['bazel', 'build', '--override_repository=bazel_compdb=/home/schilkp/.cache/bazel/_bazel_schilkp/e4cc209945c2029dba88a1739abf7043/external/com_grail_bazel_compdb', '--aspects=@bazel_compdb//:aspects.bzl%compilation_database_aspect', '--noshow_progress', '--noshow_loading_progress', '--output_groups=compdb_files,header_files', '--target_pattern_file=/tmp/tmpv4osak4u']' returned non-zero exit status 1.
It seems that target platform constraints are causing problems with the dylib (OSX) target for the public API (only?) when bazel is invoked by said script.
This is unfortunately the known current state given the tool we use to create the compilation database.
Your workaround is what I personally do also on Linux :)
There are various tools that allow for creating a compilation database, and the one we're using is not maintained anymore. There are newer ones (e.g. hedronvision) that we have to explore.
Describe the bug
Attempting to generate a
compile_commands.json
compilation database using the./xls/dev_tools/make-compilation-db.sh
script fails with the following error:It seems that target platform constraints are causing problems with the dylib (OSX) target for the public API (only?) when bazel is invoked by said script.
The issue bisects to this commit: df5c1f9
As a workaround, removing the
dylib
target fromxls/public/BUILD
allows for the successful generation of the database:I would debug this further but my bazel-foo is limited :)
To Reproduce
Steps to reproduce the behavior:
xls
repo on a linux machine../xls/dev_tools/make-compilation-db.sh
.Expected behavior
./xls/dev_tools/make-compilation-db.sh
does not crash and correctly generates acompile_commands.json
file.Environment (this can be helpful for troubleshooting):
Please let me know if you need more info to repro this - but for me it fails consistently :)
The text was updated successfully, but these errors were encountered: