Skip to content

cc_import complains about some versioned .so files in 5.0 #14289

@philsc

Description

@philsc

Description of the problem / feature request:

Upgrading from 4.2.1 to 5.0.0rc2 results in this error for me:

$ bazel build @system_libs//:all
2021/11/17 14:40:02 Downloading https://releases.bazel.build/5.0.0/rc2/bazel-5.0.0rc2-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 671f56c1-9f86-476e-b34f-8a0387556c83
ERROR: /home/pschrader/.cache/bazel/_bazel_pschrader/a55c71430860a197fc771aecd5e3a4e8/external/system_libs/BUILD.bazel:12:10: in cc_import rule @system_libs//:libsdl2_ttf:
Traceback (most recent call last):
        File "/virtual_builtins_bzl/common/cc/cc_import.bzl", line 138, column 26, in _cc_import_impl
        File "/virtual_builtins_bzl/common/cc/cc_import.bzl", line 78, column 13, in _perform_error_checks
Error in fail: 'shared_library' does not produce any cc_import shared_library files (expected .so, .dylib or .dll)
ERROR: /home/pschrader/.cache/bazel/_bazel_pschrader/a55c71430860a197fc771aecd5e3a4e8/external/system_libs/BUILD.bazel:12:10: Analysis of target '@system_libs//:libsdl2_ttf' failed
ERROR: Analysis of target '@system_libs//:libsdl2_ttf' failed; build aborted:
INFO: Elapsed time: 29.671s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (63 packages loaded, 303 targets configured)

This is what external/system_libs/BUILD.bazel looks like:

# Aurora Innovation, Inc. Proprietary and Confidential. Copyright 2021.

load("@rules_cc//cc:defs.bzl", "cc_import")

package(default_visibility = ["//visibility:public"])

cc_import(
    name = "libsdl2",
    shared_library = "x86_64-linux-gnu/libSDL2-2.0.so.0",
)

cc_import(
    name = "libsdl2_ttf",
    shared_library = "x86_64-linux-gnu/libSDL2_ttf-2.0.so.0",
)

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Write a cc_import target with a shared library that contains a . in the non-extension part of the filename.

What operating system are you running Bazel on?

Ubuntu 18.04 x86_64

What's the output of bazel info release?

Replace this line with your answer.

If bazel info release returns "development version" or "(@Non-Git)", tell us how you built Bazel.

$ bazel info release
INFO: Invocation ID: 39ab014f-0f51-456d-a62f-7d9b58a770d8
release 5.0.0rc2

Have you found anything relevant by searching the web?

I found this patch that removed the Starlark implementation of cc_import: f756442

It's a bit frustrating though that the commit message gives no justification or reasoning for this.

Any other information, logs, or outputs that you want to share?

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions