-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 platform): Allow building on Windows Stable Rust #1560
Conversation
Signed-off-by: Ana Hobden <[email protected]>
lib/file-source/Cargo.toml
Outdated
@@ -14,6 +14,8 @@ scan_fmt = "0.2.3" | |||
tracing = "0.1.2" | |||
indexmap = {version = "1.0.2", features = ["serde-1"]} | |||
flate2 = "1.0.6" | |||
winapi = { version = "0.3.8", features = ["winioctl"] } |
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 think we pullin winapi 0.2
via mio 0.6
to avoid a duplicate here for now, is it possible to use winapi 0.2
? I don't think this should hurt compile times either since we already need to compile it.
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.
Fantastic, great catch. :) I'll verify this and make the change.
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.
Seems winapi 2.x doesn't have some variables like FSCTL_GET_REPARSE_POINT
. :(
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.
thats fine, its windows anyways :)
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!
cc @lukesteensen @a-rodin you both might be interested in this change.
7f2e7df
to
ec4379f
Compare
Signed-off-by: Ana Hobden <[email protected]>
ec4379f
to
cb9dee6
Compare
Signed-off-by: Ana Hobden <[email protected]>
cb9dee6
to
d4af4c3
Compare
Signed-off-by: Ana Hobden <[email protected]>
I think 3388a74 is enough to get Windows on CI to use stable now. |
Hm, I'm not sure if this is a related failure: https://circleci.com/gh/timberio/vector/78014
|
I am similarly confused by: https://circleci.com/gh/timberio/vector/78008
|
I ran this check locally and it passed. Sometimes the CI instance turns out to be too slow, which makes this test fail. Restarting the job might help.
It is a known issue, see #1527. It is safe to ignore it for now as it is not related to the changes. |
I think this just needs a rebase/merge of master? |
Let's have a try. :) |
Just a note: we probably would need to update the instructions for building Vector on Windows to use stable Rust. These instructions can be updated by changing the template and running |
@Hoverbear would you mind doing what @a-rodin said and then we can merge? Thanks! |
Absolutely! |
Signed-off-by: Ana Hobden <[email protected]>
@LucioFranco A final look over? |
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!
Nice work! |
Support building on Windows with
rustc
stable.This PR fixes #1480 by importing a few pieces of stdlib code.
In #1480 @LucioFranco and I discussed some reasoning about why the code is here and not another module. In short: It's simpler! I'd be happy to make it a separate mod though.
The only usages were:
https://github.com/timberio/vector/blob/b290ceb2aee4242834d434a4bd092fe2a0cece3b/lib/file-source/src/metadata_ext.rs#L23-L30
Implementation notes
It was a small conundrum since
Metadata
doesn't have this information without the nightly feature. With that feature enabled this following code builds the datum which the functions we want read from:https://github.com/rust-lang/rust/blob/30ddb5a8c1e85916da0acdc665d6a16535a12dd6/src/libstd/sys/windows/fs.rs#L326-L351
So the easiest solution was to have the consumer code in
file_server.rs
andfile_watcher.rs
work with the file handle instead of the metadata, and then extend theFile
type.Caveats:
FIXME
tag to the file to make sure folks can know why it's there.