-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide development environment via nix
#2274
Conversation
Use nix run .#services to start postgres and redis and in another terminal run nix develop ./manage.py migrate ./manage.py run This doesn't compile scss yet, but the basic website shows up.
78fb189
to
7f2552b
Compare
c283b55
to
7eb4735
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me. Will re-test setup on Windows and Ubuntu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
wsl --install -d Ubuntu-24.04
on a WSL-disabled Windows with the Image uninstalled from the App store (~= fresh installation) downloads the distro image, but doesn't register/initialize it. It has to be run again after reboot- It will just register Ubuntu-24.04 after the reboot and immediately run it, so it seems acceptable
- Proposal: Extend readme comment:
(you may have to restart your computer, and you may need to re-run the command afterwards if you get an error)
-
wsl
will open a shell in the current directory, which might be mounted ntfsrun .#services(-full)
will then exit immediately upon (quiet) failure about unix sockets.- Proposal: Add a comment to the readme:
**Windows users**: Make sure you are not in the mounted NTFS filesystem when cloning.
-
in wsl, on non-mounted directory, compilemessages still errors about msgfmt missing
- looks to me as if the
gettext
package is a dependency for the shell, but not for the services - @niklasmohrin can you fix this?
- looks to me as if the
-
On laptop (slow, but not as slow as some surface tablets we will see),
nix develop
took >13min, mostly in tests.- same laptop: docker vagrant provisioning passed in 5m21, so almost a 3x slowdown for dev-setup
- especially python3.10-cherrypy-18.10.0 seems to take very long, some tests seem to be stuck on timers/mutexes/without cpu utilization?
- Ryzen Octacore still takes 6m49
- I think this was faster the last time I tested it? Don't know what happened. In any case, disabling the tests would be hugely beneficial, I think. Can we somehow get official cached populated for these pyton dependencies with python3.10?
-
running services with
--detached
can, on error, just appear as "stuck without message" or even "succeeded" (observed: wsl socket error, gettext error, when retrying: localsettings.py already existed). It's not intuitive to debug. I'm sorry for bringing this up again, but I'd vote to just runnix run .#services-full
in foreground.
Apart from these, everything seems to work.
While `poetry2nix` adds an overlay on the Python package set that disables running the tests, this was not true for the additional poetry from nixpkgs directly. With the override, this poetry had to be rebuilt and thus the tests ran again.
This should fix msgfmt errors for `./manage.py compilemessages`.
966b8b3
to
5deb2b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)
Happened again on main with seed 7524442357. This time though, it also happens locally! |
This is a working version for #2191. We use
poetry
andpoetry2nix
for Python dependencies. For nodejs, we (for now) just install node through nix and then usenpm ci
as before. Leftover tasks / questions:edit: Now we just recommend podman instead of WSLwe should check the Podman example setup on different platformsshould we recommend https://github.com/nix-community/NixOS-WSL instead of using Ubuntu WSL with nix? I think that if people set up their first WSL box, they won't be happy to fight with NixOS later;edit: We decided: No