Skip to content
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

Breaking change with InvalidUtf8 as zig introduces Wtf8 #46

Closed
AlexBlandin opened this issue Feb 27, 2024 · 1 comment
Closed

Breaking change with InvalidUtf8 as zig introduces Wtf8 #46

AlexBlandin opened this issue Feb 27, 2024 · 1 comment

Comments

@AlexBlandin
Copy link

AlexBlandin commented Feb 27, 2024

Running into this issue on Windows building ZLS nightly (as uses the latest known-folders.zig), on zig nightly (as of 6c2eb0f131588be111652a755a4492ff72d16440 but built with 0.12.0-dev.3008+b2374c4d7).

Since zig upstream has adopted Wtf8 for better Windows support, it's breaking some error handling downstream, and InvalidUtf8 is no longer used on Windows (i.e. with InvalidWtf8 it's become a WASI only error for now) which hasn't been properly documented with a release (yet, but the merge ziglang/zig#19005 has the summary of changes).

This isn't critical yet, as ZLS naturally also needs time to update, plus it's only been two days, but best to have an issue that people can at least see is there before figuring out support for 0.12. Similar to ZLS figuring out their backwards compatibility (zigtools/zls#1020) I suspect known-folders will have to make some considerations here as well, especially with breaking changes like this, though this isn't an issue for that discussion.

> zig build
install
└─ install zls
   └─ zig build-exe zls Debug native 1 errors
C:\Users\alexb\AppData\Local\zig\p\12209925016f4b5486a713828ead3bcc900fa4f039c93de1894aa7d5253f7633b92c\known-folders.zig:100:29: error: expected type 'error{OutOfMemory,InvalidWtf8,EnvironmentVariableNotFound}', found 'error{InvalidUtf8}'
                            error.InvalidUtf8 => return null,
                            ^~~~~~~~~~~~~~~~~
C:\Users\alexb\AppData\Local\zig\p\12209925016f4b5486a713828ead3bcc900fa4f039c93de1894aa7d5253f7633b92c\known-folders.zig:100:29: note: 'error.InvalidUtf8' not a member of destination error set
referenced by:
    comptime_0: C:\Users\alexb\AppData\Local\zig\p\12209925016f4b5486a713828ead3bcc900fa4f039c93de1894aa7d5253f7633b92c\known-folders.zig:339:9
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
error: the following command failed with 1 compilation errors:
C:\bin\zig\zig.exe build-exe -ODebug --dep exe_options --dep tracy --dep known-folders --dep zls -Mroot=C:\code\zig\zls\src\main.zig -Mexe_options=C:\code\zig\zls\zig-cache\c\0b9c30ddea2c61b29aa9971e1deb8de5\options.zig -ODebug --dep options -Mtracy=C:\code\zig\zls\src\tracy.zig -Mknown-folders=C:\Users\alexb\AppData\Local\zig\p\12209925016f4b5486a713828ead3bcc900fa4f039c93de1894aa7d5253f7633b92c\known-folders.zig --dep known-folders --dep diffz --dep tracy --dep build_options --dep version_data -Mzls=C:\code\zig\zls\src\zls.zig -Moptions=C:\code\zig\zls\zig-cache\c\85d0d8879cce6839a2a4dcf23c53e5d5\options.zig -Mdiffz=C:\Users\alexb\AppData\Local\zig\p\12200d71e4b7029ea56a429e24260c6c0e85a3069b0d4ba85eace21a0fd75910aa64\DiffMatchPatch.zig -Mbuild_options=C:\code\zig\zls\zig-cache\c\7e53829d1ea0122006493119e8b9b4f7\options.zig -Mversion_data=C:\code\zig\zls\zig-cache\o\328408cdc1d92dec548fab4d92e87b51\version_data_master_19780.zig --cache-dir C:\code\zig\zls\zig-cache --global-cache-dir C:\Users\alexb\AppData\Local\zig --name zls --listen=-
Build Summary: 5/8 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install zls transitive failure
   └─ zig build-exe zls Debug native 1 errors
error: the following build command failed with exit code 1:
C:\code\zig\zls\zig-cache\o\9f088f9bb5978bbefa45ac1174cba596\build.exe C:\bin\zig\zig.exe C:\code\zig\zls C:\code\zig\zls\zig-cache C:\Users\alexb\AppData\Local\zig --seed 0xadf294b1 -Z1c6b4bd0bfd2d3ca
@AlexBlandin AlexBlandin changed the title Error set mismatch error: expected type ... found 'error{InvalidUtf8}' Breaking change with InvalidUf8 as zig introduces Wtf8 Feb 27, 2024
@AlexBlandin AlexBlandin changed the title Breaking change with InvalidUf8 as zig introduces Wtf8 Breaking change with InvalidUtf8 as zig introduces Wtf8 Feb 27, 2024
@AlexBlandin
Copy link
Author

AlexBlandin commented Feb 27, 2024

Closed as #45 was merged with the fix which, with the current compatibility policy of ZLS, resolves the issue for compilation for Zig 0.12.0-dev.3030+032c2ee9b and after. It may still be worth considering the compatibility policy of known-folder, though it would likely be the same conclusion as ZLS, but again, this isn't the issue for that topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant