|
|
DescriptionTeach build/symlink.py --force to delete directories.
Otherwise os.remove just fails saying it can't delete a directory.
R=dpranke@chromium.org
Committed: https://crrev.com/add100b7cd19ae6caad54ac6c6ed9766b7f1f70b
Cr-Commit-Position: refs/heads/master@{#337083}
Patch Set 1 #
Total comments: 2
Messages
Total messages: 20 (5 generated)
eseidel@chromium.org changed reviewers: + dpranke@chromium.org - dprank@chromium.org
thakis@chromium.org changed reviewers: + thakis@chromium.org
lgtm if you don't need this on Windows https://codereview.chromium.org/1222573002/diff/1/build/symlink.py File build/symlink.py (right): https://codereview.chromium.org/1222573002/diff/1/build/symlink.py#newcode34 build/symlink.py:34: shutil.rmtree(t, ignore_errors=True) Do you need this to work on Windows? shutil.rmtree() fails on Windows if there are read-only files in the directory. That's why many places do if win: shell out to rmdir /s/q else: shutil.rmtree
I don't think windows support is needed for this script given that it's symlinks. But I could be wrong.
https://codereview.chromium.org/1222573002/diff/1/build/symlink.py File build/symlink.py (right): https://codereview.chromium.org/1222573002/diff/1/build/symlink.py#newcode6 build/symlink.py:6: """Make a symlink and optionally touch a file (to handle dependencies).""" …actually, it looks like this is for build deps. Depending on a directory in general won't do the right thing. What are you trying to do? What's this for?
The CQ bit was checked by eseidel@chromium.org
The CQ bit was unchecked by eseidel@chromium.org
Perhaps we're abusing the script then. I can ditch this.
To elaborate: If you have a directory as a build dep, then that directory's mtime is only updated if a file directly in that directory is changed. If a file in a subdirectory in that directory is changed, it doesn't affect the mtime of the outer directory. So when you change things in a subdirectory, the build system won't notice if you only have a dependency on the outer directory. I don't know what you do with this script, so I don't know if that's a problem or not.
On 2015/07/01 at 18:27:34, thakis wrote: > https://codereview.chromium.org/1222573002/diff/1/build/symlink.py > File build/symlink.py (right): > > https://codereview.chromium.org/1222573002/diff/1/build/symlink.py#newcode6 > build/symlink.py:6: """Make a symlink and optionally touch a file (to handle dependencies).""" > …actually, it looks like this is for build deps. Depending on a directory in general won't do the right thing. What are you trying to do? What's this for? The idea is to make this script robust to whatever junk you have in your out directory at this location already. We ran into this problem because we used to have a directory and now we have a symlink. Using --force wasn't enough to make people's incremental builds work. We need --force to blow away whatever used to be at this location in the out directory.
On 2015/07/01 18:31:00, abarth-chromium wrote: > On 2015/07/01 at 18:27:34, thakis wrote: > > https://codereview.chromium.org/1222573002/diff/1/build/symlink.py > > File build/symlink.py (right): > > > > https://codereview.chromium.org/1222573002/diff/1/build/symlink.py#newcode6 > > build/symlink.py:6: """Make a symlink and optionally touch a file (to handle > dependencies).""" > > …actually, it looks like this is for build deps. Depending on a directory in > general won't do the right thing. What are you trying to do? What's this for? > > The idea is to make this script robust to whatever junk you have in your out > directory at this location already. We ran into this problem because we used to > have a directory and now we have a symlink. Using --force wasn't enough to make > people's incremental builds work. We need --force to blow away whatever used to > be at this location in the out directory. This makes sense from a distance. If you think this is the right thing given what I said above, then go click cq – my lg from above stands :-)
The CQ bit was checked by eseidel@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1222573002/1
Message was sent while issue was closed.
Committed patchset #1 (id:1)
Message was sent while issue was closed.
Patchset 1 (id:??) landed as https://crrev.com/add100b7cd19ae6caad54ac6c6ed9766b7f1f70b Cr-Commit-Position: refs/heads/master@{#337083}
Message was sent while issue was closed.
Who actually calls this script? I didn't see any references to it in cs/ or from grepping around?
Message was sent while issue was closed.
One BUILD.gn in mojo? :p https://github.com/domokit/mojo/blob/ac21cef12f1867925e97f96fea53e6d65c382c8e...
Message was sent while issue was closed.
On 2015/07/01 20:12:16, eseidel wrote: > One BUILD.gn in mojo? :p > > https://github.com/domokit/mojo/blob/ac21cef12f1867925e97f96fea53e6d65c382c8e... Does it make sense to just copy this file there and delete it from //build, then?
Message was sent while issue was closed.
sgtm. |