Skip to content

Commit

Permalink
Remove .KATI_SYMLINK_OUTPUTS
Browse files Browse the repository at this point in the history
This was added so that bazel could run ninja files,
but we abandoned that approach a long time ago.
  • Loading branch information
Colecf committed Jan 19, 2024
1 parent 1ec8253 commit 2c503b6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 118 deletions.
30 changes: 0 additions & 30 deletions src/dep.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ bool IsSuffixRule(Symbol output) {
struct RuleMerger {
std::vector<const Rule*> rules;
std::vector<std::pair<Symbol, RuleMerger*>> implicit_outputs;
std::vector<Symbol> symlink_outputs;
std::vector<Symbol> validations;
const Rule* primary_rule;
const RuleMerger* parent;
Expand All @@ -155,8 +154,6 @@ struct RuleMerger {
implicit_outputs.push_back(std::make_pair(output, merger));
}

void AddSymlinkOutput(Symbol output) { symlink_outputs.push_back(output); }

void AddValidation(Symbol validation) { validations.push_back(validation); }

void SetImplicitOutput(Symbol output, Symbol p, const RuleMerger* merger) {
Expand Down Expand Up @@ -262,14 +259,6 @@ struct RuleMerger {
}
}

for (auto& symlink_output : symlink_outputs) {
if (!all_outputs.exists(symlink_output)) {
ERROR_LOC(primary_rule->cmd_loc(), "*** undeclared symlink output: %s",
symlink_output.c_str());
}
n->symlink_outputs.push_back(symlink_output);
}

for (auto& validation : validations) {
n->actual_validations.push_back(validation);
}
Expand Down Expand Up @@ -299,7 +288,6 @@ class DepBuilder {
implicit_rules_(new RuleTrie()),
depfile_var_name_(Intern(".KATI_DEPFILE")),
implicit_outputs_var_name_(Intern(".KATI_IMPLICIT_OUTPUTS")),
symlink_outputs_var_name_(Intern(".KATI_SYMLINK_OUTPUTS")),
ninja_pool_var_name_(Intern(".KATI_NINJA_POOL")),
validations_var_name_(Intern(".KATI_VALIDATIONS")),
tags_var_name_(Intern(".KATI_TAGS")) {
Expand Down Expand Up @@ -456,17 +444,6 @@ class DepBuilder {
p.second.AddValidation(sym);
}
}

var = vars->Lookup(symlink_outputs_var_name_);
if (var->IsDefined()) {
std::string symlink_outputs;
var->Eval(ev_, &symlink_outputs);

for (std::string_view output : WordScanner(symlink_outputs)) {
Symbol sym = Intern(TrimLeadingCurdir(output));
p.second.AddSymlinkOutput(sym);
}
}
}
}

Expand Down Expand Up @@ -853,12 +830,6 @@ class DepBuilder {
n->validations.push_back({validation, c});
}

if (!g_flags.use_ninja_symlink_outputs && !n->symlink_outputs.empty()) {
ERROR_LOC(n->loc,
".KATI_SYMLINK_OUTPUTS not allowed without "
"--use_ninja_symlink_outputs");
}

// Block on werror_writable/werror_phony_looks_real, because otherwise we
// can't rely on is_phony being valid for this check.
if (!n->is_phony && n->cmds.empty() && g_flags.werror_writable &&
Expand Down Expand Up @@ -942,7 +913,6 @@ class DepBuilder {
SymbolSet restat_;
Symbol depfile_var_name_;
Symbol implicit_outputs_var_name_;
Symbol symlink_outputs_var_name_;
Symbol ninja_pool_var_name_;
Symbol validations_var_name_;
Symbol tags_var_name_;
Expand Down
1 change: 0 additions & 1 deletion src/dep.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ struct DepNode {
bool is_phony;
bool is_restat;
std::vector<Symbol> implicit_outputs;
std::vector<Symbol> symlink_outputs;
std::vector<Symbol> actual_inputs;
std::vector<Symbol> actual_order_only_inputs;
std::vector<Symbol> actual_validations;
Expand Down
2 changes: 0 additions & 2 deletions src/flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ void Flags::Parse(int argc, char** argv) {
no_ninja_prelude = true;
} else if (!strcmp(arg, "--use_ninja_phony_output")) {
use_ninja_phony_output = true;
} else if (!strcmp(arg, "--use_ninja_symlink_outputs")) {
use_ninja_symlink_outputs = true;
} else if (!strcmp(arg, "--use_ninja_validations")) {
use_ninja_validations = true;
} else if (!strcmp(arg, "--werror_find_emulator")) {
Expand Down
1 change: 0 additions & 1 deletion src/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ struct Flags {
bool no_builtin_rules;
bool no_ninja_prelude;
bool use_ninja_phony_output;
bool use_ninja_symlink_outputs;
bool use_ninja_validations;
bool werror_find_emulator;
bool werror_overriding_commands;
Expand Down
8 changes: 0 additions & 8 deletions src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,6 @@ class NinjaGenerator {

out << "\n";

if (!node->symlink_outputs.empty()) {
out << " symlink_outputs =";
for (auto const& s : node->symlink_outputs) {
out << " " << EscapeBuildTarget(s);
}
out << "\n";
}

std::string pool;
if (node->ninja_pool_var) {
node->ninja_pool_var->Eval(ev_, &pool);
Expand Down
76 changes: 0 additions & 76 deletions testcase/ninja_symlink_outputs.sh

This file was deleted.

0 comments on commit 2c503b6

Please sign in to comment.