guix_mirror_bot pushed a commit to branch rust-team
in repository guix.
commit 956452f8e2f44e83fbf640be48b6cb5c025f9441
Author: Efraim Flashner <[email protected]>
AuthorDate: Sun Nov 8 16:34:50 2026 +0200
build-system/cargo: Make cargo.toml more readable.
* guix/build/cargo-build-system.scm (configure): Adjust the generated
cargo.toml to include more newlines.
---
guix/build/cargo-build-system.scm | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/guix/build/cargo-build-system.scm
b/guix/build/cargo-build-system.scm
index 8253760e9b9..86a9ccbb13b 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -243,22 +243,21 @@ libraries or executables."
(mkdir-p ".cargo")
;; Not .cargo/config.toml, rustc/cargo will generate .cargo/config otherwise.
(let ((port (open-file ".cargo/config" "w" #:encoding "utf-8")))
- ;; Placed here so it doesn't cause random rebuilds. Neither of these work.
- ;; sysroot = '" (assoc-ref inputs "rust-sysroot") "'
- ;; rustflags = ['--sysroot', '" (assoc-ref inputs "rust-sysroot") "']
+ ;; Setting the sysroot via rustflags works, but gets overridden by
RUSTFLAGS
+ ;; rustflags = ['--sysroot', '" (assoc-ref inputs (string-append
"rust-sysroot-for-" target)) "']
(when target
- (display (string-append "
+ (display (string-append "\
[target." (getenv "CARGO_BUILD_TARGET") "]
linker = '" target "-gcc'
[build]
-target = ['" (getenv "CARGO_BUILD_TARGET") "']") port))
+target = ['" (getenv "CARGO_BUILD_TARGET") "']\n") port))
(display (string-append "
[source.crates-io]
replace-with = 'vendored-sources'
[source.vendored-sources]
-directory = '" vendor-dir "'") port)
+directory = '" vendor-dir "'\n") port)
(close-port port))
;; Lift restriction on any lints: a crate author may have decided to opt