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

Upgrade to latest Zig #1610

Merged
merged 73 commits into from
Dec 28, 2022
Merged

Upgrade to latest Zig #1610

merged 73 commits into from
Dec 28, 2022

Conversation

Jarred-Sumner
Copy link
Collaborator

This is blocked on ziglang/zig#13017.

Posting this PR here so others can follow progress

@vjpr vjpr mentioned this pull request Dec 14, 2022
@vjpr
Copy link
Contributor

vjpr commented Dec 15, 2022

Just FYI

From: https://ziglang.org/news/goodbye-cpp/

Furthermore, this change represents the removal of the -fstage1 flag, which allowed users of Zig to opt out of the new compiler and use the old one. This was the only way to take advantage of async functions, an experimental language feature that is not yet implemented in the new compiler.

I recommend users of -fstage1 to stick with 0.10.0, and then upgrade to 0.10.1 when it is released, and then finally upgrade to 0.11.0, which will have async function support. Note that Zig follows Semantic Versioning and so everything described in this blog post will not be included in the 0.10.1 release, which will only contain bug fixes cherry-picked from master branch.

Zig 0.11.0 Github milestone = https://github.com/ziglang/zig/milestone/17

...Aiming for two weeks after LLVM 16.0.0 release...Due by May 29, 2023

@vjpr
Copy link
Contributor

vjpr commented Dec 15, 2022

andrewrk — Today at 20:19
current development focus:
...

  • fixing bugs in the compiler such as the one preventing Bun from updating to latest master branch due to the compiler crashing

...

https://discord.com/channels/605571803288698900/785499283368706060/1053028467517698048

@Jarred-Sumner
Copy link
Collaborator Author

Rebased against main after @Vexu's changes

Once ziglang/zig#14004 is merged, I'll give it another try

@Jarred-Sumner
Copy link
Collaborator Author

Current status: stuck on a confusing compiler error. It seems to think that a function that doesn't use try needs to return an error union type

image

error: expected error union type, found '?*bun.js.javascript_core_c_api.generic'
        return js.JSValueMakeUndefined(ctx);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    readFileAsBytes: src/bun.js/api/bun.zig:801:20
    Class: src/bun.js/api/bun.zig:1129:23
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

/home/jarred/zig/0.11.0-dev.926+266e2e9a3/files/lib/std/mem.zig:3644:9: error: expected []T or *[_]T, passed error{OutOfMemory}![]i32
        @compileError("expected []T or *[_]T, passed " ++ @typeName(sliceType));
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jarred/zig/0.11.0-dev.926+266e2e9a3/files/lib/std/mem.zig:3651:59: note: called from here
pub fn sliceAsBytes(slice: anytype) SliceAsBytesReturnType(@TypeOf(slice)) {

@Jarred-Sumner Jarred-Sumner marked this pull request as ready for review December 27, 2022 08:26
@Jarred-Sumner Jarred-Sumner merged commit c0dd284 into main Dec 28, 2022
@Jarred-Sumner Jarred-Sumner deleted the jarred/attempt-upgrade branch December 28, 2022 08:51
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

Successfully merging this pull request may close these issues.

3 participants