Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove .KATI_SYMLINK_OUTPUTS #274

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y make git-core build-essential curl ninja-build python3 wget
RUN apt-get update && apt-get install -y make git-core build-essential curl python3 wget unzip

# Install Go
RUN \
Expand All @@ -18,10 +18,18 @@ RUN \
cd .. && \
rm -rf tmp/

# Install ninja, we need a newer version than is in apt
RUN \
mkdir -p /ninja && \
cd /ninja && \
wget https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip && \
unzip ninja-linux.zip && \
rm ninja-linux.zip

# Set environment variables for Go and Make.
ENV GOROOT /goroot
ENV GOPATH /gopath
ENV PATH $GOROOT/bin:$GOPATH/bin:/make:$PATH
ENV PATH $GOROOT/bin:$GOPATH/bin:/make:/ninja:$PATH

# Copy project code.
COPY . /src
Expand Down
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.

Loading