rust: Fix `make rustfmt` failure
Subsystems (2)
PATCH 1/1 rust: Fix `make rustfmt` failure
At present, make rustfmt triggers the following error:
[0/1] Running external command rustfmt (wrapped by meson to set env) Failed to find targets
This utility formats all bin and lib files of the current crate using rustfmt.
...
FAILED: meson-internal__rustfmt
Since commit 6d28fc60891f moved Cargo.toml to the top-level source directory, rust/ is neither the workspace root nor a package directory. Now "cargo fmt" only formats the package in the current directory, so running it from rust/ (i.e. @CURRENT_SOURCE_DIR@) finds no targets.
So fix this by specifying the project source root (where Cargo.toml is), just like CI did in commit 6d28fc60891f.
Fixes 6d28fc60891f ("rust: switch to cargo subprojects")
Signed-off-by Zhao Liu <[email protected]>
--- rust/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
rust/meson.build +1 -1
@@ -30,7 +30,7 @@ cargo = find_program('cargo', required: false) if cargo.found() run_target('rustfmt', command: [config_host['MESON'], 'devenv', - '--workdir', '@CURRENT_SOURCE_DIR@', + '--workdir', meson.project_source_root(), cargo, 'fmt'], depends: genrs) endif
Signature · 1 line
2.34.1