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

How can I use this tool on Windows #339

Open
ronenfe opened this issue Jul 3, 2024 · 4 comments
Open

How can I use this tool on Windows #339

ronenfe opened this issue Jul 3, 2024 · 4 comments

Comments

@ronenfe
Copy link

ronenfe commented Jul 3, 2024

I'm running the AWS CLI in windows command prompt. How can I download and use this tool?

@ronenfe ronenfe changed the title How can I use this tool How can I use this tool on Windows Jul 3, 2024
@ronenfe
Copy link
Author

ronenfe commented Jul 3, 2024

Ok, I had to first install VS Build tools C++ and Rust for windows.

@ronenfe ronenfe closed this as completed Jul 3, 2024
@ronenfe ronenfe reopened this Jul 3, 2024
@ronenfe
Copy link
Author

ronenfe commented Jul 3, 2024

Installation failed with following errors:

 Compiling coldsnap v0.6.1
error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\block_device.rs:11:14
   |
11 | use std::os::unix::io::AsRawFd;
   |              ^^^^ could not find `unix` in `os`
   |
note: found an item that was configured out
  --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\std\src\os\mod.rs:26:9
note: found an item that was configured out
  --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\std\src\os\mod.rs:64:9

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\download.rs:21:14
   |
21 | use std::os::unix::fs::FileTypeExt;
   |              ^^^^ could not find `unix` in `os`
   |
note: found an item that was configured out
  --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\std\src\os\mod.rs:26:9
note: found an item that was configured out
  --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\std\src\os\mod.rs:64:9

error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\upload.rs:25:14
   |
25 | use std::os::unix::fs::FileTypeExt;
   |              ^^^^ could not find `unix` in `os`
   |
note: found an item that was configured out
  --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\std\src\os\mod.rs:26:9
note: found an item that was configured out
  --> /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081\library\std\src\os\mod.rs:64:9

error[E0432]: unresolved import `nix::ioctl_read`
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\block_device.rs:20:9
   |
20 |     use nix::ioctl_read;
   |         ^^^^^^^^^^^^^^^ no `ioctl_read` in the root

error[E0425]: cannot find function `blkgetsize64` in module `ioctl`
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\block_device.rs:32:34
   |
32 |     let result = unsafe { ioctl::blkgetsize64(file.as_raw_fd(), &mut block_device_size) }
   |                                  ^^^^^^^^^^^^ not found in `ioctl`

error[E0412]: cannot find type `Error` in crate `nix`
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\block_device.rs:60:58
   |
60 |         GetBlockDeviceSize { path: PathBuf, source: nix::Error },
   |                                                          ^^^^^ not found in `nix`
   |
help: consider importing one of these items
   |
47 +     use aws_sdk_ebs::Error;
   |
47 +     use aws_sdk_ec2::Error;
   |
47 +     use core::error::Error;
   |
47 +     use core::fmt::Error;
   |
     and 11 other candidates
help: if you import `Error`, refer to it directly
   |
60 -         GetBlockDeviceSize { path: PathBuf, source: nix::Error },
60 +         GetBlockDeviceSize { path: PathBuf, source: Error },
   |

error[E0599]: no method named `is_block_device` found for struct `FileType` in the current scope
   --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\download.rs:449:34
    |
449 |         if file_meta.file_type().is_block_device() {
    |                                  ^^^^^^^^^^^^^^^ method not found in `FileType`

error[E0599]: no method named `is_block_device` found for struct `FileType` in the current scope
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\upload.rs:85:50
   |
85 |         let file_size = if file_meta.file_type().is_block_device() {
   |                                                  ^^^^^^^^^^^^^^^ method not found in `FileType`

error[E0599]: no method named `as_raw_fd` found for struct `std::fs::File` in the current scope
  --> C:\Users\ronen\.cargo\registry\src\index.crates.io-6f17d22bba15001f\coldsnap-0.6.1\src\block_device.rs:32:52
   |
32 |     let result = unsafe { ioctl::blkgetsize64(file.as_raw_fd(), &mut block_device_size) }
   |                                                    ^^^^^^^^^
   |
help: there is a method `as_raw_handle` with a similar name
   |
32 |     let result = unsafe { ioctl::blkgetsize64(file.as_raw_handle(), &mut block_device_size) }
   |                                                    ~~~~~~~~~~~~~

Some errors have detailed explanations: E0412, E0425, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `coldsnap` (lib) due to 9 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `coldsnap v0.6.1`, intermediate artifacts can be found at `C:\Users\ronen\AppData\Local\Temp\cargo-installlVxVyd`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@rpkelly
Copy link
Contributor

rpkelly commented Jul 3, 2024

Hi, thanks for your interest in using coldsnap. Unfortunately, this tool only supports unix based operating systems (as seen in the error you're hitting trying to compile on Windows). I would assume that the Windows Subsystem for Linux (WSL) would be enough to run this, but I have not tested it

@rlights
Copy link

rlights commented Aug 15, 2024

Confirming it runs fine in WSL (Ubuntu), however on download I was getting around 10% failed blocks until I specified the region, not sure if this is expected behaviour.
For anyone else finding this in future: I had to remove the default rust installation populated in my wsl (sudo apt-get remove rustc) and install the latest with rustup (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh)
Not sure if this will apply to everyone since this is an older wsl instance.

Perhaps it'd be worth at least mentioning in the readme that this doesn't operate on windows since rust is intended to be cross platform.

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

No branches or pull requests

3 participants