19 Oct 2024 |
Artturin | Run it on native and cross | 05:00:48 |
Artturin | And leave everything else as is and hope np one ever uses the file | 05:01:01 |
jackwilsdon | postInstall = ''
nuke-refs \
$out/${python.sitePackages}/contourpy/util/__pycache__/_build_config.* \
$out/${python.sitePackages}/contourpy/util/_build_config.py
'';
Had to remove the references from the compiled cache files too but this looks good.
| 05:11:26 |
Artturin | The cache files probably arent for the right system | 05:13:40 |
Artturin | And non-reproducible so they're usually removed | 05:14:00 |
jackwilsdon | Ah right, I couldn't find many examples of them being removed but I'll do that | 05:14:11 |
jackwilsdon | There's 1 or 2 but I guess it only applies for packages where the code has been run during build | 05:14:31 |
jackwilsdon | postInstall = ''
find $out/${python.sitePackages}/contourpy -name __pycache__ -type d -exec rm -rf {} +
nuke-refs $out/${python.sitePackages}/contourpy/util/_build_config.py
'';
| 05:14:56 |
jackwilsdon | I'll open a PR with this I guess 😁 | 05:15:04 |
Artturin | In reply to @jackwilsdon:matrix.org Ah right, I couldn't find many examples of them being removed but I'll do that They should be removed automatically in postFixup https://github.com/NixOS/nixpkgs/blob/7cf7ffbdc3348f7b0a9309805a180f812f3ab220/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh#L41 | 05:19:46 |
jackwilsdon | Hmm interesting, they were definitely in the resulting derivation. Will see if I can find out why. | 05:20:05 |
Artturin | NIX_DEBUG = 7 | 05:20:43 |
Artturin | In reply to @artturin:matrix.org They should be removed automatically in postFixup https://github.com/NixOS/nixpkgs/blob/7cf7ffbdc3348f7b0a9309805a180f812f3ab220/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh#L41 Nvm this namespaces thing is something different https://github.com/search?q=repo%3ANixOS%2Fnixpkgs%20pythonNamespaces&type=code | 05:22:10 |
jackwilsdon | Ah | 05:23:04 |
Artturin | PYTHONDONTWRITEBYTECODE will make python not write it | 05:28:21 |
jackwilsdon | Oh nice. I'll set that on the derivation itself I guess. | 05:29:37 |
Artturin | Do it on cross, seems it's not common to remove them on native | 05:30:36 |
Artturin | Improves performance | 05:30:41 |
jackwilsdon | Hmm, setting PYTHONDONTWRITEBYTECODE = "1"; in the derivation doesn't actually get rid of them. | 05:34:53 |
Artturin | Ok I guess just remive them | 05:36:22 |
Artturin | * Ok I guess just remove them | 05:36:38 |
| jwillikers joined the room. | 12:06:37 |
Artturin | jackwilsdon: Worked? | 19:21:44 |
Artturin | * jackwilsdon: Did you get it to work? | 19:22:16 |
Artturin | When you make your PR you can add Supersedes https://github.com/NixOS/nixpkgs/pull/328218 | 19:22:39 |
jackwilsdon | In reply to @artturin:matrix.org jackwilsdon: Did you get it to work? It builds fine but haven't had the chance to properly test it yet | 19:36:13 |
jackwilsdon | In reply to @artturin:matrix.org When you make your PR you can add Supersedes https://github.com/NixOS/nixpkgs/pull/328218 I didn't even realize someone else had opened a PR. I guess using nuke-refs is preferred over the solution in that PR? | 19:37:11 |
Artturin | yes | 19:38:38 |
Artturin | * yes in this context | 19:39:27 |
20 Oct 2024 |
Jared Baur | fix for linux-firmware when doing cross: https://github.com/NixOS/nixpkgs/pull/349895 | 01:57:37 |