kenz-gelsoft / wxRust2

re-exploration Rust binding to wx
MIT License
77 stars 10 forks source link

Fix docs.rs build error #168

Closed kenz-gelsoft closed 1 year ago

kenz-gelsoft commented 1 year ago

https://docs.rs/crate/wxrust-base/0.0.1-alpha

Consult their doc:

kenz-gelsoft commented 1 year ago

Created Ubuntu 20.04 VM to determine what package is required to build on docs.rs

kenz-gelsoft commented 1 year ago

Installed packages to build (WIP)

At this stage, I got same error output as docs.rs

error: failed to run custom build command for `wxrust-base v0.0.1-alpha`

Caused by:
  process didn't exit successfully: `/home/kenz/src/wxRust2/target/debug/build/wxrust-base-f22040c3ee87a585/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'failed execute wx-config command.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/kenz/.cargo/git/checkouts/wxrust-vendored-config-2459bb25f7f509b9/245f52f/src/lib.rs:28:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
kenz-gelsoft commented 1 year ago

These packages seem already installed...

Command 'wx-config' not found, but can be installed with:

sudo apt install libwxbase3.0-dev # version 3.0.4+dfsg-15build1, or sudo apt install libwxgtk3.0-gtk3-dev # version 3.0.4+dfsg-15build1

kenz-gelsoft commented 1 year ago

apt install part of dockerfile of crates-build-env

# Install the packages contained in `packages.txt`
COPY packages.txt /opt/crates-build-env/packages.txt
RUN apt-get update && \
    cat /opt/crates-build-env/packages.txt | DEBIAN_FRONTEND=noninteractive xargs apt-get install -y && \
    rm -rf /var/lib/apt/lists/*
kenz-gelsoft commented 1 year ago

Installed packages to build

error occurred: Failed to find tool. Is `c++` installed?

Built successfully after installed above packages.

kenz-gelsoft commented 1 year ago

These packages seem already installed...

https://github.com/rust-lang/crates-build-env/blob/master/linux/packages.txt#L902

didn't include -dev package. I'll send PR to add this.

kenz-gelsoft commented 1 year ago

I sent PR: https://github.com/rust-lang/crates-build-env/pull/108

kenz-gelsoft commented 1 year ago

Fixed!