Skip to content

Conversation

@2bndy5
Copy link
Contributor

@2bndy5 2bndy5 commented Dec 2, 2025

The macos-13 (GitHub-hosted) runner will be unavailable by Dec 4 2025. See the GitHub notice.

Apparently, Apple has deprecated support for Intel-based x86_64 architecture. This means building a universal wheel will no longer be useful.

This patch builds a separate wheel for x86_64 and arm64 architectures. Doing this also allows cibuildwheel to properly test each architecture individually. Whereas before, there were warnings about tests not getting run for arm64 on a x86_64 runner.

Warning

Beware, the github-hosted macos-15-intel runner is provided to sunset x86_64 MacOS runners.
The macos-15-intel runner will become unavailable in August 2027.
Afterward, the CI will only be able to compile arm64 wheels for MacOS.

The `macos-13` (GitHub-hosted) runner will be unavailable by Dec 4 2025.
See the [GitHub notice].

Apparently, Apple has deprecated support for Intel-based x86_64 architecture.
This means building a universal wheel will no longer be useful.

This patch builds a separate wheel for x86_64 and arm64 architectures.
Doing this also allows `cibuildwheel` to properly test each architecture individually.
Whereas before, there were warnings about tests not getting run for arm64 on a x86_64 runner.

> [!WARNING]
> Beware, the github-hosted `macos-15-intel` runner is provided to sunset x86_64 MacOS runners.
> The `macos-15-intel` runner will become unavailable in August 2027.
> Afterward, the CI will only be able to compile arm64 wheels for MacOS.

[GitHub notice]: actions/runner-images#13046
@2bndy5
Copy link
Contributor Author

2bndy5 commented Dec 3, 2025

All tests fail on MacOS arm64 runner with the following error:

    @pytest.fixture(scope='session', autouse=True)
    def global_git_config() -> None:
        # Do not use global config for better test reproducibility.
        # https://github.com/libgit2/pygit2/issues/989
        levels = [
            pygit2.enums.ConfigLevel.GLOBAL,
            pygit2.enums.ConfigLevel.XDG,
            pygit2.enums.ConfigLevel.SYSTEM,
        ]
        for level in levels:
>           pygit2.settings.search_path[level] = ''
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

test/conftest.py:22: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../venv-test-arm64/lib/pypy3.11/site-packages/pygit2/settings.py:45: in __setitem__
    option(Option.SET_SEARCH_PATH, key, value)
../venv-test-arm64/lib/pypy3.11/site-packages/pygit2/options.py:373: in option
    check_error(err)

I'm still not sure what this means or how to fix it. I think libgit2 is trying to say that it can't find git config locations.

Note, it only happens when running tests on the pypy11 wheel. Tests run on the CPy wheels pass as expected.

@2bndy5
Copy link
Contributor Author

2bndy5 commented Dec 4, 2025

As far as I can tell, this "invalid config path selector" error seems to be specific to pygit2 on pypy11. It seems that the int(level) passed to git_libgit2_opts()

pygit2/pygit2/options.py

Lines 359 to 374 in 890730c

elif option_type == C.GIT_OPT_SET_SEARCH_PATH:
check_args(option_type, arg1, arg2, 2)
level = int(arg1) # Convert enum to int
path = arg2
path_cdata: ArrayC[char] | NULL_TYPE
if path is None:
path_cdata = ffi.NULL
else:
path_bytes = to_bytes(path)
path_cdata = ffi.new('char[]', path_bytes)
err = C.git_libgit2_opts(option_type, ffi.cast('int', level), path_cdata)
check_error(err)
return None

is not matching up with the libgit2 C constants of the same name:

static int config_level_to_sysdir(int *out, int config_level)
{
	switch (config_level) {
	case GIT_CONFIG_LEVEL_SYSTEM:
		*out = GIT_SYSDIR_SYSTEM;
		return 0;
	case GIT_CONFIG_LEVEL_XDG:
		*out = GIT_SYSDIR_XDG;
		return 0;
	case GIT_CONFIG_LEVEL_GLOBAL:
		*out = GIT_SYSDIR_GLOBAL;
		return 0;
	case GIT_CONFIG_LEVEL_PROGRAMDATA:
		*out = GIT_SYSDIR_PROGRAMDATA;
		return 0;
	default:
		break;
	}

	git_error_set(
		GIT_ERROR_INVALID, "invalid config path selector %d", config_level);
	return -1;
}

See libgit2 source

There was a similar issue in libgit2/libgit2sharp#1951 which was fixed by padding the va_args passed to git_libgit2_opts() (libgit2/libgit2sharp#1955).


I'm going to skip running tests on MacOS arm64 using pypy11 until this can be solved. The fact that this was never discovered is a sign that the CI was not previously able to test on MacOS arm64.

@jdavid jdavid merged commit 48e9fec into libgit2:master Dec 4, 2025
14 checks passed
@2bndy5 2bndy5 deleted the macos-ci-runner branch December 4, 2025 08:37
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