-
Notifications
You must be signed in to change notification settings - Fork 131
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
Make Trin compilable/(not crash) on Windows + Add check CI #923
Make Trin compilable/(not crash) on Windows + Add check CI #923
Conversation
96e72a7
to
46b9070
Compare
3759cc0
to
1810a38
Compare
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.
What do you think about moving the check to panic on Windows to the beginning of run_trin
?
drop(storage); | ||
drop(new_storage); |
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.
Why were the explicit drops necessary?
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.
They are in the tests below and above. This change isn't related to the PR. Without these drops the test will panic on certain operating systems. If you read the doc for .close() on the line below there is a comment in the doc's example about this.
Yeah, this makes a lot of sense. I'm even wondering if we should switch the |
1810a38
to
ecdaacb
Compare
resolved
I am fine with that, would that belong in a different PR then? |
ecdaacb
to
2256426
Compare
If I understand this correctly, the claim here is that windows does not support IPC? If this is the case, I'm curious what is this support for: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ ? Also saw this after googling: https://batsov.com/articles/2022/01/20/unix-sockets-are-now-supported-on-windows/ |
I never claimed Windows didn't support IPC I clearified Rust in my PR intro I am working on a PR to change this tokio-rs/mio#1667 You asked the exact same question in my last support Windows PR 4 months ago so instead of answering it here I will link to the time I already answered this #739 (comment) |
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.
I never claimed Windows didn't support IPC I clearified Rust in my PR intro
Certain parts of Trin either won't compile on Windows or crash because rust doesn't support windows Unix IPC
-->rust doesn't support windows Unix IPC
I remember now the discussion about Tokio and windows uds. By claim, I was referring to the message in this panic: https://github.com/ethereum/trin/pull/923/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R34.
It was weird because it seems Rust supports windows Unix IPC, it is Tokio that has some issues with it. So I guess fixing the PR description and the panic will make it less confusing?
That is the library we used to use 2 years ago. |
Oh that panic error. Oh ok my bad I will fix that. I should really read panic errors I steal from my old PRs. Thank you for bringing it to light. |
Ok I resolved the panic error issue |
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.
LGTM 🚢
👍🏻 Yeah, switching from build to check can go in another PR.
What was wrong?
Certain parts of Trin either won't compile on Windows or crash because rust doesn't support windows Unix IPC
How was it fixed?
By adding
#![cfg(unix)]
in files that should only be compile on windows and by adding an error if someone tries to use IPC on Windows.Reth added
#[cfg(unix)]
a few months back so the reth-ipc library will compile it will just crash when we try to use ipc functions.I also added a CI using
check
instead ofbuild
https://doc.rust-lang.org/cargo/commands/cargo-check.html
TL:DR it has all the CI benefits of building but without the codegen part. So it is a lot quicker for the result we want.