This is an archive of the discontinued LLVM Phabricator instance.

gn build: Copy file permissions from input file in configure_file() emulation.
ClosedPublic

Authored by pcc on Jan 7 2019, 6:24 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Jan 7 2019, 6:24 PM
phosek added inline comments.Jan 8 2019, 7:54 PM
llvm/utils/gn/build/write_cmake_config.py
105 ↗(On Diff #180599)

Shouldn't this be inside the if block so the permissions are only changed if file is actually written?

pcc added inline comments.Jan 8 2019, 8:05 PM
llvm/utils/gn/build/write_cmake_config.py
105 ↗(On Diff #180599)

I thought about doing it that way, but figured that we'd want to copy the permissions if the contents don't change but the permissions do. Admittedly this is a bit of an edge case and now that I think about it more I don't even think that ninja will rerun the command in that case. So it would probably be slightly better to move it inside so that we don't disturb the ctime if the file didn't change. I'll do that.

pcc updated this revision to Diff 180785.Jan 8 2019, 8:10 PM
  • Move chmod inside the if
pcc marked an inline comment as done.Jan 8 2019, 8:10 PM
phosek accepted this revision.Jan 8 2019, 8:17 PM

LGTM

This revision is now accepted and ready to land.Jan 8 2019, 8:17 PM
This revision was automatically updated to reflect the committed changes.