Offline build excluding cfg dependencies

I am trying to do an offline build on linux without any windows only dependencies included in my "vendored" dependencies.

I am currently running into the following error

cargo install --no-track --offline   --path . --root debian/my-service/opt/bb
  Installing http_sign_flip v0.1.1 (/tmp/my-service-0.1.1)
error: failed to compile `http_sign_flip v0.1.1 (/tmp/my-service-0.1.1)`, intermediate artifacts can be found at `/tmp/my-service-0.1.1/target`

Caused by:
  no matching package named `windows` found
  location searched: registry `crates-io`
  required by package `generator v0.7.1`
      ... which satisfies dependency `generator = "^0.7"` of package `loom v0.5.6`
      ... which satisfies dependency `loom = "^0.5"` of package `state v0.5.3`
      ... which satisfies dependency `state = "^0.5.1"` of package `rocket v0.5.0-rc.2`
      ... which satisfies dependency `rocket = "^0.5.0-rc.1"` of package `http_sign_flip v0.1.1 (/tmp/my-service-0.1.14)`

The generator crate optionally depends on the windows crate but this is a 250MB crate that I would rather not have in the offline build.

Any pointers would be appreciated.

Cargo doesn't support this yet, but you may want to follow:

https://github.com/rust-lang/cargo/issues/7058

Thanks

To be clear the problem isn't really the vendoring. I can always filter out the libraries I don't want to be vendored. The resolver still looks for the platform specific dependencies when I would have thought it wouldn't need to do that.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.