meson test failed: could not find `Cargo.toml` in `xxx/build` or any parent directory
In archlinux, failed in meson test.
My build script is:
prepare() {
cd ${_pkgname}-${pkgver}
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
local meson_options=(
--buildtype release
)
export RUSTUP_TOOLCHAIN=stable
arch-meson ${_pkgname}-${pkgver} build "${meson_options[@]}"
meson compile -C build
}
check() {
meson test -C build --print-errorlogs
}
the full check log is:
ninja: Entering directory `/build/authenticator/src/build'
[0/1] Generating src/cargo-build with a custom command
warning: `&` without an explicit lifetime name cannot be used here
--> src/models/otp.rs:24:24
|
24 | const STEAM_CHARS: &str = "23456789BCDFGHJKMNPQRTVWXY";
| ^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
= note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
help: use the `'static` lifetime
|
24 | const STEAM_CHARS: &'static str = "23456789BCDFGHJKMNPQRTVWXY";
| +++++++
warning: unused imports: `CameraEvent`, `ProvidersList`, `QRCodeData`, `View`
--> src/widgets/mod.rs:13:34
|
13 | accounts::{AccountAddDialog, QRCodeData},
| ^^^^^^^^^^
14 | camera::{screenshot, Camera, CameraEvent},
| ^^^^^^^^^^^
...
20 | providers::{ProviderImage, ProvidersDialog, ProvidersList},
| ^^^^^^^^^^^^^
21 | url_row::UrlRow,
22 | window::{View, Window},
| ^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: variable does not need to be mutable
--> src/backup/aegis.rs:92:13
|
92 | let mut password_slot = &mut header.slots.as_mut().unwrap().get_mut(0).unwrap();
| ----^^^^^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: `authenticator` (bin "authenticator") generated 3 warnings (run `cargo fix --bin "authenticator"` to apply 3 suggestions)
Finished release [optimized] target(s) in 0.75s
1/4 validate-gschema OK 0.03s
2/4 Validate desktop file OK 0.02s
3/4 Cargo tests FAIL 0.03s exit status 101
>>> CARGO_HOME=/build/authenticator/src/build/target/cargo-home ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 CARGO_TARGET_DIR=/build/authenticator/src/build/target MALLOC_PERTURB_=43 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /usr/bin/cargo test
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
error: could not find `Cargo.toml` in `/build/authenticator/src/build` or any parent directory
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
4/4 Validate metainfo file OK 0.04s
Summary of Failures:
3/4 Cargo tests FAIL 0.03s exit status 101
Ok: 3
Expected Fail: 0
Fail: 1
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /build/authenticator/src/build/meson-logs/testlog.txt