devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "Simon Glass" <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	"Marc-André Lureau"
	<marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Devicetree Compiler"
	<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v6 1/4] pylibfdt: allow build out of tree
Date: Tue, 9 Nov 2021 12:48:46 +1100	[thread overview]
Message-ID: <YYnTfsRXIpqz6upj@yekko> (raw)
In-Reply-To: <CAL_Jsq+gtg2md6h3PycEZdXqyqkvYyZ1x1MmShhvPMxV0idZgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

On Mon, Nov 08, 2021 at 07:07:56PM -0600, Rob Herring wrote:
> On Mon, Nov 8, 2021 at 6:09 PM Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> >
> > Hi Rob,
> >
> > On Mon, 8 Nov 2021 at 09:59, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > >
> > > On Mon, Nov 8, 2021 at 9:58 AM Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
> > > >
> > > > Hi,
> > > >
> > > > On Sun, 7 Nov 2021 at 22:14, David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6ryscVyMRj84@public.gmane.org.au> wrote:
> > > > >
> > > > > On Fri, Nov 05, 2021 at 04:01:38PM -0500, Rob Herring wrote:
> > > > > > On Wed, Nov 4, 2020 at 1:45 PM <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > > > > > >
> > > > > > > From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > > > > > >
> > > > > > > With meson, we have to support out-of-tree build.
> > > > > >
> > > > > > I noticed that meson still builds pylibfdt/libfdt.py and
> > > > > > pylibfdt/libfdt_wrap.c in tree. And it makes the result unusable
> > > > > > without installing. For example the README instructions don't work:
> > > > > >
> > > > > >     $ cd pylibfdt
> > > > > >     $ python3 -c "import libfdt; help(libfdt)"
> > > > > >
> > > > > > I tried to fix the in tree part with swig option '-outdir', but that
> > > > > > didn't work.
> > > > >
> > > > > Urgh.  This has always fit poorly with the rest of the build system.
> > > > > In addition, I've discovered that with Fedora 35, I now get this scary warning:
> > > > >
> > > > >          PYMOD pylibfdt/_libfdt.so
> > > > > /usr/lib/python3.10/site-packages/setuptools/dist.py:498: UserWarning: The version specified ('1.6.1-g4eda2590-dirty') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
> > > > >   warnings.warn(
> > > > > make[1]: Leaving directory '/home/dwg/src/dtc'
> > > > >
> > > > > Merely replacing 'distutils' with 'setuptools' in the code does not
> > > > > fix this.
> > > >
> > > > I don't know much about this. Python seems to want to use .' 'instead
> > > > of '-' but I'm not sure why they decided this so recently.
> > >
> > > I'm working on patches for both of these issues.
> > >
> > > > > > Really what I'm after is what uses need to be supported? I'm looking
> > > > > > at getting pip and pypi packaging to work. I'm actually wondering if
> > > > > > pylibfdt needs to be so tightly coupled to the build system(s!) and
> > > > > > source tree. The dependencies are really just libfdt headers and
> > > > > > library which are easily installed either from source or a distro pkg.
> > > > > > The '..libfdt/' references are problematic with the packaging tools.
> > > > > > The easier route may be a standalone repo with a copy of libfdt.i and
> > > > > > a different setup.py.
> > > > >
> > > > > Unfortunately, I don't know enough about either Meson or Python
> > > > > packaging to fix this.  Simon?
> > > >
> > > > I'm not quite sure what the problem is with pip3, etc. I am not an
> > > > expert on any of these but can probably find some help if we have a
> > > > clear problem. Rob, do you have a patch that causes the problem?
> > >
> > > Python has certain thoughts on what the directory structure looks like
> > > and building an sdist can't include something outside of pylibfdt/
> > > (the headers specifically). Basically, this is what needs to work
> > > locally for an install from PyPI to work:
> > >
> > > ./setup.py sdist
> > > pip install -f ./dist/ libfdt
> > >
> > > We also need to statically link if we want to create a wheel (python
> > > binary) for PyPI. (setuptools has to be used for a wheel)
> > >
> > > > I am not keen on splitting the repos as pylibfdt has a source
> > > > dependency on libfdt.h
> > >
> > > Yes, but libfdt.h is part of the ABI and should only change in an ABI
> > > compatible way, right? If you really want the version of libfdt you
> > > built, you do have to install it AFAICT. I don't think the wrapper
> > > will load ../libfdt/libfdt.so.
> > >
> > > I think the easiest way to solve these problems is moving setup.py up
> > > to the project root and perhaps dropping the pylibfdt parts from
> > > make/meson. Then working with the python bits all works 'the Python
> > > way'.
> >
> > That seems OK to me, but can we have the Makefile invoke the Python
> > stuff? How does having a meson option (who uses it?) affect all this?
> 
> Everyone. The goal is meson will replace at least the bulk of the
> makefiles and they just become wrappers. The issue is getting setup.py
> to do out of tree builds that I mentioned at the start of this thread.

I'm ok with that, but could you please update the README to include
"meson native" build instructions.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-11-09  1:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 19:45 [PATCH v6 0/4] Switch to meson build system marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
     [not found] ` <20201104194527.986901-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2020-11-04 19:45   ` [PATCH v6 1/4] pylibfdt: allow build out of tree marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
     [not found]     ` <20201104194527.986901-2-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-11-05 21:01       ` Rob Herring
     [not found]         ` <CAL_JsqL=panX9EW+41vTwsaWLtJbsY=opPPbwH+nnEGZSVnYsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-08  5:14           ` David Gibson
2021-11-08 15:58             ` Simon Glass
     [not found]               ` <CAPnjgZ3zndvzBoAdqsW+n7Ao33nEiRr2CXGcBnm_=XDzGmM1_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-08 16:59                 ` Rob Herring
     [not found]                   ` <CAL_Jsq+LDmauXEookk4DFiVcEWaGfC_7pxH=B-=N=ear6MzhvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-09  0:09                     ` Simon Glass
     [not found]                       ` <CAPnjgZ1wEb25Ow2v9K7Jp=1+Q2_6ufQGm+e8TjidPCNH5eNY2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-09  1:07                         ` Rob Herring
     [not found]                           ` <CAL_Jsq+gtg2md6h3PycEZdXqyqkvYyZ1x1MmShhvPMxV0idZgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-11-09  1:48                             ` David Gibson [this message]
2020-11-04 19:45   ` [PATCH v6 2/4] build-sys: add meson build marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
2020-11-04 19:45   ` [PATCH v6 3/4] travis: install meson marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
2020-11-04 19:45   ` [PATCH v6 4/4] build-sys: replace makefiles to wrap meson/ninja marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
2020-11-26 12:39   ` [PATCH v6 0/4] Switch to meson build system Marc-André Lureau
     [not found]     ` <CAMxuvazBvmGo+SXREbzq3Yp3=CYbW8B9M67P5oS1ttdJBwRQfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-12-04  0:37       ` David Gibson

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=YYnTfsRXIpqz6upj@yekko \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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).