|
20 | 20 | import com.google.common.collect.ImmutableList; |
21 | 21 | import com.google.devtools.build.lib.actions.Artifact; |
22 | 22 | import com.google.devtools.build.lib.actions.PathMapper; |
23 | | -import com.google.devtools.build.lib.analysis.AnalysisUtils; |
24 | | -import com.google.devtools.build.lib.analysis.RuleContext; |
25 | 23 | import com.google.devtools.build.lib.analysis.platform.ConstraintValueInfo; |
26 | 24 | import com.google.devtools.build.lib.analysis.starlark.StarlarkActionFactory; |
27 | 25 | import com.google.devtools.build.lib.analysis.starlark.StarlarkRuleContext; |
28 | 26 | import com.google.devtools.build.lib.cmdline.BazelModuleContext; |
29 | 27 | import com.google.devtools.build.lib.cmdline.Label; |
30 | 28 | import com.google.devtools.build.lib.collect.nestedset.Depset; |
31 | | -import com.google.devtools.build.lib.collect.nestedset.Depset.TypeException; |
32 | 29 | import com.google.devtools.build.lib.collect.nestedset.NestedSet; |
33 | 30 | import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; |
34 | 31 | import com.google.devtools.build.lib.collect.nestedset.Order; |
@@ -92,7 +89,6 @@ public Provider getCcToolchainProvider() { |
92 | 89 | return CcToolchainProvider.BUILTINS_PROVIDER; |
93 | 90 | } |
94 | 91 |
|
95 | | - |
96 | 92 | @Override |
97 | 93 | public String getToolForAction( |
98 | 94 | FeatureConfigurationForStarlark featureConfiguration, |
@@ -524,111 +520,6 @@ protected Language parseLanguage(String string) throws EvalException { |
524 | 520 | } |
525 | 521 | } |
526 | 522 |
|
527 | | - @StarlarkMethod( |
528 | | - name = "register_linkstamp_compile_action_internal", |
529 | | - documented = false, |
530 | | - useStarlarkThread = true, |
531 | | - parameters = { |
532 | | - @Param( |
533 | | - name = "actions", |
534 | | - positional = false, |
535 | | - named = true, |
536 | | - doc = "<code>actions</code> object."), |
537 | | - @Param( |
538 | | - name = "cc_toolchain", |
539 | | - doc = "<code>CcToolchainInfo</code> provider to be used.", |
540 | | - positional = false, |
541 | | - named = true), |
542 | | - @Param( |
543 | | - name = "feature_configuration", |
544 | | - doc = "<code>feature_configuration</code> to be queried.", |
545 | | - positional = false, |
546 | | - named = true), |
547 | | - @Param(name = "source_file", documented = false, positional = false, named = true), |
548 | | - @Param(name = "output_file", documented = false, positional = false, named = true), |
549 | | - @Param(name = "compilation_inputs", documented = false, positional = false, named = true), |
550 | | - @Param( |
551 | | - name = "inputs_for_validation", |
552 | | - documented = false, |
553 | | - positional = false, |
554 | | - named = true), |
555 | | - @Param(name = "label_replacement", documented = false, positional = false, named = true), |
556 | | - @Param(name = "output_replacement", documented = false, positional = false, named = true), |
557 | | - @Param( |
558 | | - name = "needs_pic", |
559 | | - documented = false, |
560 | | - positional = false, |
561 | | - named = true, |
562 | | - defaultValue = "False"), |
563 | | - @Param( |
564 | | - name = "stamping", |
565 | | - documented = false, |
566 | | - positional = false, |
567 | | - named = true, |
568 | | - defaultValue = "None"), |
569 | | - @Param( |
570 | | - name = "compile_build_variables", |
571 | | - positional = false, |
572 | | - named = true, |
573 | | - documented = false), |
574 | | - }) |
575 | | - public void registerLinkstampCompileAction( |
576 | | - StarlarkActionFactory starlarkActionFactoryApi, |
577 | | - Info ccToolchainInfo, |
578 | | - FeatureConfigurationForStarlark featureConfigurationForStarlark, |
579 | | - Artifact sourceFile, |
580 | | - Artifact outputFile, |
581 | | - Depset compilationInputs, |
582 | | - Depset inputsForValidation, |
583 | | - String labelReplacement, |
584 | | - String outputReplacement, |
585 | | - boolean needsPic, |
586 | | - Object stampingObject, |
587 | | - CcToolchainVariables compileBuildVariables, |
588 | | - StarlarkThread thread) |
589 | | - throws EvalException, InterruptedException, TypeException, RuleErrorException { |
590 | | - isCalledFromStarlarkCcCommon(thread); |
591 | | - RuleContext ruleContext = starlarkActionFactoryApi.getRuleContext(); |
592 | | - boolean stamping = |
593 | | - stampingObject instanceof Boolean b |
594 | | - ? b |
595 | | - : AnalysisUtils.isStampingEnabled(ruleContext, ruleContext.getConfiguration()); |
596 | | - CcToolchainProvider ccToolchain = CcToolchainProvider.wrapOrThrowEvalException(ccToolchainInfo); |
597 | | - if (AnalysisUtils.isStampingEnabled(ruleContext, ruleContext.getConfiguration())) { |
598 | | - // Makes the target depend on BUILD_INFO_KEY, which helps to discover stamped targets |
599 | | - // See b/326620485 for more details. |
600 | | - var unused = |
601 | | - starlarkActionFactoryApi |
602 | | - .getRuleContext() |
603 | | - .getAnalysisEnvironment() |
604 | | - .getVolatileWorkspaceStatusArtifact(); |
605 | | - } |
606 | | - CppSemantics semantics = getSemantics(); |
607 | | - ImmutableList<Artifact> buildInfoHeaderArtifacts = |
608 | | - stamping |
609 | | - ? ccToolchain |
610 | | - .getCcBuildInfoTranslator() |
611 | | - .getOutputGroup("non_redacted_build_info_files") |
612 | | - .toList() |
613 | | - : ccToolchain |
614 | | - .getCcBuildInfoTranslator() |
615 | | - .getOutputGroup("redacted_build_info_files") |
616 | | - .toList(); |
617 | | - starlarkActionFactoryApi.registerAction( |
618 | | - CppLinkstampCompileHelper.createLinkstampCompileAction( |
619 | | - CppLinkActionBuilder.newActionConstruction(ruleContext), |
620 | | - sourceFile, |
621 | | - outputFile, |
622 | | - compilationInputs.getSet(Artifact.class), |
623 | | - /* nonCodeInputs= */ NestedSetBuilder.emptySet(Order.STABLE_ORDER), |
624 | | - inputsForValidation.getSet(Artifact.class), |
625 | | - buildInfoHeaderArtifacts, |
626 | | - ccToolchain, |
627 | | - featureConfigurationForStarlark.getFeatureConfiguration(), |
628 | | - semantics, |
629 | | - compileBuildVariables)); |
630 | | - } |
631 | | - |
632 | 523 | @StarlarkMethod( |
633 | 524 | name = "create_extra_link_time_library", |
634 | 525 | documented = false, |
|
0 commit comments