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

Won't compile on Windows on master branch #241

Open
arthmis opened this issue Dec 4, 2020 · 5 comments
Open

Won't compile on Windows on master branch #241

arthmis opened this issue Dec 4, 2020 · 5 comments

Comments

@arthmis
Copy link

arthmis commented Dec 4, 2020

  • Crate version:
    I'm using 1765119 of the master branch to get support for latest version of futures.
  • OS: I'm on Windows 10
  • Output of running docker version on the command line:
Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:00:27 2020
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

The error I'm getting is:

thread 'main' panicked at 'Unix socket support is disabled', C:\Users\Buttah\.cargo\git\checkouts\shiplift-48fc668b583d42d4\1765119\src\lib.rs:975:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace     
error: process didn't exit successfully: `target\debug\amazon-price-scraper.exe` (exit code: 101)

My Cargo.toml is:

[package]
name = "some-name"
version = "0.1.0"
authors = []
edition = "2018"

[dependencies]
scraper = "0.12.0"
prettytable-rs = "0.8.0"
textwrap = "0.12.1"
url = "2.2.0"
anyhow = "1"
async-std = {version = "1", features = ["attributes", "tokio03", "tokio02"]}
futures = "0.3.8"
cdrs-tokio = "1"
chrono = "0.4"
reqwest = { version = "0.10.9", features = ["brotli", "gzip", "native-tls", "cookies"] }
shiplift = { git = "https://github.com/softprops/shiplift.git", default-features = false, features = ["tls"] }

I think Windows support is being worked on. So I wonder if help is needed getting Windows to compile and what the issues are currently. Also how can I get around this issue?

@matthiasbeyer
Copy link
Collaborator

You cannot use Docker::new() with unix socket support disabled! You need to use Docker::host().

@elihunter173
Copy link
Contributor

I think we should look into alternative ways to initialize Dockers since Docker::new() failing without unix sockets is certainly unintuitive. #256 looked into this a bit and I think would be a good start at least, but I think that we should probably make it so Docker::new() is smarter (or doesn't exist without unix sockets).

@thomaseizinger
Copy link
Contributor

I think we should look into alternative ways to initialize Dockers since Docker::new() failing without unix sockets is certainly unintuitive. #256 looked into this a bit and I think would be a good start at least, but I think that we should probably make it so Docker::new() is smarter (or doesn't exist without unix sockets).

Agreed. Even better, instead of feature flags, those dependencies should IMO simply be chosen based on the target platform. There is little reason for pushing this responsibility to every user when it could just be solved once within shiplift.

@matthiasbeyer
Copy link
Collaborator

dependencies should IMO simply be chosen based on the target platform.

I'm not sure I like that, because it makes things harder if someone works for code on platform A while developing on platform B, right?

I agree that Docker::new is unintuitive and we should make the API more explicit.

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Mar 7, 2021

I'm not sure I like that, because it makes things harder if someone works for code on platform A while developing on platform B, right?

I've been in exactly this situation with shiplift. I was developing on Linux but the app had to work on Linux, MacOS and Windows. In the end, I had to request a windows machine for testing and set up a development environment there because there was no way otherwise to figure out, what exactly I needed to enable and patch for shiplift to work on Windows.

If anything, situations like that get easier because you don't have to care about the differences between platform A and B. You just code against a single API and the library will figure out the right thing to do based on the plethora of target related conditional compilation options.

FWIW getrandom takes exactly this approach.

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

4 participants