Timo Röhling
2025-02-20 09:10:01 UTC
Hello,
I have run into an unexpected quirk of dpkg (I think) and would like
to solicit some advice on how to handle it.
For better cross building/multi-arch support, I recently moved a
bunch of files from python3-numpy to python3-numpy-dev. More
precisely, I moved
/usr/lib/python3/dist-packages/numpy/_core/include
/usr/lib/python3/dist-packages/numpy/_core/lib
/usr/lib/python3/dist-packages/numpy/random/lib
/usr/lib/python3/dist-packages/numpy/f2py/src
to an arch-dependent location and replaced them with symlinks. The
symlinks are intended to retain directory layout compatibility with
upstream, so anyone how does not care about cross building is not
inconvenienced by my create shuffling.
This worked great for the former two directories, but the latter two
are left as empty real directories, not symlinks, after an upgrade.
I assume it is because the _core directory is new in NumPy 2, so
dpkg can just create the symlinks at unpack time. The latter two
directories need to be transitioned from a real directory in NumPy 1
to a symlink during the package upgrade. Apparently this step fails,
leaving an empty directory instead.
The question is, how do I fix this? I could add some code to
postinst to check if there is an empty directory where a symlink
should be. Is this a reasonable approach?
Cheers
Timo
I have run into an unexpected quirk of dpkg (I think) and would like
to solicit some advice on how to handle it.
For better cross building/multi-arch support, I recently moved a
bunch of files from python3-numpy to python3-numpy-dev. More
precisely, I moved
/usr/lib/python3/dist-packages/numpy/_core/include
/usr/lib/python3/dist-packages/numpy/_core/lib
/usr/lib/python3/dist-packages/numpy/random/lib
/usr/lib/python3/dist-packages/numpy/f2py/src
to an arch-dependent location and replaced them with symlinks. The
symlinks are intended to retain directory layout compatibility with
upstream, so anyone how does not care about cross building is not
inconvenienced by my create shuffling.
This worked great for the former two directories, but the latter two
are left as empty real directories, not symlinks, after an upgrade.
I assume it is because the _core directory is new in NumPy 2, so
dpkg can just create the symlinks at unpack time. The latter two
directories need to be transitioned from a real directory in NumPy 1
to a symlink during the package upgrade. Apparently this step fails,
leaving an empty directory instead.
The question is, how do I fix this? I could add some code to
postinst to check if there is an empty directory where a symlink
should be. Is this a reasonable approach?
Cheers
Timo
--
â¢â£Žâ Ÿâ »â¢¶â£Šâ ââââââââââââââââââââââââââââââââââââââââââââââââââââââ®
⣟â ⢠â â ⣿⡠â Timo Röhling â
⢿â¡â â ·â â â â 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA â
â â ³â£â â â â â°âââââââââââââââââââââââââââââââââââââââââââââââââââââ¯
â¢â£Žâ Ÿâ »â¢¶â£Šâ ââââââââââââââââââââââââââââââââââââââââââââââââââââââ®
⣟â ⢠â â ⣿⡠â Timo Röhling â
⢿â¡â â ·â â â â 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA â
â â ³â£â â â â â°âââââââââââââââââââââââââââââââââââââââââââââââââââââ¯