Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Build on Debian fails with "doc alias attribute expects a string:" #1

Closed
sylvestre opened this issue Aug 22, 2021 · 9 comments
Closed
Assignees
Labels
backward-compatibility Issues which only happen when building with an old Rust tool chain

Comments

@sylvestre
Copy link

Trying to package selinux for Debian, I am getting:

     Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=selinux CARGO_MANIFEST_DIR=/<<PKGBUILDDIR>> CARGO_PKG_AUTHORS='Koutheir Attouchi <[email protected]>' CARGO_PKG_DESCRIPTION='Flexible Mandatory Access Control for Linux' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=selinux CARGO_PKG_REPOSITORY='https://github.com/koutheir/selinux' CARGO_PKG_VERSION=0.2.2 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=2 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/<<PKGBUILDDIR>>/target/debug/deps:/usr/lib' rustc --crate-name selinux --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -Cembed-bitcode=no -C debuginfo=2 -C metadata=82c54164d593785f -C extra-filename=-82c54164d593785f --out-dir /<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps --target x86_64-unknown-linux-gnu -C incremental=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/incremental -L dependency=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps -L dependency=/<<PKGBUILDDIR>>/target/debug/deps --extern bitflags=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps/libbitflags-3f47185136d2e6bc.rmeta --extern libc=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps/liblibc-c7d93ddab2220a9b.rmeta --extern once_cell=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps/libonce_cell-453a2446d2f99dbf.rmeta --extern reference_counted_singleton=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps/libreference_counted_singleton-3f025b9280c502cf.rmeta --extern selinux_sys=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps/libselinux_sys-d5eb7bdc26ae0b3d.rmeta --extern thiserror=/<<PKGBUILDDIR>>/target/x86_64-unknown-linux-gnu/debug/deps/libthiserror-3632fe4357e3cad5.rmeta -C debuginfo=2 --cap-lints warn -C linker=x86_64-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix /<<PKGBUILDDIR>>=/usr/share/cargo/registry/selinux-0.2.2 -L native=/usr/lib/x86_64-linux-gnu`

error: doc alias attribute expects a string: #[doc(alias = "0")]
    --> src/lib.rs:1846:7
     |
1846 | #[doc(alias("is_selinux_enabled", "is_selinux_mls_enabled"))]
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@koutheir
Copy link
Owner

Can you please provide the version of the rust tool chain you're using?

@sylvestre
Copy link
Author

With rustc 1.48

@sylvestre
Copy link
Author

the one is Debian stable, testing and unstable (experimental is 1.52)

@koutheir
Copy link
Owner

Specifying multiple aliases became possible after 1.48 was released. To avoid this trivial issue, I'll replace the affected doc(alias) directives with multiple directives specifying one alias at a time.

See: rust-lang/rust#82846

@koutheir koutheir self-assigned this Aug 22, 2021
@koutheir koutheir added the backward-compatibility Issues which only happen when building with an old Rust tool chain label Aug 22, 2021
@koutheir
Copy link
Owner

This fix is integrated into version 0.2.3.

@sylvestre
Copy link
Author

Sorry but it has to be done on all the files, not only for this one :/
Here is the super ugly patch that I need to write to be able to build:
https://salsa.debian.org/rust-team/debcargo-conf/-/blob/master/src/selinux/debian/patches/disable-check-doc.diff

@koutheir koutheir reopened this Aug 22, 2021
@koutheir
Copy link
Owner

koutheir commented Aug 22, 2021

Why did you remove the aliases with that patch? That's not what the error complains about.

@sylvestre
Copy link
Author

Because it was easier to do that quickly: the package needs to go in review in Debian and it can take months. So, I was confident a fix would be there before it gets accepted in Debian

@koutheir
Copy link
Owner

So the reason is procedure, fine. Still, version 0.2.3 fixes this issue correctly without removing the aliases entirely.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backward-compatibility Issues which only happen when building with an old Rust tool chain
Projects
None yet
Development

No branches or pull requests

2 participants