Skip to content

Commit 122f5d3

Browse files
authored
Allow building under longer paths (#44)
It turns out that #41 was insufficient since `cmake` will forcibly _set_ `CMAKE_INSTALL_PREFIX` to the output directory (which is under the target directory) if it isn't already set[1]. So, we need to explicitly set a short dummy value. This should hopefully _actually_ fix docs.rs builds. The version bump to ibverbs (non-sys) is just to force docs.rs to attempt re-generation of the docs. [1]: https://github.com/rust-lang/cmake-rs/blob/94da9de2ea79ab6cad572e908864a160cf4847a9/src/lib.rs#L699-L703
1 parent b45ae84 commit 122f5d3

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ibverbs-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ibverbs-sys"
3-
version = "0.3.0+55.0"
3+
version = "0.3.1+55.0"
44
edition = "2021"
55
rust-version = "1.82" # unsafe extern in generated bindings
66

ibverbs-sys/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ fn main() {
2828
eprintln!("run cmake");
2929
let built_in = cmake::Config::new("vendor/rdma-core")
3030
.define("NO_MAN_PAGES", "1")
31+
// cmake crate defaults CMAKE_INSTALL_PREFIX to the output directory
32+
//
33+
// https://github.com/rust-lang/cmake-rs/blob/94da9de2ea79ab6cad572e908864a160cf4847a9/src/lib.rs#L699-L703
34+
//
35+
// this results in overly long runtime paths on docs.rs, which then fail the build. it also
36+
// causes sadness for users trying to build since the bindings may fail to build for the
37+
// same reason (see https://github.com/jonhoo/rust-ibverbs/pull/41 for what was an
38+
// incomplete fix).
39+
//
40+
// since we never actually _install_ anything when building here, we should be able to
41+
// safely set this to any short path. simply by convention we set it to `/usr`.
42+
.define("CMAKE_INSTALL_PREFIX", "/usr")
3143
.no_build_target(true)
3244
.build();
3345
let built_in = built_in

ibverbs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ibverbs"
3-
version = "0.9.0"
3+
version = "0.9.1"
44
edition = "2021"
55

66
description = "Bindings for RDMA ibverbs through rdma-core"

0 commit comments

Comments
 (0)