19 Commits

Author SHA1 Message Date
Christoph Reiter
05abf4e953 Assume os.path.isjunction is available
now that we depend on Python 3.12+
2025-08-26 22:05:51 +02:00
Christoph Reiter
456089ba22 Remove old compat code 2025-08-26 21:32:32 +02:00
Christoph Reiter
999e4e9327 Try to match the install paths of the packages CI more closely
Things are failing and the only difference in the logs are paths, so
try to get rid of that difference at least.
2025-05-19 09:32:07 +02:00
Christoph Reiter
a2fb8db0e7 config: add more runner specific config
instead of hardcoding them in multiple places
2025-04-16 06:34:39 +02:00
Christoph Reiter
0d471ea5b7 build: try removing junctions before calling git clean
See https://github.com/msys2/msys2-autobuild/issues/108#issuecomment-2776420879

It looks like git can under some circumstances hang forever when trying
to clean the checkout when there are junction loops. So try to remove
them manually before calling git clean.

Fixes #108
2025-04-11 14:11:50 +02:00
Christoph Reiter
e2042058f1 gh: improve repo caching
We were caching based on the build type, but for most build types the repo
is the same, so cache one level below instead.
2025-03-07 12:04:27 +01:00
Christoph Reiter
b442168127 build: delete all junctions before calling "git clean"
git clean can't deal with junctions and in case there is a loop
it follows them forever (or until stack overflow).
https://github.com/git-for-windows/git/issues/5320

To work around this try to delete all junctions in the clean
re-try code path.

Fixes #108
2025-01-31 16:01:13 +01:00
Christoph Reiter
a977f9deb9 remove leftover debug print 2025-01-11 08:58:12 +01:00
Christoph Reiter
4f60392b3e make_tree_writable: handle junctions and add tests
As found out here, os.walk() by default follows junctions, which we don't
want and can even lead to loops:
https://github.com/msys2/msys2-autobuild/issues/101#issuecomment-2583121845

Integrate the workaround mentioned in the CPython bug report:
https://github.com/python/cpython/issues/67596#issuecomment-1918112817
Since this is Python 3.12+ only and we still support 3.10 make
it optional though.

This also adds tests, which uncovered some other minor issues:
It was not chmoding top-down, which meant that os.walk would
skip things if there were no read permissions. So chmod before
os.walk() lists the dir.
2025-01-10 21:32:14 +01:00
Christoph Reiter
1a8a881082 build: try to make all files writable if git clean fails
I'm again not sure if this helps, but let's see..
2023-04-13 18:03:47 +02:00
Christoph Reiter
76a815c145 build: enable core.longpaths for the git repo
so "git clean" can potentially remove overly long paths created
during build time.
2023-04-07 19:12:47 +02:00
Christoph Reiter
236220ef8e typo 2023-04-07 10:43:40 +02:00
Christoph Reiter
60a287290d build: try to run git clean multiple times before giving up
For example it failed with:

warning: failed to remove B/mingw-w64-clang-i686-seacas-2023.02.03-2-any.pkg.tar.zst: Invalid argument

We now always use the same build directory, so if files can't be removed
we fail. Retry git clean/reset a few times before giving up and also
try before we start so in case it is fixed while the job isn't running on
a self-hosted runner we can continue automatically.
2023-04-07 10:41:49 +02:00
Christoph Reiter
cc301e1e62 build: shorter build paths
see https://github.com/msys2/msys2-autobuild/issues/71
2023-04-06 08:53:11 +02:00
Christoph Reiter
e3bb36afac more type annotations 2023-03-24 14:09:24 +01:00
Christoph Reiter
b453032363 Get rid of MAIN_REPO
in most cases at least. either derive from the current
build type, or via get_current_repo() which reads the
GITHUB_REPOSITORY env var.
2023-03-23 11:58:17 +01:00
Christoph Reiter
88871c4cb0 Rename _PathLike to PathLike
it's no longer internal
2023-03-23 11:17:10 +01:00
Christoph Reiter
ad34ca14b6 Move some hard coded IDs to the config 2023-03-23 11:17:10 +01:00
Christoph Reiter
87f0603c87 Split the code up into separate modules
with minimal code changes
2023-03-22 09:59:05 +01:00