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
ninja clean fails when a target is defined with the same name as a directory #1644
Comments
configure_file
prevents a directory from being removedrun_target
with the same name as a directory is used
OK, now I get it: ==> meson.build <==
project('clean1', 'c')
conf = configuration_data()
subdir('sub1')
==> sub1/meson.build <==
configure_file(
output : 'config.h',
configuration : conf)
run_target('sub1',
command : ['echo']) $ nj clean
[1/1] 'Cleaning'
FAILED: clean
'ninja-build' '-t' 'clean'
ninja: error: remove(sub1): Directory not empty
Cleaning... 0 files.
ninja: build stopped: subcommand failed. |
run_target
with the same name as a directory is usedrun_target
with the same name as a directory is used
The name of the run target is the "output" of the build statement and ninja cleans things based on build outputs, so... I'm not sure how to express this in ninja. |
Maybe run targets should depend on the |
run_target
with the same name as a directory is used
Can't use What we could do, to work around this Ninja bug, is to define targets called build meson-test: CUSTOM_COMMAND all PHONY
COMMAND = /usr/bin/python3 -u /home/nirbheek/projects/repositories/github/meson.git/mesontest.py --no-rebuild --print-errorlogs
DESC = Running$ all$ tests.
pool = console
build test: phony meson-test However, simultaneously we should try to fix this in Ninja too. |
The test target is tagged phony and it works just fine (just runs a command). Marking run targets with PHONY should work. I just tested by creating a directory called test in a build dir and running |
That's not the problem. The problem is that |
FWIW, the upstream bug for the general problem of not recursively deleting directories on non-Windows platforms is ninja-build/ninja#828. |
Okay, let's put in the workaround with a link to that bug. |
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go.
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go.
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go. (cherry picked from commit 6939fb9)
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go. (cherry picked from commit 6939fb9)
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go. (cherry picked from commit 6939fb9)
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go. (cherry picked from commit 6939fb9eb4c76de630b71f6b2ad98686d7fbd1bf)
mesonbuild/meson#1644 was resolved in 0.42: mesonbuild/meson@be44280, but still no-go.
I get the following error:
So the
man
directory should not be removed at all, for two reasons: 1. there's a subdir, 2. there's a generated file. I don't know whyclean
tries to remove it.I tried to make simple test case, but I couldn't reproduce the error. So it's something in the way that man is defined...
The text was updated successfully, but these errors were encountered: