Skip to content

Commit

Permalink
package/rust/rust: remove Cargo.toml.orig fixup
Browse files Browse the repository at this point in the history
When the rust package was added in Buildroot it was using
the 1.23.0 release [1]  where some vendored sources contained a
Cargo.toml.orig file that caused issues with
support/scripts/apply-patches.sh used by Buildroot package
infrastructure.

Since then, Buildroot is now using rust 1.74.1 (2024.02.x),
1.79.0 (2024.08.x) and 1.82.0 (master) where vendored
sources no longer contains any Cargo.toml.orig file.
So this post-extract hook is no longer needed.

Moreover, since Rust 1.81.0 are present in
src/tools/rustc-perf/collector/compile-benchmarks/<vendored pkg>
where there is no .cargo-checksum.json file.

Since then, the sed command fail and stop the build:

  sed: can't read [...]/host-rust-1.81.0/src/tools/rustc-perf/collector/compile-benchmarks/serde_derive-1.0.136/.cargo-checksum.json: No such file or directory

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/8232367821

[1] b50522d

Signed-off-by: Romain Naour <[email protected]>
Signed-off-by: Arnout Vandecappelle <[email protected]>
  • Loading branch information
RomainNaour authored and sfoster1 committed Dec 9, 2024
1 parent 24a75d9 commit 46e6ac3
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions package/rust/rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@ HOST_RUST_DEPENDENCIES = \

HOST_RUST_VERBOSITY = $(if $(VERBOSE),2,0)

# Some vendor crates contain Cargo.toml.orig files. The associated
# .cargo-checksum.json file will contain a checksum for Cargo.toml.orig but
# support/scripts/apply-patches.sh will delete them. This will cause the build
# to fail, as Cargo will not be able to find the file and verify the checksum.
# So, remove all Cargo.toml.orig entries from the affected .cargo-checksum.json
# files
define HOST_RUST_EXCLUDE_ORIG_FILES
for file in $$(find $(@D) -name '*.orig'); do \
crate=$$(dirname $${file}); \
fn=$${crate}/.cargo-checksum.json; \
sed -i -e 's/"Cargo.toml.orig":"[a-z0-9]\+",//g' $${fn}; \
done
endef

HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_EXCLUDE_ORIG_FILES

define HOST_RUST_CONFIGURE_CMDS
( \
echo '[build]'; \
Expand Down

0 comments on commit 46e6ac3

Please sign in to comment.