-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Windows debug fix #19310
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: main
Are you sure you want to change the base?
Windows debug fix #19310
Conversation
Remove custom clamp function written before std.math supported floats and does nothing different other than separate the two.
Replaced bun.toFD call with FileDescriptor.fromNative
|
I'm not sure if its related to this PR, but it looks like there are a few tests that fail on every distro except windows now: |
| pub extern "c" fn powf(x: f32, y: f32) f32; | ||
| pub extern "c" fn pow(x: f64, y: f64) f64; | ||
|
|
||
| /// Restrict a value to a certain interval unless it is a float and NaN. |
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.
With a NaN input, bun.clamp was returning NaN but std.math.clamp returns the upper bound. Not sure how much that matters at the callsites. We can see if CI passes, at least, and I can investigate a little more.
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.
Oh I didn't notice CI already finished. The CSS test failures seem related, for example: https://buildkite.com/bun/bun/builds/15704#01967459-a513-4b88-bf65-0c0b2c61805b/2080-2137
Expected: "\n/* a.css */\nh1 {\n color: rgb(0, calc(NaN), 0);\n}\n"
Received: "/* a.css */\nh1 {\n color: #0f0;\n}\n"
Maybe let's keep this function, but only implement it for floats, and document better why we need it instead of std.math.clamp.
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 could also move it to css_parser.zig, maybe.
What does this PR do?
Removes a call to bun.toFD that (I assume used to exist and was replaced) no longer works with bun.FileDescriptor.fromNative
Also replaced the custom bun.clamp function with std.math.clamp as std.math.clamp now supports floats.
How did you verify your code works?
bun run buildnow works when before it was throwing an error.