Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10 exploratory build on openbsd 75 #869

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,23 @@ The library layers in Oxigraph. The elements above depend on the elements below:

A preliminary benchmark [is provided](bench/README.md). There is also [a document describing Oxigraph technical architecture](https://github.com/oxigraph/oxigraph/wiki/Architecture).

## Building

When cloning this codebase, don't forget to clone the submodules using
`git clone --recursive https://github.com/oxigraph/oxigraph.git` to clone the repository including submodules or
`git submodule update --init` to add the submodules to the already cloned repository.

When building on OpenBSD, libclang must be available for
RocksDB. Setting the LIBCLANG_PATH environment variable will ensure it
is found. For example:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can maybe just link from there to bindgen installation requirement that covers this topic in more details. What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linking to that documentation is clearly the better way to go. Thanks! I just need to check that the documented export LIBCLANG_PATH=/usr/local/lib actually works since with OpenBSD 7.5 and the llvm package I tested against, the libclang.so.0.0 is under /usr/local/llvm16/lib. If it fails then the fix would be to file a separate issue with the bindgen project for a documentation update over there.


```
pkg_ad llvm
export LIBCLANG_PATH="/usr/local/llvm16/lib/libclang.so.0.0"
```

Running the test suite may require more memory or other resources than
available by default limits in OpenBSD.

## Help

Expand Down
3 changes: 2 additions & 1 deletion lib/oxigraph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ digest.workspace = true
hex.workspace = true
json-event-parser.workspace = true
md-5.workspace = true
openssl-sys = "0.9.102"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will try compile openssl-sys for all plateforms, includings ones where we use the host native SSL implementation if the http-client-native-tls feature is enabled (macOS, Windows) and WASM where openssl can't be compiled. I would tend to think it would be better to dynamically link to libressl on OpenBSD, it seems to work or, if not, only add this dependency if the target is openbsd and the http-client-native-tls feature is enabled.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes perfect sense. I will investigate the dynamic linking approach on OpenBSD and try that instead.

I have to research this a bit further, but it seemed that an older version of openssl-sys was being used in the build. I have to track down how that happened without it being listed in Cargo.toml or Cargo.lock files. I could have misinterpreted the build errors at the time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is weird, I see openssl-sys in the lock file. It is a dependency of native-tls that is itself a dependency of oxhttp if the native-tls feature is enabled (this feature is enabled by the http-client-native-tls feature of oxigraph)

oxilangtag.workspace = true
oxiri.workspace = true
oxrdf = { workspace = true, features = ["rdf-star", "oxsdatatypes"] }
Expand Down Expand Up @@ -69,4 +70,4 @@ rustdoc-args = ["--cfg", "docsrs"]
[[bench]]
name = "store"
harness = false
required-features = ["rocksdb"]
required-features = ["rocksdb"]
15 changes: 14 additions & 1 deletion oxrocksdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,20 @@ fn build_rocksdb() {
config.define("OS_FREEBSD", None);
config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
} else if target.contains("windows") {
} else if target.contains("openbsd") {
config.define("OS_OPENBSD", None);

// Depends on `pkg_add llvm` installation and setting of
// LIBCLANG_PATH environment variable to location of the
// library. For example:
//
// export LIBCLANG_PATH=\
// "/usr/local/llvm16/lib/libclang.so.0.0"

config.define("ROCKSDB_PLATFORM_POSIX", None);
config.define("ROCKSDB_LIB_IO_POSIX", None);
}
else if target.contains("windows") {
link("rpcrt4", false);
link("shlwapi", false);
config.define("DWIN32", None);
Expand Down