Skip to content
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

run_qemu.sh: print warning that --ndctl-build never worked incrementally #76

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Dec 11, 2024

The update_existing_rootfs() function is part of a hidden shortcut that does not run mkosi. It had a tentative feature that wanted to invoke rsync to update ndctl sources in the existing image. That ndctl shortcut never actually did anything!

  • Replace that broken rsync with a warning in case anyone thought this was working.
  • Do not print the warning when $ndctl is undefined or ill-defined because --ndctl-build is ON by default and $ndctl is in practice used as the actual ndctl "switch".
  1. This feature apparently never worked and always left outdated sources silently. That's because the mount point requires root access, which made the test [ -d qbuild/mnt/root/ndctl ] always return false - without any message!

  2. Even if that rsync had worked (with the appropriate "sudose"), sources would still have not been compiled; there was no attempt to compile. This would have left binaries out of date with sources inside the image, been inconsistent with building from scratch and would have been very confusing and dangerous too.

Compiling and installing requires the container/chroot which is currently available "for free" when building from scratch. But it is not straight-forward in the shortcut case.

Speaking of containers, support for mkosi v15 and above in the other, main ndctl deployment code path (from scratch or with -r img) requires container-related changes in mkosi.postinst. See v15 commit systemd/mkosi@9b626c647037bc8a). These unrelated and upcoming changes will hopefully make it easier to finally implement this feature.

The update_existing_rootfs() function is part of a hidden shortcut
that does not run mkosi. It had a tentative feature that wanted to
invoke rsync to update `ndctl` sources in the existing image. That ndctl
shortcut never actually did anything!

- Replace that broken rsync with a warning in case anyone thought this
  was working.
- Do not print the warning when `$ndctl` is undefined or ill-defined
  because --ndctl-build is ON by default and `$ndctl` is in practice used
  as the actual ndctl "switch".

1. This feature apparently _never worked_ and always left outdated
sources _silently_. That's because the mount point requires root access,
which made the `test [ -d qbuild/mnt/root/ndctl ]` always return false -
- without any message!

2. Even if that `rsync` had worked (with the appropriate "sudose"),
sources would still have not been _compiled_; there was no attempt to
compile. This would have left binaries out of date with sources inside
the image, been inconsistent with building from scratch and would have
been very confusing and dangerous too.

Compiling and installing requires the container/chroot which is
currently available "for free" when building from scratch. But it is not
straight-forward in the shortcut case.

Speaking of containers, support for mkosi v15 and above in the other,
main ndctl deployment code path (from scratch or with `-r img`) requires
container-related changes in mkosi.postinst. See v15 commit
systemd/mkosi@9b626c647037bc8a). These
unrelated and upcoming changes will hopefully make it easier to finally
implement this feature.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Dec 11, 2024

... hidden shortcut that does not run mkosi.

There are some allusions to this incremental build in the --help text but it's very indirect. People who just run the same command consecutively and don't pay attention to the logs will not notice the difference between a build from a scratch and incremental. I mean, they will see that it's much faster and that some caching is happening but mkosi does a lot of caching too, so who knows? And who cares.

Caching should be functionally the same - otherwise it's a bug. Hence the warning.

This warning would have saved my former self about 0.5 day of trial and error.

@marc-hb marc-hb marked this pull request as ready for review December 11, 2024 21:51
@stellarhopper stellarhopper merged commit 936b03c into pmem:main Dec 11, 2024
2 checks passed
@marc-hb marc-hb deleted the incr-ndctl-warn branch December 12, 2024 00:03
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