Each week so far it takes me over 1.5 hours to bring my dev environment up to date after updating the plutus-pioneer-program and plutus-app repos. This is really painful.
I'm wondering if someone can show me how to improve this startup time - possibly avoid unneeded steps, suggest some optimization settings (if any exist)...
I've listed my environment update process below. Any advice on how to streamline this and reduce my startup time would be much appreciated. Note I'm running on Intel Mac (BigSur), I'm in Cohort 3, I'm new to nix and cabal and for the first two weeks I had trouble getting the playground up reliably so after much experimenting I'm down to the following process that seems to work, but it takes a long time!
Summary of steps I need to do each week:
- open a terminal and run from my PPP code directory:
cd plutus-pioneers-program git pull origin plutus-pioneers-program // gets main branch
- look inside code/weekxx/cabal.project and find latest plutus-app commit branch -> say ABCDEF
- cd to plutus-app directory and do the following
a) git pull origin plutus-apps // gets main branch b) git checkout ABCDEF // to align plutus-apps code with this week's ppp commit c) nix-build -A plutus-playground.client d) nix-build -A plutus-playground.server e) nix-build -A plutus-playground.generate-purescript f) nix-build -A plutus-playground.start-backend
Generally these first steps are reasonably fast although sometimes the nix-builds can take up to 5 min each.
- Then I run
nix-shell -v // -v gives verbose output... nice to watch that it is doing something
this can take a long time each week: 30-60 min
- within the shell I run
cd ../plutus-playground-client plutus-playground-generate-purs // this can take a while GC_DONT_GC=1 plutus-playground-server // start server
- open a new terminal/tab at plutus-app root and run
nix-shell -v // again
generally the second nix shell is faster - completing in 5-10 minutes.
- within this shell
cd ../plutus-playground-client GC_DONT_GC=1 npm start // to start the playground ui
- open a 3rd terminal/tab at plutus-app root and run
nix-shell -v // again for cabal repl
similar startup time to 2nd shell
- within this 3rd shell access cabal repl with
cd ppproot/plutus-pioneers-program/code/weekxx // where xx is week # like 03 cabal repl
this takes another 30 minutes to load/build all the dependencies. Do I really need them all?
At this point I finally have a stable playground to use !!
- sometimes I also open another nix-shell and boot up the doc server if I need that.