opa icon indicating copy to clipboard operation
opa copied to clipboard

the mac system does not support make to compile image

Open fengshunli opened this issue 1 year ago • 10 comments

executing make or make image will report an error image

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

fengshunli avatar Dec 26 '22 13:12 fengshunli

Can you please copy-paste the output? It's illegible. Also, from our Slack conversation, it's an M1-related issue.

srenatus avatar Dec 26 '22 19:12 srenatus

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

fengshunli avatar Dec 27 '22 12:12 fengshunli

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Jan 26 '23 21:01 stale[bot]

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Apr 07 '23 01:04 stale[bot]

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.

anderseknert avatar Nov 08 '23 21:11 anderseknert

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

dxh9845 avatar Apr 02 '24 22:04 dxh9845

Thanks! Re-opening.

anderseknert avatar Apr 03 '24 08:04 anderseknert

Hmm curious! The compilation of C-to-Wasm happens inside a docker container, so it's surprising if something there changes just like that.

srenatus avatar Apr 03 '24 08:04 srenatus

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

dxh9845 avatar Apr 03 '24 13:04 dxh9845

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.

stale[bot] avatar May 03 '24 20:05 stale[bot]