opa
opa copied to clipboard
the mac system does not support make to compile image
executing make or make image will report an error
DOCKER_UID=501 DOCKER_GID=20 /Library/Developer/CommandLineTools/usr/bin/make ci-go-ci-build-linux ci-go-ci-build-linux-static WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested clang++-13 -std=c++17 -MD -MP -nodefaultlibs --target=wasm32-unknown-unknown-wasm -fno-exceptions -fno-rtti -I src/lib -I src/libc++ -I /usr/lib/llvm-13/include/c++/v1 -I /usr/lib/llvm-13/lib/clang/13.0.0/include -I src/re2 -D_LIBCPP_HAS_NO_THREADS -D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION -O3 -c -o obj/src/re2/re2/dfa.wasm src/re2/re2/dfa.cc In file included from src/re2/re2/dfa.cc:41: src/re2/util/mutex.h:37:14: error: no type named 'mutex' in namespace 'std' typedef std::mutex MutexType; ~~~~~^ src/re2/util/mutex.h:96:36: error: member reference base type 'MutexType' (aka 'int') is not a structure or union void Mutex::Lock() { mutex.lock(); } ~~~~~~^~~~~ src/re2/util/mutex.h:97:36: error: member reference base type 'MutexType' (aka 'int') is not a structure or union void Mutex::Unlock() { mutex_.unlock(); } ~~~~~~^~~~~~~ 3 errors generated. make: *** [Makefile:135: _obj/src/re2/re2/dfa.wasm] Error 1 make[2]: *** [build] Error 2 make[1]: *** [wasm-lib-build] Error 2 make: *** [image] Error 2
Can you please copy-paste the output? It's illegible. Also, from our Slack conversation, it's an M1-related issue.
Can you please copy-paste the output? It's illegible. Also, from our Slack conversation, it's an M1-related issue.
ok,my system is m2
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.
Let us know if this is still an issue, but since we've not seen reports from others on Mac, I think we can close this for now.
For what it's worth, I am seeing the same. Will check the Slack channel to see how this was resolved:
src/re2/util/mutex.h:37:14: error: no type named 'mutex' in namespace 'std'
typedef std::mutex MutexType;
~~~~~^
src/re2/util/mutex.h:96:36: error: member reference base type 'MutexType' (aka 'int') is not a structure or union
void Mutex::Lock() { mutex_.lock(); }
~~~~~~^~~~~
src/re2/util/mutex.h:97:36: error: member reference base type 'MutexType' (aka 'int') is not a structure or union
void Mutex::Unlock() { mutex_.unlock(); }
~~~~~~^~~~~~~
3 errors generated.
make: *** [Makefile:135: _obj/src/re2/re2/dfa.wasm] Error 1
Thanks! Re-opening.
Hmm curious! The compilation of C-to-Wasm happens inside a docker container, so it's surprising if something there changes just like that.
So I rebuilt the OPA wasm builder image and used that - still received the same result. I would suspect this is something to do with Docker Platform architectures - I'm running on a Macbook Pro M2.
I do set the DOCKER_DEFAULT_PLATFORM environment variable to build for Linux AMD64.
env | rg 'DOCKER'
DOCKER_DEFAULT_PLATFORM=linux/amd64
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.
Just tried to build this in my system and tried to run tests. I was hit the same error. I am on Intel Macbook Pro.
clang++-13 -std=c++17 -MD -MP -nodefaultlibs --target=wasm32-unknown-unknown-wasm -fno-exceptions -fno-rtti -I src/lib -I src/libc++ -I /usr/lib/llvm-13/include/c++/v1 -I /usr/lib/llvm-13/lib/clang/13.0.0/include -I src/re2 -D_LIBCPP_HAS_NO_THREADS -D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION -O3 -c -o _obj/src/re2/re2/dfa.wasm src/re2/re2/dfa.cc
In file included from src/re2/re2/dfa.cc:41:
src/re2/util/mutex.h:37:14: error: no type named 'mutex' in namespace 'std'
typedef std::mutex MutexType;
~~~~~^
src/re2/util/mutex.h:96:36: error: member reference base type 'MutexType' (aka 'int') is not a structure or union
void Mutex::Lock() { mutex_.lock(); }
~~~~~~^~~~~
src/re2/util/mutex.h:97:36: error: member reference base type 'MutexType' (aka 'int') is not a structure or union
void Mutex::Unlock() { mutex_.unlock(); }
~~~~~~^~~~~~~
3 errors generated.
make: *** [Makefile:135: _obj/src/re2/re2/dfa.wasm] Error 1
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. Although currently inactive, the issue could still be considered and actively worked on in the future. More details about the use-case this issue attempts to address, the value provided by completing it or possible solutions to resolve it would help to prioritize the issue.