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

feat: Windows + CMake Build System #4410

Merged
merged 241 commits into from Oct 27, 2023
Merged

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

don't have time before bun 1.0 to learn enough to get good at windows I/O

so we will use libuv on Windows

this is the prep code, does nothing but hopefully it's mergeable and then we can implement FilePoll, PollRef and then various functions.

How did you verify your code works?

it doesn't work

@github-actions
Copy link

github-actions bot commented Aug 30, 2023

@paperdave 1 files with test failures on linux-x64:

  • test/js/bun/util/filesink.test.ts

View test output

#838c85c821f89aa0b99a6ec62997e78cea1367e1

@github-actions
Copy link

github-actions bot commented Aug 30, 2023

@paperdave 1 files with test failures on linux-x64-baseline:

  • test/js/bun/util/filesink.test.ts

View test output

#838c85c821f89aa0b99a6ec62997e78cea1367e1

@github-actions
Copy link

github-actions bot commented Aug 30, 2023

@paperdave 9 files with test failures on bun-darwin-x64-baseline:

  • test/integration/next/default-pages-dir/test/dev-server.test.ts
  • test/integration/next/default-pages-dir/test/next-build.test.ts
  • test/js/bun/spawn/spawn-streaming-stdout.test.ts
  • test/js/bun/util/filesink.test.ts
  • test/js/bun/util/which.test.ts
  • test/js/node/fs/fs.test.ts
  • test/js/third_party/webpack/webpack.test.ts
  • test/js/web/timers/setTimeout.test.js
  • test/js/web/worker.test.ts

View test output

#838c85c821f89aa0b99a6ec62997e78cea1367e1

@github-actions
Copy link

github-actions bot commented Aug 31, 2023

prettier errors have been resolved. Thank you.

#838c85c821f89aa0b99a6ec62997e78cea1367e1

@github-actions
Copy link

github-actions bot commented Aug 31, 2023

@paperdave 6 files with test failures on bun-darwin-aarch64:

  • test/cli/install/bun-install.test.ts
  • test/cli/install/bunx.test.ts
  • test/integration/next/default-pages-dir/test/dev-server.test.ts
  • test/js/bun/test/test-test.test.ts
  • test/js/bun/util/which.test.ts
  • test/js/node/watch/fs.watch.test.ts

View test output

#838c85c821f89aa0b99a6ec62997e78cea1367e1

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

zig fmt errors have been resolved. Thank you.

#838c85c821f89aa0b99a6ec62997e78cea1367e1
zig v0.12.0-dev.1297+a9e66ed73

@@ -2032,7 +2037,7 @@ pub const DNSResolver = struct {
.code = bun.String.static(err.code()),
.message = bun.String.static(err.label()),
};

defer ip_slice.deinit();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: this is sus

@@ -145,7 +145,7 @@ pub const Arguments = struct {
var paths = [_]string{ cwd, filename };
const outpath = try std.fs.path.resolve(allocator, &paths);
defer allocator.free(outpath);
var file = try std.fs.openFileAbsolute(outpath, std.fs.File.OpenFlags{ .mode = .read_only });
var file = try bun.openFileZ(&try std.os.toPosixPath(outpath), std.fs.File.OpenFlags{ .mode = .read_only });
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: this shouldn't be posix

supported_method = .copyfile;
supported_method_to_use = .copyfile;
},
// error.ENXIO => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO:!

const NetworkChannel = sync.Channel(*NetworkTask, .{ .Static = 8192 });

// Windows seems to stack overflow in debug builds due to the size of these allocations.
const TaskChannel = sync.Channel(Task, .{ .Static = 4096 / (if (Environment.isWindows) 16 else 1) });
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

todo: remove this diff

}

pub fn sleep(this: *PackageManager) void {
if (this.wait_count.swap(0, .Monotonic) > 0) return;
Output.flush();
_ = this.waiter.wait() catch 0;
bun.Mimalloc.mi_collect(false);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

collect is bad

@Jarred-Sumner Jarred-Sumner merged commit 7485c7c into main Oct 27, 2023
3 checks passed
@Jarred-Sumner Jarred-Sumner deleted the jarred/prepare-for-libuv branch October 27, 2023 08:51
RaisinTen added a commit to RaisinTen/bun that referenced this pull request Oct 27, 2023
It was added in oven-sh#4410. The `src`
directory is not supposed to be a part of the path.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
paperdave pushed a commit that referenced this pull request Oct 27, 2023
It was added in #4410. The `src`
directory is not supposed to be a part of the path.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
RaisinTen added a commit to RaisinTen/bun that referenced this pull request Oct 27, 2023
Running the script ended with this error:

```sh
$ bash ./scripts/setup.sh
...
ninja: error: loading 'build.ninja': No such file or directory
```

It happens because the `build.ninja` file is inside the `build`
directory, not the current directory, so `ninja` is not able to detect
the presence of that file and run the builds.

The error started happening in oven-sh#4410,
where this script was introduced.

Signed-off-by: Darshan Sen <raisinten@gmail.com>
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.

None yet

7 participants