Flatpak build directory should detect if directory is already being used for something else
I had a _build
directory in my checkout directory that was already configured for a non-Flatpak build. I'm trying to develop a Flatpak manifest for the project so that it can build out of the box on Builder. When building the Flatpak manifest, it seems to build in _build
by default. This is the command that's issued:
flatpak build --env=LANG=en_CA.UTF-8 --env=USER=ptomato --env=HOME=/var/home/ptomato --env=PATH=/usr/bin:/bin --env=TERM=xterm-256color --env=V=0 --env=CCACHE_DIR=/var/home/ptomato/.var/app/org.gnome.Builder/cache/gnome-builder/flatpak-builder/ccache --env=PATH=/app/bin:/usr/bin --build-dir=/var/home/ptomato/workspace/gjs/_build --share=network --nofilesystem=host --filesystem=/var/home/ptomato/.var/app/org.gnome.Builder/cache/gnome-builder --filesystem=/var/home/ptomato/workspace/gjs --filesystem=/var/home/ptomato/workspace/gjs/_build --env=NOCONFIGURE=1 /var/home/ptomato/.var/app/org.gnome.Builder/cache/gnome-builder/projects/gjs/flatpak/staging/x86_64-develop ninja
In this case, the build errored because the _build
directory was already configured for a toolbox
build. It would be good if Builder would either ask to wipe the _build
directory before building if it was already used for something else, or pick another name if _build
was in use (e.g. _build1
), or allow the user to configure the name themselves.
Additionally, when I wiped _build
myself, I still couldn't get the build to work, because Builder didn't detect that it had to go back to the meson
configure stage, and kept trying to run ninja
in a now-non-existent directory. I had to close Builder and wipe ~/.var/app/org.gnome.Builder
to get that unstuck.