Fix alpha updates and lint error reporting#10020
Conversation
When the artifacts are uploaded, they need to preserve the folder structure. Despite a folder structure, all atrifacts are listed on the appveyor build result page in a flat way.
Decoding as UTF-8 was not working for lint output, use ANSI and replace on error instead.
|
I read the diff and it looks ok. Feel free to go ahead merging this.
|
|
I copied the powershell code for uploading the artifacts from an appveyor example, it turns out it was quite broken. I think I have fixed it. |
|
Build execution time has reached the maximum allowed time for your plan (60 minutes). 😲 See test results for Failed build of commit 9f5febe045 |
|
oops, looks like this tried to upload the whole repo 😨 |
|
|
||
| def makeJunitXML(inFileName, outFileName): | ||
| with open(inFileName, 'rt', encoding='UTF-8') as flake8In: | ||
| with open(inFileName, 'rt', encoding='ANSI', errors='replace') as flake8In: |
There was a problem hiding this comment.
@feerrenrut
Do you think we might reconsider this line now that Flake8 runs in UTF-8 Mode as of #11108?
errors='replace' is probably still a good strategy, though.
There was a problem hiding this comment.
Perhaps so, I vaguely remember that this was a pain. If I recall, the encoding of the file was for some reason different on appveyor than it was locally.
There was a problem hiding this comment.
Perhaps so, I vaguely remember that this was a pain. If I recall, the encoding of the file was for some reason different on appveyor than it was locally.
Without the -Xutf8 flag, the encoding of the file was in the default encoding of the system,, and I have no clue if it differs between your local system and AppVeyor.
My best bet is that we should probably add the -Xutf8 to most if not all invocation of py by AppVeyor, but I don't have an AppVeyor test bed to check this idea.
I might by the way give it a try on every invocation of sys.executable made from SCons...
There was a problem hiding this comment.
the encoding of the file was in the default encoding of the system
Yep, that sounds familiar.
My best bet is that we should probably add the
-Xutf8to most if not all invocation ofpy
This sounds like a reasonable approach. Is there anyway we can just set it a default option for python?
There was a problem hiding this comment.
This sounds like a reasonable approach. Is there anyway we can just set it a default option for python?
Fortunately yes, there is one.
PEP 540 introduced the use of the PYTHONUTF8 environment variable. When set to 1, UTF-8 Mode is activated.
Note however that PYTHONIOENCODING and PYTHONLEGACYWINDOWSFSENCODING (PEP 529) take precedence when set.
If this approach is fine for AppVeyor build, I guess my recent addition of -Xutf8 for Flake8 shall then be removed from appveyor.xml
There was a problem hiding this comment.
Hmm, I think I prefer the -Xutf8 approach over environment variables, I might be paranoid but I feel it's very easy for environment variables to be modified by some layer and become really hard to find the cause of. We should probably be using something like tox
Link to issue number:
Summary of the issue:
PR-Flake8.txtfile is available from artifactsjunit.xmlfileDescription of how this pull request fixes the issue:
PR-Flake8.txtas ANSI, ignore errors.Testing performed:
Flake8.txtfile from the example failed build using thecreateJunitReport.pyscriptKnown issues with pull request:
Change log entry:
Section: New features, Changes, Bug fixes