-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
We already rely on this behavior in bootstrap.zig but it is special magic:
Line 4 in 6cc2d39
| const root = @import("@root"); |
This proposal would make it always available and so the above code would not be special magic anymore.
It's reasonable for userland libraries to have global configuration and use the root source file for that. For example this would be a necessary component of #1778.
This, along with #1439 would allow us to move some of the global panic function magic to userland, and potentially even the startup code. build-exe would unconditionally include the startup code, which would have a comptime block which examines the root source file for main, _start, etc, and determines what it should export.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.