bazelbuild / bazelbuild/bazel-skylib

Example/docs for string_list_setting

Open
#296 12 comments 0 reactions 0 assignees View on GitHub
good first issue P3
Dominant language
Starlark
Stars
444
Forks
202
PR merge metrics
No merged PRs in 30d

Description

Is there more documentation (preferably with examples) for using string_list_setting? I'm trying to pass defines to a cc_library rule, like this:

```
cc_library(
name = "...",
defines = ":nrf_defines",
)

string_list_setting(
name = "nrf_defines",
build_setting_default = [],
)
```

When I build this, cc_library rules spit out the error:

```
expected value of type 'list(string)' for attribute 'defines' in 'cc_library' rule, but got ":nrf_defines" (string)
```

This also makes sense, since the types are different, but I don't know how to proceed. How do I convert the string_list_setting into a list of strings when filling in the `defines` field of a cc_library?

Contributor guide

Open the contributing guide

Research direction

Start with the string_list_setting and cc_library examples in the issue, then inspect the existing Bazel Skylib documentation for the relevant entry points. Done means the documentation explains how to use string_list_setting with cc_library defines and includes a working example of the expected value conversion.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.