Closed kenz-gelsoft closed 1 year ago
I thought optional dependency will be allowed on publishing. But it wasn't.
@ancwrd1 Could you give me any advice on this?
You mean publish on crates.io? I think it requires that the dependency is also there but I haven't published them yet.
I can probably publish version 0.1.0 or similar, but I also wanted to upgrade it first to wx 3.2, currently it's on 3.1.6.
Yes, I mean publishing on crates.io as an alpha release for now.
It is OK publishing your vendored crates too, but I think those repo are a bit special to be hosted on crates.io.
So I want to find another way to incorporate them into wxRust.
I prefer not specifying any real prebuilt binary crate.
Ideas
1st approch looks cleaner but the 2nd may be more trivial.
I searched cargo command line option to override dependency temporarily, but not exist.
I'll explore an way to move those dependency out from library crates to sample crates.
Publishing large binaries won't work, you are right. There is a max size limitation on the package size uploaded to crates.io. One possibility is to clone them manually from the build.rs script during building (somewhere under target directory), but I think this requires to change the build logic quite a bit. You can also disable this feature and dependencies for now and publish the alpha version which relies on system-wide wxWidgets.
One solution could be to create a wx-src
source-only crate which builds wxWidgets on the fly, similar to e.g. https://github.com/alexcrichton/openssl-src-rs and have it under vendored
feature gate.
It will surely significantly increase build times but only for the first build, and in many cases that might be acceptable.
Thank you for taking time on this.
I'm trying following approach:
pub fn wx_config()
on each crate's lib.rs which resemble build.rs one.Accidentally closed, reopen.
This mechanism doesn't work per-target repo.
I'll try to make a git repo crate (won't be published) to support multiple build-target vendoring.
wxrust-vendored-config
which has same metadata with wxrust-config crate.patch.crates-io
new crate.Next, I'll try the placeholder approch if work.
The current approch doesn't work with cross toolchain situation as https://github.com/kenz-gelsoft/wxRust2/pull/166#issuecomment-1238736318.