19 Oct 2024 |
Artturin | That's a meson config file added by mkDerivation | 04:33:23 |
Artturin | Why does it depend on that | 04:33:29 |
Artturin | nix why-depends | 04:33:55 |
jackwilsdon | 😒
lib/python3.12/site-packages/contourpy/util/_build_config.py: build_options=r"-Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dvsenv=True --cross-file=/nix/store/iv4iygkdy52b8vawy0b5aqxi7lpk7afy-cross-file.conf --native-file=/build/source/.mesonpy-uct67tqu/meson-python-native-file.ini
| 04:34:17 |
jackwilsdon | This _build_config.py is awful | 04:34:26 |
Artturin | Wtf | 04:34:30 |
Artturin | Gist the whole thing | 04:35:01 |
jackwilsdon | https://gist.github.com/jackwilsdon/562ea1baea28c1e5c915f09c8f4307e3 | 04:35:59 |
jackwilsdon | No idea where it gets that install dir from, it seems like it's something provided by meson-python | 04:36:14 |
jackwilsdon | It's that for the non-cross-compiled version too so 🤷 | 04:36:58 |
jackwilsdon | I think I might do a substituteInFile on this to disable some of the conf_data.set calls: https://github.com/contourpy/contourpy/blob/27160ab9a3f2d32f8d6b1990ae2919475c322283/lib/contourpy/util/meson.build#L20 | 04:38:44 |
jackwilsdon | Primarily the python path and build arg ones | 04:38:52 |
Artturin | Does anything in the output even depend on that | 04:38:58 |
jackwilsdon | Unit tests and it's re-exported from the library to its public interface, but other than that no https://github.com/contourpy/contourpy/blob/27160ab9a3f2d32f8d6b1990ae2919475c322283/lib/contourpy/util/__init__.py#L5 | 04:39:41 |
jackwilsdon | Whether any consumers of this package actually pull it in is another matter 😛 | 04:40:35 |
Artturin | Try the github search? | 04:41:51 |
jackwilsdon | https://github.com/search?q=%2Fcontourpy.*build_config%2F+language%3APython+-path%3Acontourpy%2Futil%2F__init__.py&type=code | 04:41:55 |
jackwilsdon | I think that's the right search, doesn't find anything though | 04:42:02 |
jackwilsdon | And nobody really seems to import contourpy.util to then call build_config on it later: https://github.com/search?q=%2Fimport+contourpy.util%2F+language%3APython+-path%3Acontourpy%2Futil%2F__init__.py&type=code | 04:42:59 |
jackwilsdon | I don't mind just setting the build arguments to "<omitted>" in a postPatch stage, I can set python path fine | 04:43:25 |
jackwilsdon | Still a bit nasty but it'll be as close to "original" as possible without lots of messing | 04:43:42 |
Artturin | Stub the thing and make it error if imported/used if possible | 04:48:04 |
Artturin | And remove the file | 04:48:09 |
jackwilsdon | It's a function so I can just replace it with a version that raises an exception I guess | 04:48:21 |
jackwilsdon | I guess we'll need a patch for that 😕 | 04:48:43 |
Artturin | https://github.com/contourpy/contourpy/pull/227 | 04:55:19 |
Artturin | They refer to scipy | 04:55:24 |
Artturin | https://github.com/NixOS/nixpkgs/blob/7e2eb4642f7ca9c4ee2c069d65a48575068b4f57/pkgs/development/python-modules/scipy/default.nix#L196 | 04:55:35 |
Artturin | It removes store paths https://github.com/NixOS/nixpkgs/blob/7e2eb4642f7ca9c4ee2c069d65a48575068b4f57/pkgs/build-support/nuke-references/nuke-refs.sh#L4 | 04:56:52 |
jackwilsdon | Not seen nuke-refs, but that sounds like what I want I guess! | 04:57:01 |