Skip to contentSkip to conversation

package/rust: disable ninja

PATCH New Romain Naour 3 participants 5 messages Feb 17, 2021 – Feb 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/rust: disable ninja

Ninja has recently be enabled as the default build system to build llvm fork for rust compiler [1]. But we can still use Make if "ninja = false" is provided in config.toml.

Ninja support can be enabled by a following patch.

[1] https://github.com/rust-lang/rust/commit/30b7dac745b1555cd96f41977f7d24435cbe7fa2

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

---
 package/rust/rust.mk | 2 ++
 1 file changed, 2 insertions(+)
package/rust/rust.mk +2 -0
index 798450e04e..a38a3d64f5 100644
@@ -65,6 +65,8 @@ define HOST_RUST_CONFIGURE_CMDS
 		echo 'channel = "stable"'; \
 		echo '[target.$(RUSTC_TARGET_NAME)]'; \
 		echo 'cc = "$(TARGET_CROSS)gcc"'; \
+		echo '[llvm]'; \
+		echo 'ninja = false'; \
 	) > $(@D)/config.toml
 endef
 
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/1 package/rust: disable ninja

Quoted 7 lines · Romain Naour

Ninja has recently be enabled as the default build system to build llvm fork for rust compiler [1]. But we can still use Make if "ninja = false" is provided in config.toml.

Ninja support can be enabled by a following patch.

[1] https://github.com/rust-lang/rust/commit/30b7dac745b1555cd96f41977f7d24435cbe7fa2

That commit reports a speedup of about 2 minutes in build time (on a highly
parallel system). I guess that on a lowlier system, the build time will still improve by more than the 10 seconds it takes to build ninja...

So I'd propose to instead just add

HOST_RUST_DEPENDENCIES += ninja

(Note that long-term, I'd like to switch to ninja build for CMake packages in
general. Not that rust is a cmake package, but llvm is.)

Regards,
Arnout

Quoted 24 lines

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

---
 package/rust/rust.mk | 2 ++
 1 file changed, 2 insertions(+)
package/rust/rust.mk +2 -0
index 798450e04e..a38a3d64f5 100644
@@ -65,6 +65,8 @@ define HOST_RUST_CONFIGURE_CMDS
 		echo 'channel = "stable"'; \
 		echo '[target.$(RUSTC_TARGET_NAME)]'; \
 		echo 'cc = "$(TARGET_CROSS)gcc"'; \
+		echo '[llvm]'; \
+		echo 'ninja = false'; \
 	) > $(@D)/config.toml
 endef
 
#2 lore raw

PATCH 1/1 package/rust: disable ninja

Hello Arnout,

Le 18/02/2021 ? 20:00, Arnout Vandecappelle a ?crit?:

Quoted 7 lines · Romain Naour
Quoted 4 lines

Ninja has recently be enabled as the default build system to build llvm fork for rust compiler [1]. But we can still use Make if "ninja = false" is provided in config.toml.

Quoted 7 lines
Quoted 3 lines

Ninja support can be enabled by a following patch.

[1] https://github.com/rust-lang/rust/commit/30b7dac745b1555cd96f41977f7d24435cbe7fa2

That commit reports a speedup of about 2 minutes in build time (on a highly
parallel system). I guess that on a lowlier system, the build time will still improve by more than the 10 seconds it takes to build ninja...

Yes, but the rust package was using Make build system until recently. I'm not sure if we should switch to ninja for 2021.02 release.

Quoted 4 lines

So I'd propose to instead just add

HOST_RUST_DEPENDENCIES += ninja

You mean host-ninja

Quoted 3 lines

(Note that long-term, I'd like to switch to ninja build for CMake packages in
general. Not that rust is a cmake package, but llvm is.)

That was already suggested long time ago but the benefit was rather small at that time:

http://patchwork.ozlabs.org/project/buildroot/patch/20170106223748.2203-1-cedric.marie at openmailbox.org/

Best regards,
Romain

Quoted 28 lines

Regards,
Arnout

Quoted 24 lines

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

---
 package/rust/rust.mk | 2 ++
 1 file changed, 2 insertions(+)
package/rust/rust.mk +2 -0
index 798450e04e..a38a3d64f5 100644
@@ -65,6 +65,8 @@ define HOST_RUST_CONFIGURE_CMDS
 		echo 'channel = "stable"'; \
 		echo '[target.$(RUSTC_TARGET_NAME)]'; \
 		echo 'cc = "$(TARGET_CROSS)gcc"'; \
+		echo '[llvm]'; \
+		echo 'ninja = false'; \
 	) > $(@D)/config.toml
 endef
 
#3 lore raw

PATCH 1/1 package/rust: disable ninja

Quoted 12 lines · Romain Naour

Hello Arnout,

Le 18/02/2021 ? 20:00, Arnout Vandecappelle a ?crit?:

Quoted 9 lines · Romain Naour
Quoted 6 lines

Ninja has recently be enabled as the default build system to build llvm fork for rust compiler [1]. But we can still use Make if "ninja = false" is provided in config.toml.

Ninja support can be enabled by a following patch.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

[1] https://github.com/rust-lang/rust/commit/30b7dac745b1555cd96f41977f7d24435cbe7fa2

That commit reports a speedup of about 2 minutes in build time (on a highly
parallel system). I guess that on a lowlier system, the build time will still improve by more than the 10 seconds it takes to build ninja...

Yes, but the rust package was using Make build system until recently. I'm not sure if we should switch to ninja for 2021.02 release.

True.

Quoted 9 lines
Quoted 5 lines

So I'd propose to instead just add

HOST_RUST_DEPENDENCIES += ninja

You mean host-ninja

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

(Note that long-term, I'd like to switch to ninja build for CMake packages in
general. Not that rust is a cmake package, but llvm is.)

That was already suggested long time ago but the benefit was rather small at that time:

http://patchwork.ozlabs.org/project/buildroot/patch/20170106223748.2203-1-cedric.marie at openmailbox.org/

At the time, host-ninja still depended on host-python{,3}. This is no longer
the case. Now the overhead of host-ninja is just about 10s, so IMHO it's worth it if it can shave off a minute off the build time of a large package.

Regards,
Arnout

Quoted 34 lines

Best regards,
Romain

Quoted 28 lines

Regards,
Arnout

Quoted 24 lines

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

---
 package/rust/rust.mk | 2 ++
 1 file changed, 2 insertions(+)
package/rust/rust.mk +2 -0
index 798450e04e..a38a3d64f5 100644
@@ -65,6 +65,8 @@ define HOST_RUST_CONFIGURE_CMDS
 		echo 'channel = "stable"'; \
 		echo '[target.$(RUSTC_TARGET_NAME)]'; \
 		echo 'cc = "$(TARGET_CROSS)gcc"'; \
+		echo '[llvm]'; \
+		echo 'ninja = false'; \
 	) > $(@D)/config.toml
 endef
 
#4 lore raw

PATCH 1/1 package/rust: disable ninja

In reply to Romain Naour

Romain, All,

On 2021-02-18 00:24 +0100, Romain Naour spake thusly:

Quoted 6 lines

Ninja has recently be enabled as the default build system to build llvm fork for rust compiler [1]. But we can still use Make if "ninja = false" is provided in config.toml.

Ninja support can be enabled by a following patch.

Quoted 7 lines

[1] https://github.com/rust-lang/rust/commit/30b7dac745b1555cd96f41977f7d24435cbe7fa2

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

Applied to master, thanks.

If you have time, it would be great to investigate switching the cmake backend to ninja.

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 package/rust/rust.mk | 2 ++
 1 file changed, 2 insertions(+)
package/rust/rust.mk +2 -0
index 798450e04e..a38a3d64f5 100644
@@ -65,6 +65,8 @@ define HOST_RUST_CONFIGURE_CMDS
 		echo 'channel = "stable"'; \
 		echo '[target.$(RUSTC_TARGET_NAME)]'; \
 		echo 'cc = "$(TARGET_CROSS)gcc"'; \
+		echo '[llvm]'; \
+		echo 'ninja = false'; \
 	) > $(@D)/config.toml
 endef
 
Signature · 6 lines
2.29.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'