Open jpalus opened 1 year ago
I'm open to this, though I'm wondering if we can in the short term add a more ergonomic way to do this externally?
In your use case, are you trying to snapshot vendor trees for crates for which you are not the upstream, to build them for a target distro/os? (I'm making this inference from this commit)
In that case, I wonder if it'd be simpler for you to just pass the platforms you want to filter on to this tool explicitly in the short term because you're in a better position to know which ones you want to support - does that make sense?
As a general rule I would like to vendorize crates for a given package so it could be later built on any Linux platform supported by rust at the time of creating vendor snapshot. While we have some supported targets now, we'd prefer to avoid narrowing vendor snapshot to those targets only. We might want to extend list of supported targets in future and keep on using same sources as much as possible.
Actually specifying explicit targets would be problematic already. At PLD Linux Distribution, as of this writing, we support x86 based architectures only including "Tier 2 without host tools" x86_64 with x32 ABI. However I do maintain unofficial ports of PLD to ARM platforms myself (including "Tier 2 without host tools" ARMv7/Thumb/NEON) but still using same sources as base PLD. In order to keep on using same vendorized sources, although stripped from heavy Windows-only parts, the easiest way would be to tell cargo-vendor-filterer
to include support for Linux based targets including Tier 2 without host tools.
Just going over some older issues...I think this would be a relatively straightforward patch; the cost would be us needing to maintain these tiers over time. Ideally we'd patch rustc to give us this information.
One thing I'd note though is I think it's in practice quite unlikely that there is ever a difference in a crate dependency tree between arm-unknown-linux-gnueabihf
and thumbv7neon-unknown-linux-gnueabihf
for example. So I think this issue is pretty theoretical...vendor-filtering is more about excluding redox and windows deps for example.
Currently
cargo-vendor-filterer
filters only down to Tier 2 with host tools: https://github.com/coreos/cargo-vendor-filterer/blob/777cf0c0bda73531f06b2443b1664546db159c5f/src/tiers.rs#L17-L38Would it be possible to extend the list or introduce some new
--tier
value to include Tier 2 platforms without host tools too? Personally I'm currently interested inthumbv7neon-unknown-linux-gnueabihf
andx86_64-unknown-linux-gnux32
but not excluding possibility of using more in future.