Skip to content

Commit

Permalink
macos: Fix test_pkgconfig_parse_libs() test on arm
Browse files Browse the repository at this point in the history
The unit test infrastructure hardcodes the architecture as x86_64. On
macos, the test_pkgconfig_parse_libs() test creates a few libraries
for testing using clang. This leads to the test failing on arm based
macs, as darwin_get_object_archs() will skip over these libraries,
which then leads to the test failing because of using -l instead of
referencing the libraries by their full path.

I am not at all sure this is the best approach.

I am also somewhat confused why nobody else has encountered this? CI
apparently just runs on x86_64 macs?

CC: @tristan957
  • Loading branch information
anarazel authored and nirbheek committed Dec 19, 2023
1 parent 445efbf commit 70a6e3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unittests/internaltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ def create_static_lib(name):
out = name.with_suffix('.o')
with src.open('w', encoding='utf-8') as f:
f.write('int meson_foobar (void) { return 0; }')
subprocess.check_call(['clang', '-c', str(src), '-o', str(out)])
# use of x86_64 is hardcoded in run_tests.py:get_fake_env()
subprocess.check_call(['clang', '-c', str(src), '-o', str(out), '-arch', 'x86_64'])
subprocess.check_call(['ar', 'csr', str(name), str(out)])

with tempfile.TemporaryDirectory() as tmpdir:
Expand Down

0 comments on commit 70a6e3d

Please sign in to comment.