new thread for reports!:
# announce
w
new thread for reports!:
❤️ 1
Copy code
Traceback (most recent call last):
  File "./fix_deprecated_globs_usage.py", line 310, in <module>
    main()
  File "./fix_deprecated_globs_usage.py", line 33, in main
    possibly_new_build = generate_possibly_new_build(build)
  File "./fix_deprecated_globs_usage.py", line 187, in generate_possibly_new_build
    original_text = build_file.read_text()
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1206, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/pathlib.py", line 1193, in open
    opener=self._opener)
IsADirectoryError: [Errno 21] Is a directory: 'src/scala/com/twitter/example/BUILD'
(and it is!)
another case with a lower-case
build
file (it's OSX, so case shouldn't matter, but i think the filesystem preserves what is stored, so should ensure that you don't normalize that)
h
Interesting with the directory one! Huh. What’s the correct behavior with lower-case
build
file? Should that be updated?
w
it's not a build file
pants ignores it, because it doesn't match the filename pattern, which is case sensitive
also, given that nothing is committed until the script completes: two thoughts:
h
but the script tries updating it? Hm, we use
Path.rglob("BUILD")
. I’ll see if there’s a way to make that case sensitive
w
1. should add exception handling in generate_possibly_new_build
...actually, that's it.
h
Those are the only two issues you saw?
w
Copy code
Traceback (most recent call last):
  File "./fix_deprecated_globs_usage.py", line 314, in <module>
    main()
  File "./fix_deprecated_globs_usage.py", line 33, in main
    possibly_new_build = generate_possibly_new_build(build)
  File "./fix_deprecated_globs_usage.py", line 196, in generate_possibly_new_build
    target.value for target in ast.parse(original_text).body
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 3
    SOURCE_ROOT=$(git rev-parse --show-toplevel)
                ^
SyntaxError: invalid syntax
so far, yea. i'm editing the script to exclude them as i go. but you don't get all of them... just the next one
h
Is that an actual BUILD file using bash syntax?
w
no, that's the lowercase build filename.
h
cool
w
yea, the exception handling seems like the most valuable change
but those are the only two so far.
going to run it for more of the repo now.
h
can you please update it with
curl -L -o fix_deprecated_globs_usage.py <https://raw.githubusercontent.com/pantsbuild/pants/846871ae57021764ac35d0046269828588e8a2b9/build-support/migration-support/fix_deprecated_globs_usage.py>
?
w
going to see if i can get it to complete first, then will try with an updated copy.
yea, those appear to be the only two types of errors in the repo
💯 1
and then the "cannot rewrite with newlines" thing
which i can parse to apply with buildozer.
thanks 😃
❤️ 1
brb
h
Yay! We only need to merge https://github.com/pantsbuild/pants/pull/9067 and https://github.com/pantsbuild/pants/pull/9068 and the RC should be good to go. Preparing the notes now
w
comments