Rust-for-linux archive mirror
 help / color / mirror / Atom feed
From: Thomas Bertschinger <tahbertschinger@gmail.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: linux-bcachefs@vger.kernel.org, bfoster@redhat.com,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH BCACHEFS-TOOLS] use upstream bindgen; fix packed and aligned types
Date: Mon, 22 Jan 2024 13:19:13 -0700	[thread overview]
Message-ID: <20240122201913.GA207770@fedora-laptop> (raw)
In-Reply-To: <l2b36a5msxov3664f2vb67mud5dcsm3younju2sdzbgk645qw5@b64t35mlhlrb>

On Mon, Jan 22, 2024 at 02:22:47PM -0500, Kent Overstreet wrote:
> 
> Doesn't build here...?
> 
>    Compiling bch_bindgen v0.1.0 (/home/kent/bcachefs-tools/bch_bindgen)
> error[E0587]: type has conflicting packed and align representation hints
>  --> /home/kent/bcachefs-tools/target/release/build/bch_bindgen-6ee8b9c8755f1deb/out/bcachefs.rs:3:147196
>   |
> 3 | ...r (align (8))] # [derive (Debug , Default , Copy , Clone)] pub struct bkey { pub u64s : __u8 , pub _bitfield_align_1 : [u8 ; 0] , pub ...
>   |                                                               ^^^^^^^^^^^^^^^

It looks like this happens if you build bcachefs-tools in an environment
without the "rustfmt" tool. Turns out that tool is what inserts the line
breaks into the bindings string. If rustfmt isn't in the path, you get
a string with spaces instead of "\n".

I will work on a v2 that can be resilient to that environment
difference.

FWIW, it looks like the bindgen maintainer is open to a patch to handle
this in bindgen, so hopefully this is a short-lived hack...
https://github.com/rust-lang/rust-bindgen/issues/2725

- Thomas Bertschinger

      reply	other threads:[~2024-01-22 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 14:36 [PATCH BCACHEFS-TOOLS] use upstream bindgen; fix packed and aligned types Thomas Bertschinger
2024-01-22 14:52 ` Martin Rodriguez Reboredo
2024-01-22 19:22 ` Kent Overstreet
2024-01-22 20:19   ` Thomas Bertschinger [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=20240122201913.GA207770@fedora-laptop \
    --to=tahbertschinger@gmail.com \
    --cc=bfoster@redhat.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /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 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 read-only IMAP folder(s) and NNTP newsgroup(s).