#591 local builds: confusion when rebuilding a tag
Opened 6 years ago by otaylor. Modified 5 years ago

When you try to rebuild the same commit in version control with 'mbs-build local', things can go pretty wrong, due to the combination of the following:

  • The tag name is the same, so the same directory in ~/modulebuild/builds/ is used
  • The old directory is not removed, but instead the code effectively does:
    rm <tagname>/results/*.rpm
    rm <tagname>/results/repodata/repomd.xml
    rm <tagname>/config/*
    (MockModuleBuilder.__init__)
  • When createrepo_c is called during the build process, it finds a random mix of rpms directly in <tagname>/results, and rpms in <tagname>/results/Thread-<N>/ (temporary location which is eventually copied - not moved - to the main directory)
  • The <tagname>/results/Thread-<N> directories are only cleaned up when a new thread with the same <N> is created, at which point the code does rm <tagname>/results/Thread-<N>/* (MockModuleBuilder.build)

So createrepo_c during the rebuild finds some random selection of rpms from the last build in <tagname>/results/Thread-<N> directories, which may then be deleted while builds that use the repodata are running.

It seems to me that three things should be done:

  • When reusing the same build directory, the old directory should simply be deleted with all contents. I see no virtue in having a build directory which has a mix of old and new log files. Possibly one old build directory could be saved verbatim as builds/<tagname>.old/, but I'm not sure this is useful.

  • createrepo_c needs to be run only on the rpms directly in <tagname>/results. I think this means creating a temporary package list to pass to createrepo_c --pkglist

  • It probably would be better to move, not copy, the files from the thread results directory to the main results directory to save IO and disk space.


@otaylor, are the issues outlined here still a problem?

flatpak-module-tools always uses a new version ,and hence a new build directory, so we're not hitting these issues, but I don't know of any fixes - I suspect they still happen.

Login to comment on this ticket.

Metadata