linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the rust tree
@ 2024-12-16  5:25 Stephen Rothwell
  2024-12-16 10:31 ` Miguel Ojeda
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2024-12-16  5:25 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Gary Guo, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0308]: mismatched types
   --> drivers/gpu/drm/drm_panic_qr.rs:961:60
    |
961 |         let url_cstr: &CStr = unsafe { CStr::from_char_ptr(url) };
    |                                        ------------------- ^^^ expected `*const u8`, found `*const i8`
    |                                        |
    |                                        arguments to this function are incorrect
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`
note: associated function defined here
   --> rust/kernel/str.rs:187:19
    |
187 |     pub unsafe fn from_char_ptr<'a>(ptr: *const crate::ffi::c_char) -> &'a Self {
    |                   ^^^^^^^^^^^^^

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.

Caused by commit

  e721cd7570b2 ("rust: map `long` to `isize` and `char` to `u8`")

I have used the rust tree from next-20241213 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2025-06-24  7:31 Stephen Rothwell
  2025-06-24 10:31 ` Miguel Ojeda
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2025-06-24  7:31 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Tamir Duberstein, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 11885 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0277]: the trait bound `u32: From<DmaTrfCmdSize>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<DmaTrfCmdSize>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:240:1
    |
240 | / register!(NV_PFALCON_FALCON_DMATRFCMD @ +0x00000118 {
241 | |     0:0     full as bool;
242 | |     1:1     idle as bool;
243 | |     3:2     sec as u8;
...   |
248 | |     16:16   set_dmtag as u8;
249 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<FalconCoreRev>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<FalconCoreRev>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:259:1
    |
259 | / register!(NV_PFALCON_FALCON_HWCFG1 @ +0x0000012c {
260 | |     3:0     core_rev as u8 ?=> FalconCoreRev, "Core revision";
261 | |     5:4     security_model as u8 ?=> FalconSecurityModel, "Security model";
262 | |     7:6     core_rev_subversion as u8 ?=> FalconCoreRevSubversion, "Core revision subversion";
263 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<FalconSecurityModel>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<FalconSecurityModel>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:259:1
    |
259 | / register!(NV_PFALCON_FALCON_HWCFG1 @ +0x0000012c {
260 | |     3:0     core_rev as u8 ?=> FalconCoreRev, "Core revision";
261 | |     5:4     security_model as u8 ?=> FalconSecurityModel, "Security model";
262 | |     7:6     core_rev_subversion as u8 ?=> FalconCoreRevSubversion, "Core revision subversion";
263 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<FalconCoreRevSubversion>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<FalconCoreRevSubversion>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:259:1
    |
259 | / register!(NV_PFALCON_FALCON_HWCFG1 @ +0x0000012c {
260 | |     3:0     core_rev as u8 ?=> FalconCoreRev, "Core revision";
261 | |     5:4     security_model as u8 ?=> FalconSecurityModel, "Security model";
262 | |     7:6     core_rev_subversion as u8 ?=> FalconCoreRevSubversion, "Core revision subversion";
263 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<FalconFbifTarget>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<FalconFbifTarget>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:276:1
    |
276 | / register!(NV_PFALCON_FBIF_TRANSCFG @ +0x00000600 {
277 | |     1:0     target as u8 ?=> FalconFbifTarget;
278 | |     2:2     mem_type as bool => FalconFbifMemType;
279 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<FalconFbifMemType>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<FalconFbifMemType>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:276:1
    |
276 | / register!(NV_PFALCON_FBIF_TRANSCFG @ +0x00000600 {
277 | |     1:0     target as u8 ?=> FalconFbifTarget;
278 | |     2:2     mem_type as bool => FalconFbifMemType;
279 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<FalconModSelAlgo>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<FalconModSelAlgo>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:285:1
    |
285 | / register!(NV_PFALCON2_FALCON_MOD_SEL @ +0x00001180 {
286 | |     7:0     algo as u8 ?=> FalconModSelAlgo;
287 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u32: From<PeregrineCoreSelect>` is not satisfied
   --> drivers/gpu/nova-core/regs/macros.rs:310:26
    |
310 |               let value = (u32::from(value) << SHIFT) & MASK;
    |                            ^^^ the trait `From<PeregrineCoreSelect>` is not implemented for `u32`
    |
   ::: drivers/gpu/nova-core/regs.rs:304:1
    |
304 | / register!(NV_PRISCV_RISCV_BCR_CTRL @ +0x00001668 {
305 | |     0:0     valid as bool;
306 | |     4:4     core_select as bool => PeregrineCoreSelect;
307 | |     8:8     br_fetch as bool;
308 | | });
    | |__- in this macro invocation
    |
    = help: the following other types implement trait `From<T>`:
              `u32` implements `From<Char>`
              `u32` implements `From<CpuId>`
              `u32` implements `From<Ipv4Addr>`
              `u32` implements `From<NV_FUSE_OPT_FPF_GSP_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_NVDEC_UCODE1_VERSION>`
              `u32` implements `From<NV_FUSE_OPT_FPF_SEC2_UCODE1_VERSION>`
              `u32` implements `From<NV_PBUS_SW_SCRATCH_0E>`
              `u32` implements `From<NV_PDISP_VGA_WORKSPACE_BASE>`
            and 41 others
    = note: this error originates in the macro `register` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `as_nanos` found for struct `Delta` in the current scope
  --> drivers/gpu/nova-core/util.rs:45:33
   |
45 |         if start_time.elapsed().as_nanos() > timeout.as_nanos() as i64 {
   |                                 ^^^^^^^^ method not found in `Delta`

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.

Presumably caused by commit

  b7c8d7a8d251 ("rust: enable `clippy::cast_lossless` lint")

interacting with some changes in the drm-nova tree
(https://gitlab.freedesktop.org/drm/nova.git#nova-next).

A suggested merge resolution would be appreciated.

I have used the rust tree from next-20250620 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2025-05-27  9:42 Stephen Rothwell
  2025-05-27 10:03 ` Miguel Ojeda
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2025-05-27  9:42 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3447 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::alloc::kvec::tests::kunit_rust_wrapper_test_kvec_retain':
(.text+0x1bd7194): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd71a1): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd71ae): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::kunit::tests::kunit_rust_wrapper_rust_test_kunit_in_kunit_test':
(.text+0x1bd75eb): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd75f8): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd7605): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_to_str':
(.text+0x1bd7e01): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd7e0e): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd7e1b): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_to_str_invalid_utf8':
(.text+0x1bd81a0): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd81ad): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd81ba): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_display':
(.text+0x1bd9728): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bd9735): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bd9742): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_display_all_bytes':
(.text+0x1bda03c): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bda049): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bda056): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_cstr_debug':
(.text+0x1bdb598): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bdb5a5): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bdb5b2): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_bstr_display':
(.text+0x1bdcf82): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bdcf8f): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bdcf9c): undefined reference to `__kunit_abort'
x86_64-linux-gnu-ld: vmlinux.o: in function `kernel::str::tests::kunit_rust_wrapper_test_bstr_debug':
(.text+0x1bde962): undefined reference to `kunit_unary_assert_format'
x86_64-linux-gnu-ld: (.text+0x1bde96f): undefined reference to `__kunit_do_failed_assertion'
x86_64-linux-gnu-ld: (.text+0x1bde97c): undefined reference to `__kunit_abort'

Caused by one of the latest commits in the rust tree.

I have used the rust tree from next-20250526 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2025-05-12  9:40 Stephen Rothwell
  2025-05-12 11:52 ` Miguel Ojeda
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2025-05-12  9:40 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

Hi all,

After merging the rust tree and the other rust trees, today's linux-next
build (x86_64 allmodconfig) failed like this:

error[E0599]: no method named `cast_mut` found for raw pointer `*mut auxiliary_device` in the current scope
   --> rust/kernel/auxiliary.rs:239:83
    |
239 |         let adev = unsafe { container_of!(dev, bindings::auxiliary_device, dev) }.cast_mut();
    |                                                                                   ^^^^^^^^
    |
help: there is a method `as_mut` with a similar name
    |
239 |         let adev = unsafe { container_of!(dev, bindings::auxiliary_device, dev) }.as_mut();
    |                                                                                   ~~~~~~

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0599`.

Not sure what caused this and that file has not changed from
next-20250509, so I have used the rust tree from next-20250509 for today.
Clearly I need help with the merge resolution here.



-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2025-03-24 10:57 Stephen Rothwell
  2025-03-24 11:06 ` Stephen Rothwell
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2025-03-24 10:57 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0277]: `*mut MyStruct` cannot be sent between threads safely
  --> samples/rust/rust_dma.rs:47:22
   |
47 | impl pci::Driver for DmaSampleDriver {
   |                      ^^^^^^^^^^^^^^^ `*mut MyStruct` cannot be sent between threads safely
   |
   = help: within `DmaSampleDriver`, the trait `Send` is not implemented for `*mut MyStruct`, which is required by `DmaSampleDriver: Send`
note: required because it appears within the type `CoherentAllocation<MyStruct>`
  --> rust/kernel/dma.rs:132:12
note: required because it appears within the type `DmaSampleDriver`
  --> samples/rust/rust_dma.rs:9:8
   |
9  | struct DmaSampleDriver {
   |        ^^^^^^^^^^^^^^^
note: required by a bound in `kernel::pci::Driver`
  --> rust/kernel/pci.rs:225:1

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.

I have no idea what caused this - it built in next-20250321, but that
no longer builds, so I have reset to the version of the rust tree in
next-20250320 (commit 4a47eec07be6).

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2025-03-17 10:57 Stephen Rothwell
  2025-03-17 22:35 ` Miguel Ojeda
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2025-03-17 10:57 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0603]: trait import `PinInit` is private
   --> rust/kernel/time/hrtimer.rs:71:19
    |
71  | use crate::{init::PinInit, prelude::*, time::Ktime, types::Opaque};
    |                   ^^^^^^^ private trait import
    |
note: the trait import `PinInit` is defined here...
   --> rust/kernel/init.rs:141:64
    |
141 | use pin_init::{init_from_closure, pin_init_from_closure, Init, PinInit};
    |                                                                ^^^^^^^
note: ...and refers to the trait `PinInit` which is defined here
   --> rust/pin-init/src/lib.rs:1003:1
    |
    = note: you could import this directly
help: import `PinInit` directly
    |
71  | use crate::{pin_init::PinInit, prelude::*, time::Ktime, types::Opaque};
    |             ~~~~~~~~~~~~~~~~~

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0603`.

Presumably this is caused by my merge resolutions :-(  Please have a
look and let me know what te resolutions should be.

I have used the rust tree from next-20250314 for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2025-01-10  5:28 Stephen Rothwell
  2025-01-10  9:28 ` Alice Ryhl
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2025-01-10  5:28 UTC (permalink / raw)
  To: Miguel Ojeda, Greg KH
  Cc: Alice Ryhl, Greg Kroah-Hartman, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0423]: expected function, found macro `kernel::build_error`
   --> rust/kernel/miscdevice.rs:159:9
    |
159 |         kernel::build_error(VTABLE_DEFAULT_ERROR)
    |         ^^^^^^^^^^^^^^^^^^^ not a function
    |
help: use `!` to invoke the macro
    |
159 |         kernel::build_error!(VTABLE_DEFAULT_ERROR)
    |                            +
help: consider importing one of these functions instead
    |
11  + use crate::build_assert::build_error;
    |
11  + use build_error::build_error;
    |
help: if you import `build_error`, refer to it directly
    |
159 -         kernel::build_error(VTABLE_DEFAULT_ERROR)
159 +         build_error(VTABLE_DEFAULT_ERROR)
    |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0423`.

Caused by commit

  614724e780f5 ("rust: kernel: move `build_error` hidden function to prevent mistakes")

interacting with commit

  5bcc8bfe841b ("rust: miscdevice: add fops->show_fdinfo() hook")

from the driver-core tree.

I have added the following merge resolution patch.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 10 Jan 2025 16:02:19 +1100
Subject: [PATCH] fix up for "rust: kernel: move `build_error` hidden function
 to prevent mistakes"

interacting with commit

  5bcc8bfe841b ("rust: miscdevice: add fops->show_fdinfo() hook")

from the driver-core tree.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 rust/kernel/miscdevice.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/miscdevice.rs b/rust/kernel/miscdevice.rs
index 9685e50b100d..3ba018651bc0 100644
--- a/rust/kernel/miscdevice.rs
+++ b/rust/kernel/miscdevice.rs
@@ -156,7 +156,7 @@ fn show_fdinfo(
         _m: &SeqFile,
         _file: &File,
     ) {
-        kernel::build_error(VTABLE_DEFAULT_ERROR)
+        build_error!(VTABLE_DEFAULT_ERROR)
     }
 }
 
-- 
2.45.2

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2024-11-11  6:58 Stephen Rothwell
  2024-11-11  8:16 ` Miguel Ojeda
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2024-11-11  6:58 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Gary Guo, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 4961 bytes --]

Hi all,

My first rust build error!  ;-)

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

error[E0308]: mismatched types
     --> rust/kernel/device.rs:176:17
      |
175   |             bindings::_dev_printk(
      |             --------------------- arguments to this function are incorrect
176   |                 klevel as *const _ as *const core::ffi::c_char,
      |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
      |
      = note: expected raw pointer `*const u8`
                 found raw pointer `*const i8`
note: function defined here
     --> /home/sfr/next/x86_64_allmodconfig/rust/bindings/bindings_generated.rs:60521:12
      |
60521 |     pub fn _dev_printk(level: *const ffi::c_char, dev: *const device, fmt: *const ffi::c_char, ...);
      |            ^^^^^^^^^^^

error[E0308]: mismatched types
   --> rust/kernel/miscdevice.rs:159:52
    |
159 |             unlocked_ioctl: maybe_fn(T::HAS_IOCTL, fops_ioctl::<T>),
    |                             --------               ^^^^^^^^^^^^^^^ expected fn pointer, found fn item
    |                             |
    |                             arguments to this function are incorrect
    |
    = note: expected fn pointer `unsafe extern "C" fn(_, _, usize) -> isize`
                  found fn item `unsafe extern "C" fn(_, _, u64) -> i64 {fops_ioctl::<T>}`
help: the return type of this call is `unsafe extern "C" fn(*mut bindings::file, u32, u64) -> i64 {fops_ioctl::<T>}` due to the type of the argument passed
   --> rust/kernel/miscdevice.rs:159:29
    |
159 |             unlocked_ioctl: maybe_fn(T::HAS_IOCTL, fops_ioctl::<T>),
    |                             ^^^^^^^^^^^^^^^^^^^^^^^---------------^
    |                                                    |
    |                                                    this argument influences the return type of `maybe_fn`
note: function defined here
   --> rust/kernel/miscdevice.rs:144:14
    |
144 |     const fn maybe_fn<T: Copy>(check: bool, func: T) -> Option<T> {
    |              ^^^^^^^^                       -------

error[E0308]: mismatched types
   --> rust/kernel/miscdevice.rs:162:22
    |
162 |                 Some(fops_compat_ioctl::<T>)
    |                 ---- ^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item
    |                 |
    |                 arguments to this enum variant are incorrect
    |
    = note: expected fn pointer `unsafe extern "C" fn(_, _, usize) -> isize`
                  found fn item `unsafe extern "C" fn(_, _, u64) -> i64 {fops_compat_ioctl::<T>}`
help: the type constructed contains `unsafe extern "C" fn(*mut bindings::file, u32, u64) -> i64 {fops_compat_ioctl::<T>}` due to the type of the argument passed
   --> rust/kernel/miscdevice.rs:162:17
    |
162 |                 Some(fops_compat_ioctl::<T>)
    |                 ^^^^^----------------------^
    |                      |
    |                      this argument influences the type of `Some`
note: tuple variant defined here
   --> /usr/lib/rustlib/src/rust/library/core/src/option.rs:579:5
    |
579 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^

error[E0308]: mismatched types
  --> rust/kernel/security.rs:36:13
   |
32 |         to_result(unsafe { bindings::security_secid_to_secctx(secid, &mut secdata, &mut seclen) })?;
   |                                                                           ------- here the type of `secdata` is inferred to be `*mut u8`
...
36 |             secdata,
   |             ^^^^^^^ expected `*mut i8`, found `*mut u8`
   |
   = note: expected raw pointer `*mut i8`
              found raw pointer `*mut u8`

error[E0308]: mismatched types
     --> rust/kernel/security.rs:72:52
      |
72    |         unsafe { bindings::security_release_secctx(self.secdata, self.seclen as u32) };
      |                  --------------------------------- ^^^^^^^^^^^^ expected `*mut u8`, found `*mut i8`
      |                  |
      |                  arguments to this function are incorrect
      |
      = note: expected raw pointer `*mut u8`
                 found raw pointer `*mut i8`
note: function defined here
     --> /home/sfr/next/x86_64_allmodconfig/rust/bindings/bindings_generated.rs:87586:12
      |
87586 |     pub fn security_release_secctx(secdata: *mut ffi::c_char, seclen: u32_);
      |            ^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.

Presumably caused by my merge resolutions involving commit

  d072acda4862 ("rust: use custom FFI integer types")

I have used the rust tree from next-20241108 for today.

Any help with the merge resolutions would be much appreciated.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread
* linux-next: build failure after merge of the rust tree
@ 2021-09-28  4:09 Stephen Rothwell
  2021-09-28  4:18 ` Gary Guo
  0 siblings, 1 reply; 58+ messages in thread
From: Stephen Rothwell @ 2021-09-28  4:09 UTC (permalink / raw)
  To: Miguel Ojeda, Masahiro Yamada
  Cc: Richard Weinberger, Adam Bratschi-Kaye, Alex Gaynor, Ayaan Zaidi,
	Boqun Feng, Boris-Chengbiao Zhou, Douglas Su, Finn Behrens,
	Fox Chen, Gary Guo, Geoffrey Thomas, Michael Ellerman,
	Sumera Priyadarsini, Sven Van Asbroeck, Wedson Almeida Filho,
	Yuki Okushi, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]

Hi all,

After merging the rust tree, today's linux-next build (x86_64
allmodconfig) failed like this:

scripts/kconfig/confdata.c: In function 'rustc_cfg_print_symbol':
scripts/kconfig/confdata.c:669:9: warning: implicit declaration of function 'sym_escape_string_value'; did you mean 'sym_set_string_value'? [-Wimplicit-function-declaration]
  669 |   str = sym_escape_string_value(value);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         sym_set_string_value
scripts/kconfig/confdata.c:669:7: warning: assignment to 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  669 |   str = sym_escape_string_value(value);
      |       ^
/usr/bin/ld: scripts/kconfig/confdata.o: in function `rustc_cfg_print_symbol':
confdata.c:(.text+0x738): undefined reference to `sym_escape_string_value'

Caused by commit

  dc08d49444e9 ("Kbuild: add Rust support")

interacting with commit

  420a2bdbead2 ("kconfig: Refactor sym_escape_string_value")

from the kbuild tree.

I applied the following patch, but it doesn't seem quite right.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 28 Sep 2021 14:02:54 +1000
Subject: [PATCH] fixup for "kconfig: Refactor sym_escape_string_value"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 scripts/kconfig/confdata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index e1a739897d5a..096222531954 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -666,7 +666,7 @@ static void rustc_cfg_print_symbol(FILE *fp, struct symbol *sym, const char *val
 	case S_HEX:
 	case S_BOOLEAN:
 	case S_TRISTATE:
-		str = sym_escape_string_value(value);
+		str = sym_escape_string(sym);
 
 		/*
 		 * We don't care about disabled ones, i.e. no need for
-- 
2.33.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2025-06-24 12:29 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16  5:25 linux-next: build failure after merge of the rust tree Stephen Rothwell
2024-12-16 10:31 ` Miguel Ojeda
2024-12-16 10:59   ` Jocelyn Falempe
2024-12-16 16:24     ` Miguel Ojeda
2024-12-16 19:46       ` Jocelyn Falempe
  -- strict thread matches above, loose matches on Subject: below --
2025-06-24  7:31 Stephen Rothwell
2025-06-24 10:31 ` Miguel Ojeda
2025-06-24 11:12   ` Danilo Krummrich
2025-06-24 12:29     ` Miguel Ojeda
2025-06-24 12:00   ` Danilo Krummrich
2025-06-24 12:14     ` Alexandre Courbot
2025-06-24 12:16       ` Tamir Duberstein
2025-06-24 12:24         ` Alexandre Courbot
2025-06-24 12:29           ` Tamir Duberstein
2025-06-24 12:25     ` Miguel Ojeda
2025-05-27  9:42 Stephen Rothwell
2025-05-27 10:03 ` Miguel Ojeda
2025-05-12  9:40 Stephen Rothwell
2025-05-12 11:52 ` Miguel Ojeda
2025-03-24 10:57 Stephen Rothwell
2025-03-24 11:06 ` Stephen Rothwell
2025-03-24 11:59   ` Danilo Krummrich
2025-03-24 13:29     ` Greg KH
2025-03-24 13:43       ` Danilo Krummrich
2025-03-24 13:52         ` Greg KH
2025-03-24 15:18         ` Miguel Ojeda
2025-03-24 15:27           ` Danilo Krummrich
2025-03-24 15:40             ` Miguel Ojeda
2025-03-17 10:57 Stephen Rothwell
2025-03-17 22:35 ` Miguel Ojeda
2025-03-17 23:35   ` Stephen Rothwell
2025-03-18 11:37     ` Stephen Rothwell
2025-03-18 23:47       ` Miguel Ojeda
2025-03-19  9:06         ` Stephen Rothwell
2025-03-19  9:18           ` Miguel Ojeda
2025-01-10  5:28 Stephen Rothwell
2025-01-10  9:28 ` Alice Ryhl
2025-01-10  9:34   ` Greg Kroah-Hartman
2025-01-10  9:41     ` Alice Ryhl
2025-01-10 10:07       ` Alice Ryhl
2025-01-10 10:08       ` Miguel Ojeda
2025-01-10 10:16     ` Miguel Ojeda
2025-01-10 10:38       ` Miguel Ojeda
2024-11-11  6:58 Stephen Rothwell
2024-11-11  8:16 ` Miguel Ojeda
2024-11-11  8:28   ` Miguel Ojeda
2024-11-11 14:15     ` Gary Guo
2024-11-11 23:08       ` Miguel Ojeda
2024-11-11 23:58     ` Miguel Ojeda
2024-11-12  1:29       ` Stephen Rothwell
2024-11-12  6:30       ` Stephen Rothwell
2024-11-12  8:50         ` Miguel Ojeda
2021-09-28  4:09 Stephen Rothwell
2021-09-28  4:18 ` Gary Guo
2021-09-28  5:52   ` Stephen Rothwell
2021-09-28 23:37     ` Stephen Rothwell
2021-09-29 17:13       ` Masahiro Yamada
2021-09-29 17:25         ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).