google / google/kati

Dependency loops cause targets to be missing from ninja graph with --gen_all_targets

Open
#206 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1k
Forks
132
Avg merge
11m
Merged PRs (30d)
1

Description

(From internal google bug 162918277)

This test case can show the problem:

`testcase/circular_dep_self.mk`
```
test:
echo PASS

loop: loop test
true
```
```
$ go test --ckati --ninja --all -test.run=TestKati/circular_dep_self.mk
--- FAIL: TestKati (0.00s)
--- FAIL: TestKati/phony_loop.mk (0.02s)
run_test.go:484: Different output from kati (red) to the expected value from make (green):
src/ninja.cc:671: default_target_PASS
```

Ninja is erroring out because there are no default targets defined:
```
# Generated by kati ...

pool local_pool
depth = 72

build _kati_always_build_: phony
```

Removing the circular dependency causes things to work:
```
# Generated by kati ...

pool local_pool
depth = 72

build _kati_always_build_: phony

rule rule0
description = build $out
command = /bin/bash -c "true"
build loop: rule0 test
rule rule1
description = build $out
command = /bin/bash -c "echo PASS"
build test: rule1

default test
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.