Up until now we created a backup of pacman.conf and restored it after
the build was done. This can leave the environment in an undefined state
if something crashes inbetween.
Instead create a temporary pacman.conf and use that during building.
In theory pacman allows setting a custom config via "--config", but
makepkg doesn't expose this, so that's not working. Luckily makepkg
allows overriding the pacman path via the PACMAN env var, so we create
a temporary script which just forwards everything to pacman and always
sets the temporary config.
They could inject commands that way. Instead assign them
to an env var and then use that env var in the powershell scripts.
We want to open those controls up to more people, so we need to make
sure they can only change the values and not extract tokens etc.
Fixes#60
instead of adding from scratch. Once the commented-out section was
added, the grep would match that and no longer run the sed to add it.
Also remove line adding clang32 section because that was added to
default pacman.conf (and was thus a no-op).
In case the job stops because it has reached the time limit it would
not update the build status and just quit. Move the timeout check
a bit later to acoid that.
Turns out disabling the cache just disables the monkey patching,
so we have to disable when creating the session object and not when
we are using the cache.
Create a session object without cache in the main thread at first,
so that the download code can re-use it as is later on.
It isn't thread safe, so wrap the outer code instead and just
assert in download_asset() that the caching is disabled so it's
not called with caching by accident.
This doesn't speed things up usually, since we still make the same amount
of requests, but it doesn't count against the rate-limit in case there
is a cache hit. Also there is a smaller chance of things going wrong,
since we don't transfer any payload.
The cache is store in a .autobuild_cache directory using a sqlite DB.
There isn't an easier way to enabled retries with requests sadly.
This also shares the session between all non-pygithub requests, so
could make things a bit faster.
before libc++ was split off from clang package, it was built after clang within the same PKGBUILD, so this order seems reasonably safe.
Also remove a couple of prior cycle breaks from before it was possible to break them manually in a run. These packages are not related by the same source repo and release, like mingw-w64 and llvm-project are, so are less likely to consistently require a cycle break on every upstream update.
It appears that powershell doesn't properly handle an empty argument, resulting in all the subsequent arguments being shifted left by one.
So, don't specify --optional-deps argument if it is empty.
This gives all cycles in the queue right now, ignoring the build
status of the packages.
If one part of the cycle is already built then it will not matter.