Skip to content

Avoid emitting -LNone in developer_dirs_linkopts on Linux - #1670

Merged
keith merged 2 commits into
bazelbuild:mainfrom
bc-lee:feature/fix-linux-developer-dirs
Mar 29, 2026
Merged

Avoid emitting -LNone in developer_dirs_linkopts on Linux#1670
keith merged 2 commits into
bazelbuild:mainfrom
bc-lee:feature/fix-linux-developer-dirs

Conversation

@bc-lee

@bc-lee bc-lee commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

When developer_dirs is empty, swift_developer_lib_dir(...) returns None. developer_dirs_linkopts(...) was still formatting that value as a library search path, which produced -LNone in the final link command.

Fix this by only adding the -L... flag when a real Swift developer library directory exists, and add unit tests covering empty, non-platform, and platform developer dir cases.

Fixes #1669

When `developer_dirs` is empty, `swift_developer_lib_dir(...)` returns
`None`. `developer_dirs_linkopts(...)` was still formatting that value as
a library search path, which produced `-LNone` in the final link command.

Fix this by only adding the `-L...` flag when a real Swift developer
library directory exists, and add unit tests covering empty, non-platform,
and platform developer dir cases.
@keith
keith merged commit d093154 into bazelbuild:main Mar 29, 2026
11 checks passed
@keith

keith commented Mar 29, 2026

Copy link
Copy Markdown
Member

thanks!

@bc-lee
bc-lee deleted the feature/fix-linux-developer-dirs branch March 29, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

always_include_developer_search_paths = True emits -LNone on Linux when no developer dirs exist

2 participants