Skip to content

Commit 24e18a9

Browse files
authored
fix: use relative paths for includes and flags (#187)
This fix allows RBE to work and have shared cache between systems as no absolute path cripples in, making all paths in flags deterministic. A negative side-effect of this fix is that toolchains for all platforms that are registered will first extract the toolchain files, even for platforms that are not requested during build. This negative impact is partially mitigated by PR #186 that significantly reduces the toolchain archive sizes to about 25% of the original size.
1 parent 12edc9f commit 24e18a9

3 files changed

Lines changed: 310 additions & 401 deletions

File tree

docs/defs.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

toolchain/cc_toolchain_config.bzl

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ def _impl(ctx):
9393
extra_cxxflags = ctx.attr.extra_cxxflags
9494
extra_fflags = ctx.attr.extra_fflags
9595
extra_ldflags = ctx.attr.extra_ldflags
96-
includes = ctx.attr.includes
97-
fincludes = ctx.attr.fincludes
9896

9997
action_configs = []
10098

@@ -452,36 +450,6 @@ def _impl(ctx):
452450
] if len(extra_fflags) > 0 else [],
453451
)
454452

455-
includes_feature_flag_sets = []
456-
if len(includes) > 0:
457-
includes_feature_flag_sets.append(
458-
flag_set(
459-
actions = all_compile_actions + [FORTRAN_ACTION_NAMES.fortran_compile],
460-
flag_groups = [
461-
flag_group(
462-
flags = ["-isystem{}".format(include) for include in includes],
463-
),
464-
],
465-
),
466-
)
467-
if len(fincludes) > 0:
468-
includes_feature_flag_sets.append(
469-
flag_set(
470-
actions = [FORTRAN_ACTION_NAMES.fortran_compile],
471-
flag_groups = [
472-
flag_group(
473-
flags = ["-I{}".format(finclude) for finclude in fincludes],
474-
),
475-
],
476-
),
477-
)
478-
479-
includes_feature = feature(
480-
name = "includes",
481-
enabled = True,
482-
flag_sets = includes_feature_flag_sets,
483-
)
484-
485453
extra_ldflags_feature = feature(
486454
name = "extra_ldflags",
487455
enabled = True,
@@ -541,7 +509,6 @@ def _impl(ctx):
541509
extra_cxxflags_feature,
542510
extra_fflags_feature,
543511
extra_ldflags_feature,
544-
includes_feature,
545512
]
546513

547514
return [
@@ -576,8 +543,6 @@ cc_toolchain_config = rule(
576543
"extra_cxxflags": attr.string_list(mandatory = True),
577544
"extra_fflags": attr.string_list(mandatory = True),
578545
"extra_ldflags": attr.string_list(mandatory = True),
579-
"includes": attr.string_list(mandatory = True),
580-
"fincludes": attr.string_list(mandatory = True),
581546
"tool_paths": attr.string_dict(mandatory = True),
582547
},
583548
provides = [CcToolchainConfigInfo],

0 commit comments

Comments
 (0)