-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Haiku fixes #24031
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
base: master
Are you sure you want to change the base?
Haiku fixes #24031
Conversation
lib/std/Build/Watch.zig
Outdated
@@ -811,7 +811,7 @@ const Os = switch (builtin.os.tag) { | |||
}; | |||
|
|||
pub fn init() !Watch { | |||
return Os.init(); | |||
return if (have_impl) Os.init() else undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong? Did you mean to return an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently build_runner calls this unconditionally and other uses are gated behind have_impl
, it would probably be better to rework the logic though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, returning an error will get the correct behavior in the build runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should hit this line if have_impl is false:
zig/lib/compiler/build_runner.zig
Line 470 in c907866
if (!Watch.have_impl) fatal("--watch not yet implemented for {s}", .{@tagName(builtin.os.tag)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We know upfront whether --watch
support is implemented, so checking it in the rebuild
loop seems a bit silly. I suggest removing that line and just returning something like error.WatchUnsupportedOnHostOs
from Watch.init()
, so that this line will bail out early with an error:
zig/lib/compiler/build_runner.zig
Line 418 in c907866
var w = if (watch) try Watch.init() else undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I tried to leave any behaviour changes out of this PR but can add it here if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helps #21094 |
various low-hanging fruit, builds usable stage3
see #7691 (comment)