Comments (7)
Based on the log it looks like the issue is this:
clang: cannot execute binary file
Perhaps the wrong wasi-sdk was downloaded? Regardless the compiler executable doesn't work on your machine.
Please make sure you download the macOS variant when setting up wasi-sdk
from cpython.
Thanks! I just used the steps mentioned in the README
file and that did not mention any release, I just pulled the repo and built it.
Now I get the following error on downloading the Mac OS specific version:
Logs:
configure:4830: checking for gcc
configure:4862: result: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot
configure:5215: checking for C compiler version
configure:5224: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot --version >&5
clang version 18.1.2 (https://github.com/llvm/llvm-project 26a1d6601d727a96f4301d0d8647b5a42760ae0c)
Target: wasm32-unknown-wasi
Thread model: posix
InstalledDir: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin
configure:5235: $? = 0
configure:5224: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot -v >&5
clang version 18.1.2 (https://github.com/llvm/llvm-project 26a1d6601d727a96f4301d0d8647b5a42760ae0c)
Target: wasm32-unknown-wasi
Thread model: posix
InstalledDir: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin
configure:5235: $? = 0
configure:5224: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:5235: $? = 1
configure:5224: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot -qversion >&5
clang: error: unknown argument '-qversion'; did you mean '--version'?
clang: error: no input files
configure:5235: $? = 1
configure:5224: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot -version >&5
clang: error: unknown argument '-version'; did you mean '--version'?
clang: error: no input files
configure:5235: $? = 1
configure:5255: checking whether the C compiler works
configure:5277: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot conftest.c >&5
configure:5281: $? = 0
configure:5331: result: yes
configure:5334: checking for C compiler default output file name
configure:5336: result: a.out
configure:5342: checking for suffix of executables
configure:5349: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot -o conftest conftest.c >&5
configure:5353: $? = 0
configure:5376: result:
configure:5398: checking whether we are cross compiling
configure:5406: /Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/bin/clang --sysroot=/Users/suhasthalanki/Documents/CMU/WASM/wasi-sdk-22.0/share/wasi-sysroot -o conftest conftest.c >&5
configure:5410: $? = 0
configure:5417: ./conftest
./configure: line 5419: ./conftest: cannot execute binary file
configure:5421: $? = 126
configure:5428: error: in `/Users/suhasthalanki/Documents/CMU/WASM/cpython':
configure:5430: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Fails in the first command mentioned here:
from cpython.
Oh I see, you're not supposed to use the wasi-sdk for the build Python. Did you perhaps run something else before running the below?
python3 Tools/wasm/wasi.py build --quiet -- --config-cache --with-pydebug
If not, then its probably a bug in the script.
Regardless, you should be able to build things correctly if you remove --config-cache
.
from cpython.
Oh I see, you're not supposed to use the wasi-sdk for the build Python. Did you perhaps run something else before running the below?
What do you mean by not supposed to use wasi-sdk? I thought that was mentioned in the documentation. I did not run anything before that.
I now pass the first part but it fails the next part
from cpython.
To be clear, the build requires two stages. First, we build a Python for your machine, which is required to set up a second Python build for WASM.
Your issue was you were using the WASI-SDK for the first build, when it should only be used for the second. Can you upload the log mentioned in your screenshot?
from cpython.
I understand that, and I believe python3 Tools/wasm/wasi.py build --quiet -- --config-cache --with-pydebug
does both the builds, as per the documentation.
The logs:
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Programs/python.o ../../Programs/python.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/token.o ../../Parser/token.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/pegen.o ../../Parser/pegen.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/pegen_errors.o ../../Parser/pegen_errors.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/action_helpers.o ../../Parser/action_helpers.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/parser.o ../../Parser/parser.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/string_parser.o ../../Parser/string_parser.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/peg_api.o ../../Parser/peg_api.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/lexer/buffer.o ../../Parser/lexer/buffer.c
gcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I../../Include/internal -I../../Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I../../Include -DPy_BUILD_CORE -o Parser/lexer/lexer.o ../../Parser/lexer/lexer.c
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/peg_api.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/pegen_errors.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/token.c:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/pegen.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/pegen.h:4,
from ../../Parser/parser.c:2:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/lexer/buffer.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Programs/python.c:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/string_parser.c:3:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/lexer/lexer.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/assert.h:42,
from ../../Include/Python.h:19,
from ../../Parser/action_helpers.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'
554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)
| ^
make: *** [Programs/python.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Parser/token.o] Error 1
make: *** [Parser/string_parser.o] Error 1
make: *** [Parser/pegen_errors.o] Error 1
make: *** [Parser/peg_api.o] Error 1
make: *** [Parser/lexer/buffer.o] Error 1
make: *** [Parser/lexer/lexer.o] Error 1
make: *** [Parser/pegen.o] Error 1
make: *** [Parser/action_helpers.o] Error 1
make: *** [Parser/parser.o] Error 1
from cpython.
[the script] does both the builds, as per the documentation.
Yep, but it was incorrectly using the incorrect CC variable, probably because your configure cache was incorrect AIUI.
I'm sorry but I'm not familiar with building on macOS, I think the script may be making some error but it's not clear to me what is going wrong now.
from cpython.
Related Issues (20)
- `contextlib.suppress` converts instances of a subtype of `ExceptionGroup` to an instance of the `ExceptionGroup` class HOT 2
- Add job to `jit.yml` to build and test with `--disable-gil`
- Incompatibility between _decimal and _pydecimal: tp_name for Decimal
- Python float calculation error HOT 2
- IDLE: Menu fonts too small HOT 1
- `get_origin(str|None) != get_origin(Union[str,None])` HOT 4
- Break up _pyrepl tests HOT 1
- '\040' instead of space in repl history on macOS with 3.13 or main branch HOT 2
- Unexpected name mangling behavior with generics HOT 1
- Resolve deprecation warnings in Docs/tools HOT 1
- REPL cursor is rendered offset in VSCode on WSL HOT 1
- Add c-api to set callback function on enter and exit of PyContext
- '_PyLong_NumBits': identifier not found in 3.13 HOT 3
- Out-of-memory when loading a Plist
- Make `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` public in the non-limited C API
- Add a ctypes.util function to list loaded shared libraries
- Add UOp Pair Compatibility to PyStats
- Adding >1 new line within a codeblock doesn't correctly match the indentation HOT 1
- Increase coverage of test_pyrepl HOT 1
- Deadlock in `pool_in_threads.py` (`test_multiprocessing_pool_circular_import`) in free-threaded build HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.