You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On FreeBSD where clang is the default compiler, one test from mypy testsuite fails: TestExternal.test_c_unit_test, because -std=c++11 flag is set for both C and CXX compilers, but it only applies to C++, and clang refuses to compile C code with it.
=================================== FAILURES ===================================
________________________ TestExternal.test_c_unit_test _________________________
self = <mypyc.test.test_external.TestExternal testMethod=test_c_unit_test>
@unittest.skipIf(sys.platform.startswith("win"), "rt tests don't work on windows")
def test_c_unit_test(self) -> None:
"""Run C unit tests in a subprocess."""
# Build Google Test, the C++ framework we use for testing C code.
# The source code for Google Test is copied to this repository.
cppflags: List[str] = []
env = os.environ.copy()
if sys.platform == 'darwin':
cppflags += ['-mmacosx-version-min=10.10', '-stdlib=libc++']
env['CPPFLAGS'] = ' '.join(cppflags)
subprocess.check_call(
['make', 'libgtest.a'],
env=env,
cwd=os.path.join(base_dir, 'mypyc', 'external', 'googletest', 'make'))
# Build Python wrapper for C unit tests.
env = os.environ.copy()
env['CPPFLAGS'] = ' '.join(cppflags)
> status = subprocess.check_call(
[sys.executable, 'setup.py', 'build_ext', '--inplace'],
env=env,
cwd=os.path.join(base_dir, 'mypyc', 'lib-rt'))
mypyc/test/test_external.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
popenargs = (['/usr/local/bin/python3.8', 'setup.py', 'build_ext', '--inplace'],)
kwargs = {'cwd': '/work/usr/ports/devel/py-mypy/work-py38/mypy-0.940/mypyc/test/../../mypyc/lib-rt', 'env': {'ARCH': 'amd64', 'BATCH': '1', 'BLOCKSIZE': 'K', 'BSD_INSTALL_DATA': 'install -m 0644', ...}}
retcode = 1
cmd = ['/usr/local/bin/python3.8', 'setup.py', 'build_ext', '--inplace']
def check_call(*popenargs, **kwargs):
"""Run command with arguments. Wait for command to complete. If
the exit code was zero then return, otherwise raise
CalledProcessError. The CalledProcessError object will have the
return code in the returncode attribute.
The arguments are the same as for the call function. Example:
check_call(["ls", "-l"])
"""
retcode = call(*popenargs, **kwargs)
if retcode:
cmd = kwargs.get("args")
if cmd is None:
cmd = popenargs[0]
> raise CalledProcessError(retcode, cmd)
E subprocess.CalledProcessError: Command '['/usr/local/bin/python3.8', 'setup.py', 'build_ext', '--inplace']' returned non-zero exit status 1.
/usr/local/lib/python3.8/subprocess.py:364: CalledProcessError
----------------------------- Captured stdout call -----------------------------
c++ -isystem ../include -I.. -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -g -Wall -Wextra -pthread -fPIC -c ../src/gtest-all.cc
ar -crsD libgtest.a
running build_ext
building 'test_capi' extension
creating build
creating build/temp.freebsd-13.0-RELEASE-amd64-3.8
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -I../external/googletest -I../external/googletest/include -I/usr/local/include/python3.8 -c test_capi.cc -o build/temp.freebsd-13.0-RELEASE-amd64-3.8/test_capi.o -Wno-unused-function -Wno-sign-compare --std=c++11
cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -I../external/googletest -I../external/googletest/include -I/usr/local/include/python3.8 -c init.c -o build/temp.freebsd-13.0-RELEASE-amd64-3.8/init.o -Wno-unused-function -Wno-sign-compare --std=c++11
----------------------------- Captured stderr call -----------------------------
error: invalid argument '--std=c++11' not allowed with 'C'
error: command 'cc' failed with exit status 1
Bug Report
On FreeBSD where clang is the default compiler, one test from mypy testsuite fails:
TestExternal.test_c_unit_test
, because-std=c++11
flag is set for both C and CXX compilers, but it only applies to C++, and clang refuses to compile C code with it.Full log: https://gist.github.com/7b5fb7d6e43d83e9ccdacf34cddc2dec
To Reproduce
Run tests when clang compiler.
Expected Behavior
Tests pass
Actual Behavior
Tests fail
Your Environment
The text was updated successfully, but these errors were encountered: