-
Notifications
You must be signed in to change notification settings - Fork 17
OOM error during simulator nix environment build #86
Description
Hello,
I'm trying to follow the instructions here to setup the simulator on my M1 macbook air.
I was able to setup nix and use xmake to build all the examples just fine in the getting started guide. However, when I run nix develop .#env-with-sim I get what seems like a strange error:
error: Cannot build '/nix/store/b1p5lrl5wghhdjzkf70q9j2f22gr2hrl-python3.10-certifi-2024.02.02.drv'.
Reason: builder failed with exit code 2.
Output paths:
/nix/store/fph6dwdp99jivymjmk9ji6xs6wmp3vdr-python3.10-certifi-2024.02.02
/nix/store/i9ra56xc63bsaf67vdhg32kycwxxxp6i-python3.10-certifi-2024.02.02-dist
Last 22 log lines:
> Sourcing python-remove-tests-dir-hook
> Sourcing python-catch-conflicts-hook.sh
> Sourcing python-remove-bin-bytecode-hook.sh
> Sourcing pypa-build-hook
> Using pypaBuildPhase
> Sourcing python-runtime-deps-check-hook
> Using pythonRuntimeDepsCheckHook
> Sourcing pypa-install-hook
> Using pypaInstallPhase
> Sourcing python-imports-check-hook.sh
> Using pythonImportsCheckPhase
> Sourcing python-namespaces-hook
> Sourcing python-catch-conflicts-hook.sh
> Sourcing pytest-check-hook
> Using pytestCheckPhase
> Running phase: unpackPhase
> unpacking source archive /nix/store/j9qr22pj9i0fmzfnvb18p8a487gayvgl-source
> source root is source
> setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/strip-non-ascii
> Running phase: patchPhase
> applying patch /nix/store/z745d6wsdh21mjp8i0sxjlzmkhkbzw7g-env.patch
> patch: **** out of memory
For full logs, run:
nix log /nix/store/b1p5lrl5wghhdjzkf70q9j2f22gr2hrl-python3.10-certifi-2024.02.02.drv
error: Cannot build '/nix/store/66f9k0hxx6kvwncby5xmvlvks3811cn2-python3.10-requests-2.31.0.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/qpspzkgllym5xkjs22r1ah6ayjfq78f6-python3.10-requests-2.31.0
/nix/store/yh8mzsk5zncswlck5kxkmjd332009vmg-python3.10-requests-2.31.0-dist
error: Build failed due to failed dependency
error: Cannot build '/nix/store/i9hv58zb1l66swpaxx6qz379s91y8ndx-python3.10-sphinx-7.3.7.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/88pydbx6cc95dw7c6mv9lfkvlpa6qd1i-python3.10-sphinx-7.3.7-dist
/nix/store/vkc62x3i47vawq6shzlgyk9pzk0lp6pg-python3.10-sphinx-7.3.7
error: Build failed due to failed dependency
<SNIP: many more things fail due to the failed dependencies>
error: Cannot build '/nix/store/8flprzw4zm86gj8nqza0ad07cy31yrkj-sonata-simulator.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/djvankmb6isg5dr0rcfw7xcw8ys0x241-sonata-simulator
error: Build failed due to failed dependency
error: Cannot build '/nix/store/8zqcimlb67qkwmv8yr2hz520072pyp8d-sonata-sw-with-sim-env.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/cd1wsrqf59h562payf76r3nhqq3019q8-sonata-sw-with-sim-env
error: Build failed due to failed dependency
I'm very new to nix but my understanding is that the simulator requires this python module which won't build on my system for some reason. Since that fails to build, everything else fails as well.
One strange thing is that that patch is quite small and doesn't seem be doing anything complicated:
$ cat /nix/store/z745d6wsdh21mjp8i0sxjlzmkhkbzw7g-env.patch | wc -l
87FWIW I am able to manually patch the file okay:
➜ sonata-software git:(v1.1) cd /nix/store/j9qr22pj9i0fmzfnvb18p8a487gayvgl-source
➜ j9qr22pj9i0fmzfnvb18p8a487gayvgl-source patch < /nix/store/z745d6wsdh21mjp8i0sxjlzmkhkbzw7g-env.patch
patching file 'certifi/core.py'
Can't create '/var/folders/b9/qq2qsk8x2q707kcn3zxmpjgh0000gn/T/patchogtpJtOs9ZT', output is in '/var/folders/b9/qq2qsk8x2q707kcn3zxmpjgh0000gn/T/patchogtpJtOs9ZT': Permission denied
➜ j9qr22pj9i0fmzfnvb18p8a487gayvgl-source sudo patch < /nix/store/z745d6wsdh21mjp8i0sxjlzmkhkbzw7g-env.patch
Password:
patching file 'certifi/core.py'
➜ sonata-software git:(v1.1)I searched online for this issue but I'm not really sure what the problem is; is it a problem with the package I'm trying to build or nix itself on my machine?. Maybe the package (python3.10-certifi-2024.02.02) could be replaced with a newer one but I'm not sure that's really the culprit.
I realize there is a good chance this is a problem with nix and/or nix + my computer (the nix installer for macOS seems a lot more convoluted than on linux) but I thought I would raise the ticket to alert the project that these instructions do not seem to work for me, and potentially other mac users.
Anyway, sorry to bug you with this!