linux-next: build failure after merge of the block tree
Mark Brown
maintainerHi all,
After merging the block tree, today's linux-next build (arm64 kunit) failed like this:
ERROR:root:error[E0308]: mismatched types
--> /tmp/next/build/rust/kernel/block/mq/operations.rs:274:28
|
274 | init_request: Some(Self::init_request_callback),
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn
| pointer, found fn item | arguments to this
| enum variant are incorrect
|
= note: expected fn pointer `unsafe extern "C" fn(_, _, _, i32) -> _`
found fn item `unsafe extern "C" fn(_, _, _, u32) -> _ {OperationsVTable::<T>::init_request_callback}`help: the type constructed contains unsafe extern "C" fn(*mut blk_mq_tag_set, *mut bindings::request, u32, u32) -> i32 {OperationsVTable::<T>::init_request_callback} due to the type of the argument passed
--> /tmp/next/build/rust/kernel/block/mq/operations.rs:274:23
|
274 | init_request: Some(Self::init_request_callback),
| ^^^^^---------------------------^
| | this argument influences the type of
| `Some`
note: tuple variant defined here
--> /usr/lib/rustlib/src/rust/library/core/src/option.rs:580:5
|
580 | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
| ^^^^error: aborting due to 1 previous error
For more information about this error, try rustc --explain E0308.
We build with --kconfig_add CONFIG_KASAN=y --kconfig_add CONFIG_RUST=y (and would also do an allmodconfig which picks up CONFIG_RUST=y in any case since there's a usable rustc installed).
Caused by commit
b040a1a4523d9 (block: switch numa_node to int in blk_mq_hw_ctx and init_request)
possibly interacting with some rust change but I'm not sure. I have used the tree from next-20260526 instead.
Quoted 35 lines · Mark Brown
Hi all,
After merging the block tree, today's linux-next build (arm64 kunit) failed like this:
ERROR:root:error[E0308]: mismatched types
-->/tmp/next/build/rust/kernel/block/mq/operations.rs:274:28| 274 | init_request: Some(Self::init_request_callback), | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn | pointer, found fn item | arguments to this | enum variant are incorrect | = note: expected fn pointer `unsafe extern "C" fn(_, _, _, i32) -> _` found fn item `unsafe extern "C" fn(_, _, _, u32) -> _ {OperationsVTable::<T>::init_request_callback}`help: the type constructed contains
unsafe extern "C" fn(*mut blk_mq_tag_set, *mut bindings::request, u32, u32) -> i32 {OperationsVTable::<T>::init_request_callback}due to the type of the argument passed
-->/tmp/next/build/rust/kernel/block/mq/operations.rs:274:23| 274 | init_request: Some(Self::init_request_callback), | ^^^^^---------------------------^ | | this argument influences the type of | `Some` note: tuple variant defined here --> /usr/lib/rustlib/src/rust/library/core/src/option.rs:580:5 | 580 | Some(#[stable(feature = "rust1", since = "1.0.0")] T), | ^^^^error: aborting due to 1 previous error
For more information about this error, try
rustc --explain E0308.
Quoted 7 lines
We build with --kconfig_add
CONFIG_KASAN=y--kconfig_addCONFIG_RUST=y(and would also do an allmodconfig which picks upCONFIG_RUST=yin any case since there's a usable rustc installed).Caused by commit
b040a1a4523d9(block: switchnuma_nodeto int inblk_mq_hw_ctxandinit_request)
Fixed in the current tree.
Quoted 2 lines
possibly interacting with some rust change but I'm not sure. I have used the tree from next-20260526 instead.
Hmm, not sure we should let rust build issues gate whether a tree is current in -next or not. For, by far, most systems, it's not a requirement for a functional device.
Signature · 1 line
Jens Axboe
Mark Brown
maintainerQuoted 8 lines · Jens Axboe
Quoted 2 lines · Mark Brown
possibly interacting with some rust change but I'm not sure. I have used the tree from next-20260526 instead.
Hmm, not sure we should let rust build issues gate whether a tree is current in -next or not. For, by far, most systems, it's not a requirement for a functional device.
That's also true for a huge proportion of the issues that get caught with an allmodconfig, and allnoconfig is not exactly a realistic configuration either. It's not just runtime issues, it's also issues that come up in people's coverage tests. TBH the rust stuff originally got turned on because I ran the allmodconfig on a machine that happened to have a usable rustc installed, I was intending to enable it at some point anyway.
Quoted 6 lines · Mark Brown
Quoted 4 lines · Jens Axboe
Quoted 2 lines · Mark Brown
possibly interacting with some rust change but I'm not sure. I have used the tree from next-20260526 instead.
Quoted 7 lines
Quoted 3 lines
Hmm, not sure we should let rust build issues gate whether a tree is current in -next or not. For, by far, most systems, it's not a requirement for a functional device.
That's also true for a huge proportion of the issues that get caught with an allmodconfig, and allnoconfig is not exactly a realistic configuration either.
While that is true, the big difference here is that everybody should build allmodconfig themselves, but only a (much) smaller subset of those have rust enabled/available.
Quoted 4 lines
that come up in people's coverage tests. TBH the rust stuff originally got turned on because I ran the allmodconfig on a machine that happened to have a usable rustc installed, I was intending to enable it at some point anyway.
I think it's good to have coverage, but I think it should be more of the notification variety than a gating factor. For this particular time and branch it didn't matter, but sometimes I shove things in there that I absolutely need a quick test turn-around on. For exposure reasons. And getting a -next cycle delay on that would be unfortunate, and I think also unwarranted if the only issue is that the rust build broke.
Does highlight that apparently my build no longer does rust builds, which it did used to... Something to look into on my end.
Not trying to start a debate, just voicing my opinion on the matter :-)
Signature · 1 line
Jens Axboe
Mark Brown
maintainerQuoted 7 lines · Jens Axboe
Quoted 5 lines · Mark Brown
Quoted 3 lines · Jens Axboe
Hmm, not sure we should let rust build issues gate whether a tree is current in -next or not. For, by far, most systems, it's not a requirement for a functional device.
Quoted 7 lines
Quoted 3 lines
That's also true for a huge proportion of the issues that get caught with an allmodconfig, and allnoconfig is not exactly a realistic configuration either.
While that is true, the big difference here is that everybody should build allmodconfig themselves, but only a (much) smaller subset of those have rust enabled/available.
Personally I had to install a cross toolchain to be able to cover this x86_64 stuff everyone seems to think is important. :)
More seriously I'd hope that people maintaining stuff that interacts with rust have a rust toolchain available, it sounds like you do but it silently got turned off without you realising. If we're getting into a situation where rust is routinely getting broken by not obviously related stuff we might want to reevaluate that in general, not just for -next but so far I've mostly seen what rust breakage I encounter be due to rust specific changes which really ought to have been tested by someone with a rust toolchain. TBH given that rust conflicts come up moderately often I think I need to have the build coverage just to catch my own obvious errors.
Quoted 11 lines
Quoted 4 lines
that come up in people's coverage tests. TBH the rust stuff originally got turned on because I ran the allmodconfig on a machine that happened to have a usable rustc installed, I was intending to enable it at some point anyway.
I think it's good to have coverage, but I think it should be more of the notification variety than a gating factor. For this particular time and branch it didn't matter, but sometimes I shove things in there that I absolutely need a quick test turn-around on. For exposure reasons. And getting a -next cycle delay on that would be unfortunate, and I think also unwarranted if the only issue is that the rust build broke.
OTOH part of what we're looking for is ensuring that we don't spend the early part of the release cycle sorting out build issues that came in during the merge window. I agree that there's competing needs in there, and we also have fun with things like both x86_64 and allmodconfig turning on -Werror which opens us up to toolchain differences causing trouble.
One trouble with notification only for things that break the build is that it becomes hard to detect and work with it sensibly, and one build break can easily mask another build break.
Quoted 2 lines
Does highlight that apparently my build no longer does rust builds, which it did used to... Something to look into on my end.
Do you have KASAN turned on, or are you doing something like allmodconfig which turns it on? There was a change to make rust incompatible with KASAN when used with GCC:
https://lore.kernel.org/r/[email protected]
that caused me issues.
Quoted 1 line
Not trying to start a debate, just voicing my opinion on the matter :-)