-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vm] dart2native on Windows fails to correctly compile nnbd opt-out code #43955
Comments
Just a couple of notes on this. I confirmed that the test runs correctly on mac, and that the testSource code embedded in the test is run as opted out when run on mac. The error message on windows indicates that the testSource code embedded in the test is run as opted in + strong mode when run on windows. |
I'm not going to block the flag flip on this, since it seems to be something fairly idiosyncratic. I will plan on approving this failure, since this is the last failing test. |
This has been a long standing problem with this test on Windows which I think has roots in front-end: |
Since this is a long standing problem, and non-blocking, I'm moving this out of "flag flip work" Epic |
I think the issue is with dart2native canonicalizing source path, which results in different case for the filename compared to the package filename, which results in package_config inability to map filename to package uri and assuming that file have to be compiled using current sdk language version. |
cc @lrhn @natebosch is this something that package_config should handle? |
I think it would make the most sense to canonicalized paths as the file is written. |
Agree. I don't want |
I've uploaded cl/170093 which fixes this test. |
@aam, can you point me to where in package_config this happens? I would argue any of our tools that takes paths as command line input should be able to handle any valid path - whether it's been canon. or not. |
The specific issue with The problem occurred because a dart file path and a packages path were handled differently (former was lower cased, the latter not). Those paths are later converted into Now there's a higher level question:
If we want to move this responsibility to the place where paths get converted to Uris, then the right place might be in pkg/front_end/lib/src/fasta/resolve_input_uri.dart - @johnniwinther wdyt? (Other tools that don't use CFE's Path->Uri logic might need to be updated as well) |
Why incorrect casing? Windows had its own concept of correct casing for files so for example resolving file name could result in mixed casing like "C:\Users\username\AppData\Local\Temp\instruction-sizes-test-collapse-by-packagef3c0a70e.packages".
I wonder whether it is worth an effort and complexity. Case-insensitivity of file paths is only applicable to Windows and normally doesn't get in a way if you get filename from the filesystem and just use it as is. Separately it would also help to be clear to the user that their script was treated as nnbd opt-in vs opt-out code because it was not resolved to package uri. |
If someone writes {
"name": "floo",
"rootUri": "file:///C:/MyCode/libs/floo/bin/floo.dart",
.. then a lookup of On non-Windows platforms that behavior is correct because there might be both a Alternatively, we can parameterize the package_config package with a |
I'm seeing pkg/vm_snapshot_analysis/test/precompiler_trace_test breaking on the windows package bot only with the null safety flag flip CL. This test passes locally on my mac. See log here
I don't know whether this is an infra issue with the bots (cc @athomas ), or something with the test or the vm (cc @a-siva )
The text was updated successfully, but these errors were encountered: