coreos / cargo-vendor-filterer

Tool to `cargo vendor` with filtering
Apache License 2.0
38 stars 8 forks source link

Fails on `ws2_32-sys` #37

Closed pprkut closed 1 year ago

pprkut commented 1 year ago

This is probably similar to #32

I tried running vendor-filterer on https://github.com/nushell/nushell/ with this config:

[package.metadata.vendor-filter]
platforms = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
all-features = true
exclude-crate-paths = [
  { name = "libgit2-sys", exclude = "libgit2" },
  { name = "libsqlite3-sys", exclude = "sqlite3" },
  { name = "libsqlite3-sys", exclude = "sqlcipher" },
  { name = "libssh2-sys", exclude = "libssh2" },
  { name = "libz-sys", exclude = "src/zlib" },
  { name = "libz-sys", exclude = "src/zlib-ng" },
  { name = "lz4-sys", exclude = "liblz4" },
  { name = "openssl-src", exclude = "openssl" },
  { name = "zstd-sys", exclude = "zstd" },
]

and get this error:

Skipping nu-parser
Skipping nu_plugin_inc
Skipping nu-glob
Skipping nu_plugin_gstat
Skipping nu-engine
Skipping nu-path
Skipping nu_plugin_custom_values
Skipping nu-protocol
Skipping nu-test-support
Skipping nu-color-config
Skipping nu_plugin_query
Skipping nu-utils
Skipping nu-table
Skipping nu-term-grid
Skipping nu-system
Skipping nu-cli
Skipping nu-plugin
Skipping nu-json
Skipping nu_plugin_example
Skipping nu-command
Skipping nu
Skipping nu-pretty-hex
Replacing unreferenced package with stub: windows-sys
Replacing unreferenced package with stub: malloc_buf
Replacing unreferenced package with stub: ntapi
Replacing unreferenced package with stub: winres
Replacing unreferenced package with stub: riscv-target
Replacing unreferenced package with stub: windows-0.37.0
Replacing unreferenced package with stub: rdrand
Replacing unreferenced package with stub: crossterm_winapi
Replacing unreferenced package with stub: core-foundation
Replacing unreferenced package with stub: semver-parser-0.7.0
Replacing unreferenced package with stub: rustc-hash
Replacing unreferenced package with stub: objc
Replacing unreferenced package with stub: windows
Replacing unreferenced package with stub: shlex
Replacing unreferenced package with stub: wasm-bindgen
Replacing unreferenced package with stub: web-sys
Replacing unreferenced package with stub: wasi-0.9.0+wasi-snapshot-preview1
Replacing unreferenced package with stub: volatile-register
Replacing unreferenced package with stub: atomic-polyfill
Replacing unreferenced package with stub: android_system_properties
Replacing unreferenced package with stub: omnipath
Replacing unreferenced package with stub: windows_aarch64_msvc-0.36.1
Replacing unreferenced package with stub: fuchsia-zircon
Replacing unreferenced package with stub: windows_i686_gnu
Replacing unreferenced package with stub: wasm-bindgen-macro
Replacing unreferenced package with stub: winapi-util
Replacing unreferenced package with stub: fsevent-sys
Replacing unreferenced package with stub: peeking_take_while
Replacing unreferenced package with stub: rand_core-0.4.2
Replacing unreferenced package with stub: critical-section
Replacing unreferenced package with stub: winapi-build
Replacing unreferenced package with stub: cty
Replacing unreferenced package with stub: windows_i686_msvc-0.36.1
Replacing unreferenced package with stub: fuchsia-zircon-sys
Replacing unreferenced package with stub: cexpr
Replacing unreferenced package with stub: windows_x86_64_msvc-0.36.1
Replacing unreferenced package with stub: rand_core-0.3.1
Replacing unreferenced package with stub: bindgen
Replacing unreferenced package with stub: rand_hc
Replacing unreferenced package with stub: instant
Replacing unreferenced package with stub: vcell
Replacing unreferenced package with stub: wasm-bindgen-backend
Replacing unreferenced package with stub: windows_i686_gnu-0.36.1
Replacing unreferenced package with stub: windows_i686_gnu-0.37.0
Replacing unreferenced package with stub: embedded-hal
Replacing unreferenced package with stub: nb
Replacing unreferenced package with stub: schannel
Replacing unreferenced package with stub: windows_x86_64_gnullvm
error: Replacing with stub: ws2_32-sys: Executing cargo metadata: Error during execution of `cargo metadata`: error: failed to load manifest for dependency `winapi-build`

Caused by:
  failed to read `/mnt/progs/slack/builds/nushell/nushell-0.71.0/build/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

What's actually a bit annoying is that it stops after that error. It would be nice that, even if it encounters a lib that can't be replaced, that it just skips it and moves on with the rest.

cgwalters commented 1 year ago

What's actually a bit annoying is that it stops after that error. It would be nice that, even if it encounters a lib that can't be replaced, that it just skips it and moves on with the rest.

Hmm. Yes, perhaps one approach we could take is actually to not try to rewrite Cargo.toml at all, and just neuter the sources...will look at that.

cgwalters commented 1 year ago

Marking this as a dup of https://github.com/coreos/cargo-vendor-filterer/issues/32 which will fix this issue.