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

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

Closed
philsc opened this issue Nov 17, 2021 · 4 comments
Closed

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

philsc opened this issue Nov 17, 2021 · 4 comments

Comments

@philsc
Copy link
Contributor

philsc commented Nov 17, 2021

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

@philsc
Copy link
Contributor Author

philsc commented Nov 17, 2021

Actually, it's already fixed by 23d0969.

@Wyverald Wyverald added this to the Bazel 5.0 Release Blockers milestone Nov 17, 2021
@Wyverald
Copy link
Member

Do you think cherrypicking that into 5.0 is enough to fix this?

cc @erenon

philsc pushed a commit to philsc/bazel that referenced this issue Nov 17, 2021
Consider libfoo-1.0.so.1.0 valid.
Do not fail if the name does not contain a '.', return False instead.

(cherry picked from commit 23d0969)

Fixes bazelbuild#14289.
Closes bazelbuild#14021.
@erenon
Copy link
Contributor

erenon commented Nov 17, 2021

Probably yes.

@philsc
Copy link
Contributor Author

philsc commented Nov 17, 2021

I created PR #14290 to cherry-pick the patch.

Wyverald pushed a commit that referenced this issue Nov 17, 2021
Consider libfoo-1.0.so.1.0 valid.
Do not fail if the name does not contain a '.', return False instead.

(cherry picked from commit 23d0969)

Fixes #14289.
Closes #14021.

Co-authored-by: Benedek Thaler <[email protected]>
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

3 participants