Skip to content

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Haiku fixes #24031

wants to merge 7 commits into from

Conversation

ypsvlq
Copy link
Contributor

@ypsvlq ypsvlq commented May 31, 2025

various low-hanging fruit, builds usable stage3

see #7691 (comment)

@@ -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;
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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:

if (!Watch.have_impl) fatal("--watch not yet implemented for {s}", .{@tagName(builtin.os.tag)});

Copy link
Member

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:

var w = if (watch) try Watch.init() else undefined;

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning an error would look something like e80e96a (or adding a conditional around the watch loop), which I don't think is an improvement.

Returning undefined was not good though, is 84013e1 okay?

@ypsvlq
Copy link
Contributor Author

ypsvlq commented Jun 5, 2025

helps #21094

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.

2 participants