bazelbuild / bazelbuild/rules_rust

An error occurred when compiling the binary using the libssh2-sys package, due to the lack of inclusion of OpenSSL header files.

Open
#1,941 3 comments 0 reactions 0 assignees View on GitHub
cargo external-crates needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

There is a geneate content.
Before building the `libssh2-sys_build_script`, we need to build the `openssl-sys` package first. The `openssl-sys` package will write the `DEP_OPENSSL_INCLUDE` variable to the depenv file. Additionally, the `libssh2-sys_build_script` should be sourced from the depenvs file.
```
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel sync --only=crate_index
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")

load("@rules_rust//rust:defs.bzl", "rust_library")

# buildifier: disable=bzl-visibility
load("@rules_rust//crate_universe/private:selects.bzl", "selects")

package(default_visibility = ["//visibility:public"])

# licenses([
# "TODO", # MIT/Apache-2.0
# ])

rust_library(
name = "libssh2_sys",
deps = [
"@crate_index__libc-0.2.137//:libc",
"@crate_index__libssh2-sys-0.2.23//:build_script_build",
"@crate_index__libz-sys-1.1.8//:libz_sys",
] + select({
"@rules_rust//rust/platform:x86_64-apple-darwin": [
"@crate_index__openssl-sys-0.9.78//:openssl_sys", # cfg(unix)
],
"//conditions:default": [],
}),
compile_data = glob(
include = ["**"],
exclude = [
"**/* *",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_root = "lib.rs",
edition = "2015",
rustc_flags = ["--cap-lints=allow"],
srcs = glob(["**/*.rs"]),
tags = [
"cargo-bazel",
"crate-name=libssh2-sys",
"manual",
"noclippy",
"norustfmt",
],
version = "0.2.23",
)

cargo_build_script(
name = "libssh2-sys_build_script",
crate_name = "build_script_build",
crate_root = "build.rs",
data = glob(
include = ["**"],
exclude = [
"**/* *",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
deps = [
"@crate_index__cc-1.0.77//:cc",
"@crate_index__pkg-config-0.3.26//:pkg_config",
],
edition = "2015",
links = "ssh2",
rustc_flags = [
"--cap-lints=allow",
],
srcs = glob(["**/*.rs"]),
tags = [
"cargo-bazel",
"crate-name=libssh2-sys",
"manual",
"noclippy",
"norustfmt",
],
version = "0.2.23",
visibility = ["//visibility:private"],
)

alias(
name = "build_script_build",
actual = "libssh2-sys_build_script",
tags = ["manual"],
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.