Re: [chromium-dev] how to fix git cl format warnings

13 views
Skip to first unread message

Paweł Hajdan, Jr.

unread,
Oct 5, 2016, 4:01:23 AM10/5/16
to tsnia...@opera.com, infr...@chromium.org, Ryan Tseng, Chromium-dev, xin...@intel.com
+infra-dev,hinoka

Yeah, the suggestion on the bug (perhaps download_from_google_storage should download to a temporary filename, chmod, and then mv to the final location) sounds good to me.

FWIW, handling downloaded archives would still be somewhat tricky if the process gets killed in the middle of extracting the archive. :-/

Paweł

On Wed, Oct 5, 2016 at 12:33 AM, Tomasz Sniatowski <tsnia...@opera.com> wrote:
Random missing +x on files downloaded from google storage could be caused by https://bugs.chromium.org/p/chromium/issues/detail?id=645396 -- an abort at just the wrong time can leave a file downloaded fully, but without the executable bit set, and this situation won't correct itself automatically.


On Tuesday, October 4, 2016 at 4:36:04 PM UTC+2, Nico Weber wrote:
Strange, clang-format needs x set. `chmod +x buildtools/linux64/clang-format` will fix, but that should Just Work. (gn does have the right bit set.)

Does `rm buildtools/linux64/clang-format && gclient runhooks && ls buildtools/linux64` change anything?

The file does have x set on storage:

$ ~/gsutil/gsutil ls -L gs://chromium-clang-format/$(cat buildtools/linux64/clang-format.sha1) | grep executable
executable: 1

On Tue, Oct 4, 2016 at 10:26 AM, Xing <xin...@intel.com> wrote:
Did run git rebase-update/gclient sync.  

src$ ls -l buildtools/linux64/
total 3236
-rw-rw-r-- 1 abc abc 1828080 10月  4 08:58 clang-format
-rw-rw-r-- 1 abc abc      40  9月 27 11:54 clang-format.sha1
-rwxrw-r-- 1 abc abc 1473232 10月  4 16:32 gn
-rw-rw-r-- 1 abc abc      41 10月  4 16:31 gn.sha1



在 2016年10月4日星期二 UTC+8下午9:45:35,Nico Weber写道:
What OS are you on? What's the output of `ls -l buildtools/{mac,linux64}/`? Did you run `gclient sync`?

On Tue, Oct 4, 2016 at 9:13 AM, Xing <xin...@intel.com> wrote:
Hi, I am trying to rebase one CL. But unluckily I first use git pull --rebase and when conflicts, I tried git merge --abort.
And after this, I successfully git cl upload.  But when dry run,  it outputs warning for chromium_presubmit:
"
** Presubmit Warnings **
The WebKit directory requires source formatting. Please run git cl format third_party/WebKit
"

Then I trid git cl format locally like this, for file I didn't change, nothing output. For files changed by me, it outputs permission denied.
Also I tried git reset 'HEAD@{41}', problem still not resolved.

Any hints for this?

The detail output for git cl format:
src$ git cl format third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp
Traceback (most recent call last):
  File "/g1/google/chromiumlinux_0815/src/buildtools/clang_format/script/clang-format-diff.py", line 121, in <module>
    main()
  File "/g1/google/chromiumlinux_0815/src/buildtools/clang_format/script/clang-format-diff.py", line 104, in main
    stderr=None, stdin=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied
Command "/usr/bin/python /g1/google/chromiumlinux_0815/src/buildtools/clang_format/script/clang-format-diff.py -p0 -i" failed.


src$ git cl format third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
Nothing outputs.

--
--
Chromium Developers mailing list: chromi...@chromium.org

View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Tomasz Śniatowski

unread,
Oct 5, 2016, 4:12:41 AM10/5/16
to Paweł Hajdan, Jr., infr...@chromium.org, Ryan Tseng, Chromium-dev, xin...@intel.com
Archives can be handled in a similar fashion, for example using the actual archive file as a guard to mean "unpacking may have not finished, redo and then mv/rm the archive".

--
Tomasz Śniatowski

Primiano Tucci

unread,
Oct 5, 2016, 11:34:58 AM10/5/16
to Tomasz Śniatowski, Paweł Hajdan, Jr., infr...@chromium.org, Ryan Tseng, Chromium-dev, xin...@intel.com
Like it the case of a temp file it should:
- uncompress into a X.tmp folder sitting next to the original one (X)
- rename X -> X.delete
- rename X.tmp -> X
- rm -rf X.delete

which reduces sensibly the race window, and in any case never leaves around a stale folder (worst case you get no folder at all) 

--
You received this message because you are subscribed to the Google Groups "infra-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to infra-dev+...@chromium.org.
To post to this group, send email to infr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/infra-dev/CAMJuQOzuR3FYkkeQoBu%2Bmn79UFqDu9z1xdpdMoc-5m2BO7uZdg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages