Skip to content

Add a quick build mode for fast development builds#258

Merged
knuton merged 3 commits intodividat:mainfrom
yfyf:quick-build-mode
Dec 3, 2025
Merged

Add a quick build mode for fast development builds#258
knuton merged 3 commits intodividat:mainfrom
yfyf:quick-build-mode

Conversation

@yfyf
Copy link
Copy Markdown
Collaborator

@yfyf yfyf commented Oct 14, 2025

Triggered by the very slow live ISO builds while testing the remote control on the PlayOS PC.

Switching to lz4 compression makes building of installer and live ISOs 2-4x faster.

squashfs compression is a low-level aspect that can only affect booting, but is otherwise irrelevant for dev builds. This makes the iteration loop much quicker.

Benchmarks:

Live

~364% faster with lz4

Quick

time QUICK_BUILD=1 nix-build --arg buildVm false --arg buildInstaller false --arg buildBundle false \
    --arg buildLive true --arg buildDisk false --arg versionOverride '"2025.3.1-live-quick1"'

building '/nix/store/xy8m3mds8yaxsr43qlxrbbh97hwf8vsf-playos-2025.3.1-live-quick1.drv'...
/nix/store/al4f3pdzwxsx64gkv9g7cwaq3pcnx1fn-playos-2025.3.1-live-quick1

real    1m23.322s
user    0m11.132s
sys     0m0.585s

Regular

time nix-build --arg buildVm false --arg buildInstaller false --arg buildBundle false \ 
    --arg buildLive true --arg buildDisk false --arg versionOverride '"2025.3.1-live-slow1"'


building '/nix/store/12apqrwn1ij8nky4ygikpi06ljdilcwv-playos-2025.3.1-live-slow1.drv'...
/nix/store/f1vry1hxnbwi4ra9vfh4k36sgjwg29w4-playos-2025.3.1-live-slow1

real    5m20.110s
user    0m11.151s
sys     0m0.635s

Installer

~251% faster with lz4

Quick

time QUICK_BUILD=1 nix-build --arg buildVm false --arg buildInstaller true --arg buildBundle false \
    --arg buildLive false --arg buildDisk false --arg versionOverride '"2025.3.1-installer-quick1"'


building '/nix/store/jbv09mbdmhnm9zk7yvlzfxh2irb3fr4d-playos-2025.3.1-installer-quick1.drv'...
/nix/store/wp6x3wfq2f2g2pw8jpw25knhif668p0n-playos-2025.3.1-installer-quick1

real    2m20.440s
user    0m14.893s
sys     0m0.695s

Regular

time nix-build --arg buildVm false --arg buildInstaller true --arg buildBundle false \
    --arg buildLive false --arg buildDisk false --arg versionOverride '"2025.3.1-installerslow1"' --show-trace


building '/nix/store/633zh44a80x2c77g1y5s1k339crycf72-playos-2025.3.1-installerslow1.drv'...
/nix/store/1kbg3fnzngacan7c5z8qiyzsjcayw451-playos-2025.3.1-installerslow1

real    5m51.535s
user    0m15.066s
sys     0m0.790s

Checklist

  • Changelog updated
  • Code documented
  • User manual updated

@yfyf yfyf requested a review from knuton October 14, 2025 09:03
@yfyf yfyf added the reviewable Ready for initial or iterative review label Oct 14, 2025
Copy link
Copy Markdown
Member

@knuton knuton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Two small suggestions

Comment on lines +41 to +42
bootstrap.lib.warn "QUICK BUILD MODE enabled!"
"lz4"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do something like fail if quickBuild is set, but updateUrl is not the dummy default value?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I would say no, it is useful in situations where you want to test updates? The only thing I would do is to consider the "official" targets like ./build validation or ./build master to abort if QUICK_BUILD is set.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fine

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented the restriction in a79134e

yfyf and others added 3 commits October 15, 2025 14:32
Switching to lz4 compression makes building of installer and live ISOs
2-4x faster.

squashfs compression is a low-level aspect that can only affect booting,
but is otherwise irrelevant for dev builds. This makes the iteration
loop much quicker.
Co-authored-by: Johannes Emerich <johannes@emerich.de>
@yfyf yfyf force-pushed the quick-build-mode branch from 7b80964 to a79134e Compare October 15, 2025 11:33
@yfyf
Copy link
Copy Markdown
Collaborator Author

yfyf commented Oct 15, 2025

There are really strange E2E test failure due to... this:

  playos # [   14.217674] xsession[1473]: Traceback (most recent call last):
  playos # [   14.220751] xsession[1473]:   File "/nix/store/z42d2zkscmgy9qlfffv3iigvvw41x6hr-playos_kiosk_browser-0.1.0/bin/...kiosk-browser-wrapped-wrapped-wrapped", line 7, in <module>
  playos # [   14.228387] xsession[1473]:     import kiosk_browser
  playos # [   14.231277] xsession[1473]:   File "/nix/store/z42d2zkscmgy9qlfffv3iigvvw41x6hr-playos_kiosk_browser-0.1.0/lib/python3.12/site-packages/kiosk_browser/__init__.py", line 9, in <module>
  playos # [   14.237687] xsession[1473]:     from kiosk_browser import main_widget
  playos # [   14.240862] xsession[1473]:   File "/nix/store/z42d2zkscmgy9qlfffv3iigvvw41x6hr-playos_kiosk_browser-0.1.0/lib/python3.12/site-packages/kiosk_browser/main_widget.py", line 9, in <module>
  playos # [   14.247240] xsession[1473]:     from kiosk_browser import browser_widget, captive_portal, dialogable_widget, proxy as proxy_module
  playos # [   14.251825] xsession[1473]:   File "/nix/store/z42d2zkscmgy9qlfffv3iigvvw41x6hr-playos_kiosk_browser-0.1.0/lib/python3.12/site-packages/kiosk_browser/browser_widget.py", line 1, in <module>
  playos # [   14.259305] xsession[1473]:     from PyQt6 import QtCore, QtWidgets, QtWebEngineWidgets, QtWebEngineCore, QtGui, QtSvgWidgets
  playos # [   14.265379] xsession[1473]: ImportError: libQt6WebEngineWidgets.so.6: cannot open shared object file: No such file or directory

Edit: the container runs out of memory while installing:

2025-10-15T11:40:24.1065363Z tar: Removing leading `/' from member names
2025-10-15T11:40:24.1113516Z tar: Removing leading `/' from hard link targets
2025-10-15T11:41:14.8917469Z tar: /nix/store/iwzz3by31rh9gy0vjknwg196w44icmba-qtwebengine-6.8.1/lib/: Cannot savedir: Cannot allocate memory
2025-10-15T11:42:28.2538953Z tar: 3.16GiB 0:02:04 [26.0MiB/s] [                       <=>                        ]Exiting with failure status due to previous errors
2025-10-15T11:42:28.2539384Z 
2025-10-15T11:42:28.8328453Z '/nix/store/kgixlj6bi484fvrkca8z13am94sxhkxw-nixos-system-playos-playos-2025.3.1-TEST/kernel' -> '/mnt/system/kernel'
2025-10-15T11:42:28.8459052Z '/nix/store/kgixlj6bi484fvrkca8z13am94sxhkxw-nixos-system-playos-playos-2025.3.1-TEST/initrd' -> '/mnt/system/initrd'
2025-10-15T11:42:28.8607061Z '/nix/store/kgixlj6bi484fvrkca8z13am94sxhkxw-nixos-system-playos-playos-2025.3.1-TEST/init' -> '/mnt/system/init'
2025-10-15T11:42:29.2276804Z mke2fs 1.47.1 (20-May-2024)

The strange thing is that it still continues despite the error. Will look into it.

yfyf added a commit to yfyf/playos that referenced this pull request Oct 15, 2025
Issue was discovered in CI, when the `tar cf` process died prematurely
(most likely due to OOM?), but the installation completed successfully
anyway:

    2025-10-15T11:41:14.8917469Z tar: /nix/store/iwzz3by31rh9gy0vjknwg196w44icmba-qtwebengine-6.8.1/lib/: Cannot savedir: Cannot allocate memory
    2025-10-15T11:42:28.2538953Z tar: 3.16GiB 0:02:04 [26.0MiB/s] [                       <=>                        ]Exiting with failure status due to previous errors
    2025-10-15T11:42:28.2539384Z
    2025-10-15T11:42:28.8328453Z '/nix/store/kgixlj6bi484fvrkca8z13am94sxhkxw-nixos-system-playos-playos-2025.3.1-TEST/kernel' -> '/mnt/system/kernel'

(from dividat#258 (comment))

Note that it says "Exiting with failure", yet the installation
continues.
@knuton
Copy link
Copy Markdown
Member

knuton commented Nov 4, 2025

Is this reviewable or in need of further work?

@knuton knuton added details needed Further information requested to better evaluate changes and removed reviewable Ready for initial or iterative review labels Nov 4, 2025
@yfyf
Copy link
Copy Markdown
Collaborator Author

yfyf commented Nov 4, 2025

Is this reviewable or in need of further work?

It is reviewable, I believe the E2E test failure was unrelated and due to the CI VM running out of memory.

@knuton knuton added reviewable Ready for initial or iterative review and removed details needed Further information requested to better evaluate changes labels Nov 4, 2025
@knuton knuton merged commit ce8c88f into dividat:main Dec 3, 2025
49 of 50 checks passed
@knuton knuton removed the reviewable Ready for initial or iterative review label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants