Skip to contentSkip to conversation

package/rust: use cargo environment during installation

PATCH In review James Hilliard 2 participants 5 messages Oct 6 – Oct 22

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/rust: use cargo environment during installation

Pass HOST_PKG_CARGO_ENV to x.py dist, as is already done for x.py build. This ensures Cargo uses Buildroot's configured CARGO_HOME instead of falling back to the user's default cache, and keeps the host RUSTFLAGS consistent between the build and installation steps.

Fixes:
- https://autobuild.buildroot.net/results/02b/02b2fc6ba7329852d7bf6ae4935c120c4de47b3e

---
 package/rust/rust.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/rust/rust.mk +2 -1
index ca68de589c..7546ad39fe 100644
@@ -79,7 +79,8 @@ endef
 endif
 
 define HOST_RUST_INSTALL_CMDS
-	cd $(@D); $(HOST_MAKE_ENV) $(HOST_DIR)/bin/python$(PYTHON3_VERSION_MAJOR) x.py dist
+	cd $(@D); $(HOST_MAKE_ENV) $(HOST_PKG_CARGO_ENV) \
+		$(HOST_DIR)/bin/python$(PYTHON3_VERSION_MAJOR) x.py dist
 	$(HOST_RUST_INSTALL_RUSTC)
 	$(HOST_RUST_INSTALL_LIBSTD_TARGET)
 endef
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · James Hilliard

Pass HOST_PKG_CARGO_ENV to x.py dist, as is already done for x.py build. This ensures Cargo uses Buildroot's configured CARGO_HOME instead of falling back to the user's default cache, and keeps the host RUSTFLAGS consistent between the build and installation steps.

Fixes:
- https://autobuild.buildroot.net/results/02b/02b2fc6ba7329852d7bf6ae4935c120c4de47b3e

Thanks for the patch. Since when does this problem exist? Of course it exists since x.py support was introduced, but did it become visible because of a new package, or package update?

As it's a fix, we need to have sufficient information in the commit message about which commit introduced the issue, so that our LTS branch maintainers can understand whether it needs to be backported or not.

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 7 lines · Thomas Petazzoni via buildroot
Quoted 5 lines · James Hilliard

Pass HOST_PKG_CARGO_ENV to x.py dist, as is already done for x.py build. This ensures Cargo uses Buildroot's configured CARGO_HOME instead of falling back to the user's default cache, and keeps the host RUSTFLAGS consistent between the build and installation steps.

Quoted 8 lines
Quoted 4 lines

Fixes:
- https://autobuild.buildroot.net/results/02b/02b2fc6ba7329852d7bf6ae4935c120c4de47b3e

Thanks for the patch. Since when does this problem exist? Of course it exists since x.py support was introduced, but did it become visible because of a new package, or package update?

I think it's caused by this: https://github.com/rust-lang/rust/pull/156196

Quoted 4 lines

As it's a fix, we need to have sufficient information in the commit message about which commit introduced the issue, so that our LTS branch maintainers can understand whether it needs to be backported or

I think that would be this commit:
https://github.com/buildroot/buildroot/commit/e8c8bd9bc56a827db90c3bb2e71e4613a5a2c730

Quoted 4 lines

not.

Thanks a lot!

Quoted 9 lines

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list [email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hello,

Quoted 7 lines · James Hilliard
Quoted 3 lines

Thanks for the patch. Since when does this problem exist? Of course it exists since x.py support was introduced, but did it become visible because of a new package, or package update?

I think it's caused by this: https://github.com/rust-lang/rust/pull/156196

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

As it's a fix, we need to have sufficient information in the commit message about which commit introduced the issue, so that our LTS branch maintainers can understand whether it needs to be backported or

I think that would be this commit:
https://github.com/buildroot/buildroot/commit/e8c8bd9bc56a827db90c3bb2e71e4613a5a2c730

Do you have a reproducer for this issue?

Your original patch is at
https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/.

The failed issue is at:
https://autobuild.buildroot.net/results/02b/02b2fc6ba7329852d7bf6ae4935c120c4de47b3e/build-end.log,
which ended with a timeout. I see:

Dist rustc-1.98.1-src

	finished in 17585.096 seconds

which seems extremely long. I did a build on my (fast) build server, and it took:

Dist rustc-1.98.1-src-gpl

        finished in 119.230 seconds

but the build completed successfully.

Do you have more details about what's happening, why passing more flags don't cause a timeout, etc.?

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
Quoted 34 lines · Thomas Petazzoni

Hello,

Quoted 7 lines · James Hilliard
Quoted 3 lines

Thanks for the patch. Since when does this problem exist? Of course it exists since x.py support was introduced, but did it become visible because of a new package, or package update?

I think it's caused by this: https://github.com/rust-lang/rust/pull/156196

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

As it's a fix, we need to have sufficient information in the commit message about which commit introduced the issue, so that our LTS branch maintainers can understand whether it needs to be backported or

I think that would be this commit:
https://github.com/buildroot/buildroot/commit/e8c8bd9bc56a827db90c3bb2e71e4613a5a2c730

Do you have a reproducer for this issue?

Your original patch is at
https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/.

The failed issue is at:
https://autobuild.buildroot.net/results/02b/02b2fc6ba7329852d7bf6ae4935c120c4de47b3e/build-end.log,
which ended with a timeout. I see:

Dist rustc-1.98.1-src

        finished in 17585.096 seconds

which seems extremely long. I did a build on my (fast) build server, and it took:

Quoted 7 lines

Dist rustc-1.98.1-src-gpl

        finished in 119.230 seconds

but the build completed successfully.

Do you have more details about what's happening, why passing more flags don't cause a timeout, etc.?

I think it's due to multiple autobuilders holding a lock at the same time due to using the same CARGO_HOME. This change ensures each build gets a separate CARGO_HOME. The bug is somewhat pre-existing in the sense that CARGO_HOME should have been isolated to begin with. It just wasn't really triggered until the update which seems to have started locking some resources in CARGO_HOME.

In the autobuilder log this is what's causing it to take so long AFAIU:
Blocking waiting for file lock on package cache

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot