bazelbuild / bazelbuild/bazel

List of allowed shared library file types should come from toolchain

Open
#17,117 2 comments 1 reaction 0 assignees View on GitHub
not stale P3 team-Rules-CPP type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 16h
Merged PRs (30d)
72

Description

The [following list](https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java;drc=e1cb203f6eeb376a5b8495de27272d4c952f9e19;l=207) is hard-coded into Bazel. There are many other possible shared library types which should work without crashing in [LinkerInputs.java](https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/LinkerInputs.java;drc=e5b3536583f742e0dda9fd377dffbda3c1e3d366;l=51).

For example, the attribute `shared_lib_name` of cc_shared_library extension allows any extension to be passed like "*.pyd", without explicitly adding the extension to the list above this won't work.

Contributor guide

Open the contributing guide

Research direction

Start by reading the shared-library file-type list in src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java and the handling in src/main/java/com/google/devtools/build/lib/rules/cpp/LinkerInputs.java. Trace how cc_shared_library processes shared_lib_name, then verify that an extension such as .pyd can be handled without adding it to a hard-coded list or causing a crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.