Closed yveszoundi closed 2 years ago
I can not reproduce this on my macOs and debian bullseye . Could your provide more details about your environment like your os version 、cargo version etc
I "suspect" that via some cargo environment variables it should be possible to setup expected file/libraries locations.
cargo will deal this part when using OUT_DIR
see cargo-build-scripts
Thanks for the prompt response, I updated the bug description to describe the test environments (Ubuntu and Void Linux).
I also created a git repository with a basic project for reproducing the issue: https://github.com/yveszoundi/libreoffice-rs-tests
Please let me know if more information is needed or if I doing something fundamentally wrong.
I figured this out finally, if your first build failed, usually LibreOfficeKit header files not exists in search path, this error is ignored,so bindings.rs will generated, then whatever you change LO_INCLUDE_PATH, build.rs will not invoked any more. Before this issue get fixed you can run cargo clean
and try to build again .
Out of the box, it doesn't seem possible to link against
libreoffice-rs
. Just addinglibreoffice-rs= "0.2.0"
in a cargo manifest file results into several compilation errors.Test environments
Void Linux (Rolling release, amd64)
Many common dev tools are installed, including the following:
Ubuntu Linux Jammy (22.04, amd64)
Many common dev tools are installed, including the following:
How to reproduce
A sample test repository can be found at https://github.com/yveszoundi/libreoffice-rs-tests
LO_INCLUDE_PATH
variable, if not matching default locations inbuild.rs
cargo build
orLO_INCLUDE_PATH=/usr/lib/INCLUDE_PATH_HERE cargo build
Additional information
By default, the build will not be able to find the
wrapper
library, possibly due to relative path issues I think. I "suspect" that via some cargo environment variables it should be possible to setup expected file/libraries locations.Workaround
The only way for me to test the library was the following:
libreoffice-rs
separately:LO_INCLUDE_PATH=/usr/include/LibreOfficeKit cargo build
Cargo.toml
:libreoffice-rs = { path = "../libreoffice-rs" }