You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--- stderr
libmodsecurity cannot be found on the system:
pkg-config exited with status code 1
> PKG_CONFIG_PATH= PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags modsecurity modsecurity >= 3.0.6
The system library `modsecurity` required by crate `modsecurity-sys` was not found.
The file `modsecurity.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
-
HINT: you may need to install a package such as modsecurity, modsecurity-dev or modsecurity-devel.
Vendoring is not supported at this time.
Dockerfile:
FROM rust:latest
RUN apt-get update && apt-get install -y \
cmake zlib1g-dev lld
RUN apt-get update && apt-get install -y \
libmodsecurity3 modsecurity-crs clang
Cargo.toml:
[package]
name = "test-modsec"
version = "1.0.0"
authors = ["redacted <redacted@example.com>"]
edition = "2021"
[profile.release]
incremental = true
[profile.dev]
incremental = true
[dependencies]
async-trait="0.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
bytes = "1"
modsecurity = { git = "https://github.com/rkrishn7/rust-modsecurity", version = "0.1.4" }
For context, modsecurity-sys relies on pkg-config to probe the system for libmodsecurity and emit necessary linking flags. pkg-config retrieves information about packages from special metadata files (.pc files) which it is configured to search for on some default set of paths. If the associated .pc file is located somewhere else, this needs to be conveyed to pkg-config by setting the PKG_CONFIG_PATH environment variable.
We probably don't want to include any comment about needing a specific package like libmodsecurity-dev, since that differs across systems and some users may even be building from source. However, it could be useful to point out a condensed version of the above information regarding pkg-config in the README.
libmodsecurity-dev satisfies the need for the .pc package file
on top of what you say above. That will help those not building from source.
The text you have above is basically what the error messages prints out. It took quite a bit of googling to figure out that the -dev package satisfies this requirement
Error message from Cargo
Dockerfile:
Cargo.toml:
output of dkpkg -L from the docker container:
The text was updated successfully, but these errors were encountered: