Skip to contentSkip to conversation

rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0

PATCH Applied Miguel Ojeda 3 participants 4 messages Feb 6 – Feb 10

Subsystems (3)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0

Custom target specifications are unstable, but starting with Rust 1.95.0, rustc requires to explicitly pass -Zunstable-options to use them [1]:

    error: error loading target specification: custom targets are unstable and require `-Zunstable-options`
      |
      = help: run `rustc --print target-list` for a list of built-in targets

David (Rust compiler team lead), writes:

"We're destabilising custom targets to allow us to move forward with
build-std without accidentally exposing functionality that we'd like to revisit prior to committing to. I'll start a thread on Zulip to discuss with the RfL team how we can come up with an alternative for them."

Thus pass it.

Cc David Wood <[email protected]>
Cc Wesley Wiser <[email protected]>
Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).
---
 rust/Makefile | 3 +++
 1 file changed, 3 insertions(+)
rust/Makefile +3 -0
index 4dcc2eff51cb..725158740fc6 100644
@@ -552,6 +552,8 @@ $(obj)/$(libpin_init_internal_name): private rustc_target_flags = --cfg kernel
 $(obj)/$(libpin_init_internal_name): $(src)/pin-init/internal/src/lib.rs FORCE
 	+$(call if_changed_dep,rustc_procmacro)
 
+# `rustc` requires `-Zunstable-options` to use custom target specifications
+# since Rust 1.95.0 (https://github.com/rust-lang/rust/pull/151534).
 quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L $@
       cmd_rustc_library = \
 	OBJTREE=$(abspath $(objtree)) \
@@ -562,6 +564,7 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L
 		--crate-type rlib -L$(objtree)/$(obj) \
 		--crate-name $(patsubst %.o,%,$(notdir $@)) $< \
 		--sysroot=/dev/null \
+		-Zunstable-options \
 	$(if $(rustc_objcopy),;$(OBJCOPY) $(rustc_objcopy) $@) \
 	$(cmd_objtool)
 

base-commit: 18f7fcd5e69a04df57b563360b88be72471d6b62

Signature · 1 line
2.53.0
#1 lore raw
Quoted 16 lines · Miguel Ojeda

Custom target specifications are unstable, but starting with Rust 1.95.0, rustc requires to explicitly pass -Zunstable-options to use them [1]:

    error: error loading target specification: custom targets are unstable and require `-Zunstable-options`
      |
      = help: run `rustc --print target-list` for a list of built-in targets

David (Rust compiler team lead), writes:

"We're destabilising custom targets to allow us to move forward with
build-std without accidentally exposing functionality that we'd like to revisit prior to committing to. I'll start a thread on Zulip to discuss with the RfL team how we can come up with an alternative for them."

Quoted 7 lines

Thus pass it.

Cc David Wood <[email protected]>
Cc Wesley Wiser <[email protected]>
Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).

For reference, this commit is the same one I gave David for the upstream Rust CI.

Gary would like to have it in linux-next for Klint that uses Rust nightly, so I think I will put it into rust-fixes soon-ish to help.

Cheers,
Miguel

reviewer Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Miguel Ojeda
Quoted 15 lines · Miguel Ojeda

Custom target specifications are unstable, but starting with Rust 1.95.0, rustc requires to explicitly pass -Zunstable-options to use them [1]:

    error: error loading target specification: custom targets are unstable and require `-Zunstable-options`
      |
      = help: run `rustc --print target-list` for a list of built-in targets

David (Rust compiler team lead), writes:

"We're destabilising custom targets to allow us to move forward with
build-std without accidentally exposing functionality that we'd like to revisit prior to committing to. I'll start a thread on Zulip to discuss with the RfL team how we can come up with an alternative for them."

Quoted 7 lines

Thus pass it.

Cc David Wood <[email protected]>
Cc Wesley Wiser <[email protected]>
Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).

I can confirm that build will fail on x64 without this patch in latest nightly and this fixed it.

Quoted 3 lines
---
 rust/Makefile | 3 +++
 1 file changed, 3 insertions(+)
Applied
#3 lore raw
In reply to Miguel Ojeda
Quoted 16 lines · Miguel Ojeda

Custom target specifications are unstable, but starting with Rust 1.95.0, rustc requires to explicitly pass -Zunstable-options to use them [1]:

    error: error loading target specification: custom targets are unstable and require `-Zunstable-options`
      |
      = help: run `rustc --print target-list` for a list of built-in targets

David (Rust compiler team lead), writes:

"We're destabilising custom targets to allow us to move forward with
build-std without accidentally exposing functionality that we'd like to revisit prior to committing to. I'll start a thread on Zulip to discuss with the RfL team how we can come up with an alternative for them."

Quoted 7 lines

Thus pass it.

Cc David Wood <[email protected]>
Cc Wesley Wiser <[email protected]>
Cc [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).

Applied to rust-fixes -- thanks!

This is so that Gary gets it soon in linux-next for Klint -- I may or may not need to rebase this one, though.

Cheers,
Miguel