All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Cc: buildroot@buildroot.org, Christopher Obbard <obbardc@gmail.com>
Subject: Re: [Buildroot] [PATCH v2 2/2] package/dtui: require 64-bit atomic support
Date: Sat, 5 Sep 2026 15:58:15 +0200	[thread overview]
Message-ID: <apwfqRATqEGdN3SL@windsurf> (raw)
In-Reply-To: <20260831-wip-obbardc-package-dtui-fix-armv5-v2-2-42eceaa12f55@oss.qualcomm.com>

Hello,

On Mon, Aug 31, 2026 at 04:49:58PM +0100, Christopher Obbard via buildroot wrote:
> dtui depends on tui-textarea which unconditionally imports AtomicU64 in
> src/widget.rs to pack a viewport rectangle into a single atomic word:
> 
>   use std::sync::atomic::{AtomicU64, Ordering};
>   pub struct Viewport(AtomicU64);
> 
> As there is no cfg(target_has_atomic) guard in tui-textarea, its
> build fails on any target for which rustc does not provide 64-bit
> atomics with:
> 
>   Compiling tui-textarea v0.7.0
>   error[E0432]: unresolved import `std::sync::atomic::AtomicU64`
>     --> .../dtui-3.0.0/VENDOR/tui-textarea/src/widget.rs:10:25
>      |
>   10 | use std::sync::atomic::{AtomicU64, Ordering};
>      |                         ^^^^^^^^^ no `AtomicU64` in `sync::atomic`
>      |
>   help: a similar name exists in the module
>      |
>   10 - use std::sync::atomic::{AtomicU64, Ordering};
>   10 + use std::sync::atomic::{AtomicU32, Ordering};
> 
> This has been reported to tui-textarea upstream, but unfortunately the
> project seems to be unmaintained (issue linked below). A sane workaround
> is to disable the package on targets which lack 64-bit atomic support,
> which is exactly what BR2_PACKAGE_HOST_RUSTC_TARGET_HAS_ATOMIC_64
> describes: it is n for armv5te-unknown-linux-{gnu,musl}eabi and
> powerpc-unknown-linux-gnu, the only rust targets Buildroot can generate
> which lack 64-bit atomics, and y everywhere else.
> 
> The same problem was hit by package/dust and worked around in commit
> 3abc3b97bad9 ("package/dust: bump to version 1.1.2") by bumping to a
> version in which upstream had added the missing guard. That is not an
> option here as tui-textarea 0.7.0 is the latest release.
> 
> Note that a runtime test for dtui cannot use the default
> infra.basetest.BASIC_TOOLCHAIN_CONFIG, since that builds with
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_STABLE, where dtui is now
> disabled; such a test would need an armv7 or aarch64 toolchain instead.
> 
> Build tested with utils/test-pkg against:
> - BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_GLIBC_STABLE
> - BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV5_EABI_MUSL_STABLE
> - BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_POWERPC_E500MC_GLIBC_STABLE
> 
> all three fail with the above error before this change and are skipped
> after it, while armv7 (glibc and musl), aarch64, powerpc64le and x86-64
> still select and build the package.
> 
> Link: https://github.com/rhysd/tui-textarea/issues/66
> Fixes: https://autobuild.buildroot.org/results/188f6442371500731453f75983590c922eab6d57
> Fixes: https://autobuild.buildroot.org/results/e254db2654f18f1d2110eb8b1a32b43ad0f2a3d6
> Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>

Thanks, applied after:

- Renaming the symbol

- Adding the "depends on" also to the Config.in comment so that the
  comment doesn't appear on CPU architectures where dtui will anyway
  not be available

Thanks a lot!

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

      parent reply	other threads:[~2026-09-05 13:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 15:49 [Buildroot] [PATCH v2 0/2] package/dtui: fix build failure on targets without 64-bit atomics Christopher Obbard via buildroot
2026-08-31 15:49 ` [Buildroot] [PATCH v2 1/2] package/rustc: add BR2_PACKAGE_HOST_RUSTC_TARGET_HAS_ATOMIC_64 Christopher Obbard via buildroot
2026-09-02 21:24   ` Romain Naour via buildroot
2026-09-02 21:31     ` Romain Naour via buildroot
2026-09-05 13:56   ` Thomas Petazzoni via buildroot
2026-08-31 15:49 ` [Buildroot] [PATCH v2 2/2] package/dtui: require 64-bit atomic support Christopher Obbard via buildroot
2026-09-02 21:39   ` Romain Naour via buildroot
2026-09-05 13:58   ` Thomas Petazzoni via buildroot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=apwfqRATqEGdN3SL@windsurf \
    --to=buildroot@buildroot.org \
    --cc=chris.obbard@oss.qualcomm.com \
    --cc=obbardc@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.