Closed zadlg closed 2 months ago
Hi @zadlg!
Thank you for your pull request and welcome to our community.
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed
. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
@JakobDegen has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
Allow
None
inLinkerInfo.linker_flags
.LinkerInfo.linker_flags
field is by default set toNone
, as well as other flag list fields (e.g.LinkerInfo.archiver_flags
).However,
LinkerInfo.linker_flags
isn't consistenly used acrossprelude
.For instance, in
cxx/cxx_library.bzl
,LinkerInfo.linker_flags
is treated as an optional list:https://github.com/facebook/buck2/blob/1e89af6622344c46543a9e3781a556e058471043/prelude/cxx/cxx_library.bzl#L774
On the other hand, in
cxx/cxx_toolchain_types.bzl
,LinkerInfo.linker_flags
is expected to contain a non-None
value:https://github.com/facebook/buck2/blob/1e89af6622344c46543a9e3781a556e058471043/prelude/cxx/cxx_toolchain_types.bzl#L308
https://github.com/facebook/buck2/blob/1e89af6622344c46543a9e3781a556e058471043/prelude/cxx/cxx_toolchain_types.bzl#L327
This leads to an error when defining a custom CXX toolchain:
This commit handles the
LinkerInfo.linker_flags
consistently across the project.