Hi Timo. Thanks for replying.

My feeling is that being confused by that symlink is a bug, but I didn't
read #998084 in great detail, so maybe I'm missing some nuance. So let's
make this work.

** Short version **

Proposal: if pkg-config files will be added in the near future, can we
wait until those are available before removing the symlink? Or, can you
backport them into the current package? Essentially, moving the
information that was previously in the symlink into the .pc file? If I
can assume the symlink exists, I will use it in mrbuild and/or the
builds of projects that use it.

But if something was confused by the symlink, would it also be confused
by the .pc file?

** Long version **

The breakage is in packages where I'm upstream. These use my build
system: mrbuild. This asks Python for its header directory:
sysconfig.get_config_var('INCLUDEPY'), and asks the compiler to look
there. Today this ends up passing

  -I/usr/include/python3.11

which would previously succesfully resolve (via the now-missing symlink)

  #include <numpy/arrayobject.h>

mrbuild very explicitly does not use setup.py or anything of that
nature. It's used for mixed-language projects, and I don't want multiple
build systems for each language that wanted to rewrite the world. Some
discussion and rationale in a blog post:

  
https://notes.secretsauce.net/notes/2017/11/14_python-extension-modules-without-setuptools-or-distutils.html

I just tried to patch mrbuild to use np.get_includes(). This works, but
it's slow. After warming up the caches, I see this:

  $ time python3 -c 'import sysconfig'
  python3 -c 'import sysconfig'  0.02s user 0.01s system 97% cpu 0.025 total

  $ time python3 -c 'import numpy'
  python3 -c 'import numpy'  0.51s user 0.67s system 634% cpu 0.185 total

Currently the Makefile launches Python and imports sysconfig, which is
relatively fast. As we can see, importing numpy also, is MUCH slower.
All I want is the include path; I shouldn't need to initialize all of
numpy to do that.


Thanks much. Hopefully we can find a nice way to satisfy everybody

Reply via email to