From: Brandon Maier via buildroot <buildroot@buildroot.org>
To: "James Hilliard" <james.hilliard1@gmail.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Cc: Romain Naour <romain.naour@gmail.com>,
buildroot@buildroot.org, Bryan Brattlof <bb@ti.com>,
"Yann E. MORIN" <yann.morin.1998@free.fr>,
Marcus Hoffmann <buildroot@bubu1.eu>
Subject: Re: [Buildroot] [PATCH 1/2] Revert "Create a .gitignore file in the CANONICAL_O directory"
Date: Thu, 25 Jul 2024 15:01:19 +0000 [thread overview]
Message-ID: <D2YPL0DRBIDJ.1IXAMC2W0UE6C@collins.com> (raw)
In-Reply-To: <CADvTj4qxPTw_rGV1wLWn6hvFvJ7fL50V=_npzCnQ5qAOrFZkDg@mail.gmail.com>
Hi Thomas, James,
On Thu Jul 25, 2024 at 6:04 AM UTC, James Hilliard wrote:
> On Wed, Jul 24, 2024 at 11:51 PM Thomas Petazzoni via buildroot
> <buildroot@buildroot.org> wrote:
> >
> > Hello Brandon,
> >
> > On Wed, 24 Jul 2024 21:23:20 +0000
> > Brandon Maier <brandon.maier@collins.com> wrote:
> >
> > > The packages 'python-jsonschema-specifications', 'pydantic-core', and
> > > likely other packages based on Python maturin silently stopped
> > > installing files to the host and target directories after commit
> > > a14c862c08.
> > >
> > > A similar issue was reported by the Conda project[1]. It seems some
> > > build tools scan for gitignore files to decide what files to build
> > > and install.
> > >
> > > I attempted various combinations of gitignore patterns including
> > > mimicking the Conda project's gitignore[2], but the only thing that has
> > > worked reliably is the original `/output` ignore in the root Buildroot
> > > directory.
> >
> > Thanks for working on this. However, it's really messed up. Why would
> > these tools be bothered by a .gitignore file? Do you have some more
> > details?
>
> So it's the exact same reason ripgrep is affected by .gitignore files,
> maturin actually uses the ignore crate from the ripgrep project:
> https://crates.io/crates/ignore
>
> Note that the ignore crate doesn't entirely correctly replicate git's
> ignore logic as otherwise this shouldn't have triggered any issues.
It does seem to replicate git's ignore logic correctly. The issue is
that we download python-jsonschema as a tarball which does not include
the '.git' directory. So when `maturin` tries to use gitignore's, it
does do what git would do, it searches upwards until it finds
Buildroot's '.git' directory and treats it as the repo.
It seems to me then the fix is one of
- Buildroot needs to switch to using the git repo directly
- Buildroot needs to create an empty git repo in build/python-jsonschema/
- Maturin needs to stop searching for git repos at its pyproject
directory, which James' Pull Request is doing
And I agree fixing it in Maturin is the correct place. As that will also
fix it for anyone using the tarballs, like Conda. Though it does make me
paranoid about what other build tools out there might be expecting a git
repo and then silently falling back to the Buildroot repo...
What was surprising to me is that the `/output` pattern in Buildroot's
root gitignore doesn't cause this problem. This appears to be a bug in
ripgrep's logic, and I found this long thread that seems related. So if
this ever gets fixed then these packages will be broken again.
https://github.com/BurntSushi/ripgrep/issues/829
>
> >
> > I think I'm going to apply the revert to fix the immediate build
> > issues, but I would really really like to fix the real problem, and
> > allow us to generate this .gitignore file in the output directory.
>
> Yeah, I've been working on a fix but it has some issues, maybe
> someone can help fix the tests:
> https://github.com/PyO3/maturin/pull/2158
Thank you James for looking at this so quickly,
Brandon
>
> >
> > 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
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-07-25 15:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 21:23 [Buildroot] [PATCH 0/2] Fix .gitignore in CANONICAL_O breaking Python packages Brandon Maier via buildroot
2024-07-24 21:23 ` [Buildroot] [PATCH 1/2] Revert "Create a .gitignore file in the CANONICAL_O directory" Brandon Maier via buildroot
2024-07-25 5:51 ` Thomas Petazzoni via buildroot
2024-07-25 6:04 ` James Hilliard
2024-07-25 15:01 ` Brandon Maier via buildroot [this message]
2024-07-25 15:17 ` James Hilliard
2024-07-25 19:34 ` Brandon Maier via buildroot
2024-07-26 9:25 ` James Hilliard
2024-07-26 7:33 ` Thomas Petazzoni via buildroot
2024-07-24 21:23 ` [Buildroot] [PATCH 2/2] gitignore: ignore multiple output directories Brandon Maier via buildroot
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=D2YPL0DRBIDJ.1IXAMC2W0UE6C@collins.com \
--to=buildroot@buildroot.org \
--cc=bb@ti.com \
--cc=brandon.maier@collins.com \
--cc=buildroot@bubu1.eu \
--cc=james.hilliard1@gmail.com \
--cc=romain.naour@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/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