Skip to content

Commit

Permalink
Merge pull request #466 from Silic0nS0ldier/cconly-flags
Browse files Browse the repository at this point in the history
Stubs for new argument `conly_flags` in `cc_toolchain_config`
  • Loading branch information
benradf authored Dec 13, 2023
2 parents 8c6f509 + d93d061 commit 1ad0bd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions toolchains/cc/cc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def _parse_cc_toolchain_info(content, filename):
"COVERAGE_LINK_FLAGS",
"SUPPORTS_START_END_LIB",
"IS_CLANG",
"CONLY_FLAGS",
])
actual_keys = sets.make(info.keys())
missing_keys = sets.difference(expected_keys, actual_keys)
Expand Down Expand Up @@ -118,6 +119,7 @@ def _parse_cc_toolchain_info(content, filename):
coverage_link_flags = info["COVERAGE_LINK_FLAGS"],
supports_start_end_lib = info["SUPPORTS_START_END_LIB"] == ["True"],
is_clang = info["IS_CLANG"] == ["True"],
conly_flags = info["CONLY_FLAGS"],
)

def _nixpkgs_cc_toolchain_config_impl(repository_ctx):
Expand Down Expand Up @@ -217,6 +219,7 @@ def _nixpkgs_cc_toolchain_config_impl(repository_ctx):
"%{coverage_compile_flags}": get_starlark_list(info.coverage_compile_flags),
"%{coverage_link_flags}": get_starlark_list(info.coverage_link_flags),
"%{supports_start_end_lib}": repr(info.supports_start_end_lib),
"%{conly_flags}": get_starlark_list(info.conly_flags),
},
)

Expand Down
2 changes: 2 additions & 0 deletions toolchains/cc/cc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ pkgs.runCommand "bazel-${cc.orignalName or cc.name}-toolchain"
IS_CLANG=(
${if cc.isClang then "True" else "False"}
)
CONLY_FLAGS=()
# Write CC_TOOLCHAIN_INFO
#
Expand Down Expand Up @@ -319,4 +320,5 @@ pkgs.runCommand "bazel-${cc.orignalName or cc.name}-toolchain"
write_info COVERAGE_LINK_FLAGS
write_info SUPPORTS_START_END_LIB
write_info IS_CLANG
write_info CONLY_FLAGS
''

0 comments on commit 1ad0bd9

Please sign in to comment.