-
-
Notifications
You must be signed in to change notification settings - Fork 322
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(runtime): Adds conditional compilation for windows #240
feat(runtime): Adds conditional compilation for windows #240
Conversation
|
Hmmm...so as for the dummy SIGTERM, let me give it a whirl. Should I enable CI as part of this PR or do it in another once this is merged? With regards to the runtime work, is it going to be done soon enough that this PR won't be worth it? I am fine waiting if it is going to be done relatively soon, otherwise, I'd love to get this in |
Should be fine to do it in this PR.
|
This adds conditional compilation for the SIGINT interrupts. Due to the macro, this is mostly a copy/paste job with one version for windows
1a415ec
to
fb966e0
Compare
Ok, I just pushed a fix to use a dummy channel for the sigterm. Working on enabling windows support in CI. If you honestly feel like this work is probably not worth it given the incoming refactor, I am fine closing this |
2308dee
to
f51ea3f
Compare
I'll do some more digging about why the ring build is failing next week (I think I need to use the msvc target, but not entirely sure as gnu seemed to work for me when using |
IMO it's fine if some optional features are broken, considering that the current state is "doesn't even build at all". |
- checkout | ||
- run: | ||
name: "HACK: remove gitconfig to prevent ssh fetches from cargo" | ||
command: rm ~/.gitconfig |
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, this is strange. Why is this 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.
Cargo tries to pull using git urls instead of https. Couldn't find another workaround
Even if we are likely changing the way this is done, the hack is completely fine for now. Having a working CI solution on windows would be the real benefit here, since it's not a platform that gets tested a lot. So if you are able to get circle to accept it, then this would be great 👍 |
@@ -59,10 +62,18 @@ where | |||
// local development needs listening for ctrl_c | |||
let ctrlc_fut = ctrl_c().fuse(); | |||
// kubernetes apps need to listen for SIGTERM (30s warning) | |||
use signal::unix::{signal, SignalKind}; // TODO: conditional compile | |||
#[cfg(not(target_family = "windows"))] |
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.
You should be able to create a new scope and conditionally compile that scope to make this easier to read:
#[cfg(not(target_family = "windows"))]
let sigterm_fut = {
use signal::unix::{signal, SignalKind};
let mut sigterm = signal(SignalKind::terminate()).unwrap();
sigterm.recv().fuse()
};
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.
Sweet, I was wondering how I could do this
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.
So it looks like this doesn't work because recv
borrows the receiver and then that borrow doesn't last outside the scope
4be37e8
to
a4a2b60
Compare
a4a2b60
to
b6469aa
Compare
b6469aa
to
a2e030d
Compare
Not a problem at all! Thanks a lot for the PR. |
This adds conditional compilation for the SIGINT interrupts. Due
to the macro, this is mostly a copy/paste job with one version
for windows