Skip to content

incompatible_depset_for_libraries_to_link_getter: use depsets in linking_context in C++ Starlark API #8118

@oquenchil

Description

@oquenchil

Flag: --incompatible_depset_for_libraries_to_link_getter
Available since: 0.26 (June 2019 release)
Will be flipped in: 0.27 (September 2019 release)
Tracking issue: #8118

linking_context.libraries_to_link will return a depset instead of a list. To make code compatible with the list and the depset, simply check whether the value returned from linking_context.libraries_to_link has the attribute "to_list".

libraries_to_link = linking_context.libraries_to_link
if hasattr(libraries_to_link, "to_list"):
   # It's a depset
else:
  # It's a list

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)incompatible-changeIncompatible/breaking changeteam-Rules-CPPIssues for C++ rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions