Skip to content

Make main_output public API#578

Closed
keith wants to merge 1 commit intobazelbuild:mainfrom
keith:ks/make-main_output-public-api
Closed

Make main_output public API#578
keith wants to merge 1 commit intobazelbuild:mainfrom
keith:ks/make-main_output-public-api

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented Jan 23, 2026

This API allows creating shared libraries with custom filenames, not
just the default pattern. This is required to write a rule that produces
python native extensions which have entirely different output naming
formats than standard shared libraries.

This API has been around for years now so I assume it's well understood
enough and there isn't a clear alternative.

@keith
Copy link
Copy Markdown
Member Author

keith commented Feb 3, 2026

@trybka can you take a look at this one? This is what I was mentioning recently

@trybka
Copy link
Copy Markdown
Collaborator

trybka commented Feb 4, 2026

I'm inclined to approve this, but I am just soliciting one round of internal discussion to see if I get significant push back.

From my POV, callers use this all the time, they just use weird hacks to get around the allowlist. We might as well accept Hyrum's law and this is just part of our API.

From a pure API standpoint it makes sense to me to say, "you can set the output name" (just as you would with clang -o foo.exe and I don't think it is reasonable to force it to be derived from the target name and executable type.

@armandomontanez armandomontanez added type: feature request Request for new, generally useful functionality that is missing P2 We'll consider working on this in future. (Assignee optional) category: core rules labels Feb 4, 2026
trybka
trybka previously approved these changes Mar 9, 2026
@keith
Copy link
Copy Markdown
Member Author

keith commented Mar 25, 2026

@trybka how's this one looking?

@armandomontanez armandomontanez added the untriaged Team member has to triage this issue - assign priority, type, and owner (if possible). label Mar 26, 2026
@keith keith force-pushed the ks/make-main_output-public-api branch from 33603d6 to e2ac8c2 Compare April 7, 2026 17:16
@hvadehra hvadehra removed their request for review April 7, 2026 19:20
This API allows creating shared libraries with custom filenames, not
just the default pattern. This is required to write a rule that produces
python native extensions which have entirely different output naming
formats than standard shared libraries.

This API has been around for years now so I assume it's well understood
enough and there isn't a clear alternative.
@keith keith force-pushed the ks/make-main_output-public-api branch from e2ac8c2 to eff1404 Compare April 7, 2026 19:40
@lilygorsheneva lilygorsheneva self-requested a review April 9, 2026 16:10
copybara-service Bot pushed a commit to bazelbuild/bazel that referenced this pull request Apr 10, 2026
Copybara Import from bazelbuild/rules_cc#578

BEGIN_PUBLIC
Make main_output public API (#578)

This API allows creating shared libraries with custom filenames, not
just the default pattern. This is required to write a rule that produces
python native extensions which have entirely different output naming
formats than standard shared libraries.

This API has been around for years now so I assume it's well understood
enough and there isn't a clear alternative.

Closes #578
END_PUBLIC

PiperOrigin-RevId: 897523576
Change-Id: I594b19abcf03f7703991462cf559327f8710e031
@keith keith deleted the ks/make-main_output-public-api branch April 10, 2026 17:03
keith added a commit to keith/bazel that referenced this pull request Apr 10, 2026
Copybara Import from bazelbuild/rules_cc#578

BEGIN_PUBLIC
Make main_output public API (bazelbuild#578)

This API allows creating shared libraries with custom filenames, not
just the default pattern. This is required to write a rule that produces
python native extensions which have entirely different output naming
formats than standard shared libraries.

This API has been around for years now so I assume it's well understood
enough and there isn't a clear alternative.

Closes bazelbuild#578
END_PUBLIC

PiperOrigin-RevId: 897523576
Change-Id: I594b19abcf03f7703991462cf559327f8710e031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: core rules P2 We'll consider working on this in future. (Assignee optional) type: feature request Request for new, generally useful functionality that is missing untriaged Team member has to triage this issue - assign priority, type, and owner (if possible).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants