GithubHelp home page GithubHelp logo

Comments (10)

VirtualTim avatar VirtualTim commented on June 26, 2024

Have you tried sdk-tag-1.38.43-64bit?

from emscripten-docker.

andrewleech avatar andrewleech commented on June 26, 2024

I initially tried latest, which appears to be sdk-tag-1.38.43-64bit currently. That's where I first encountered this error.

from emscripten-docker.

trzecieu avatar trzecieu commented on June 26, 2024

I've found a similar issue in the main project: emscripten-core/emscripten#9205 Can you check if this is something that you can try?

from emscripten-docker.

andrewleech avatar andrewleech commented on June 26, 2024

Yes that's the same issue I linked to, this comment on particular is the one that looks like it might be also related to the llvm version: emscripten-core/emscripten#9205 (comment)

After that point of discussion they move onto a different issue.

Fwiw I'm currently building successfully with .41 which I'm happy to stick with for now, it's basically just for demonstration use at this stage.

In case you're interested, CI build script:
https://gitlab.com/alelec/micropython_ci/blob/master/ports/javascript/.gitlab-ci.yml

Building micropython in the browser:
https://alelec.gitlab.io/micropython_ci/javascript.html

from emscripten-docker.

kripken avatar kripken commented on June 26, 2024

It should be easy to debug this using emcc -v, which will print out the include paths. Then you can see if bits/alltypes.h is present in one of those.

Note that emscripten used to have a symlink for that, but removed it since it didn't work on windows. I'm not aware of any bugs atm in upstream. Perhaps the docker image is missing some of the necessary files?

from emscripten-docker.

trzecieu avatar trzecieu commented on June 26, 2024

Sorry @andrewleech, I missed that you've posted this issue in the main topic.

I've tried to reproduce this issue locally without success so far.

Sample

#include <stdio.h>
#include <bits/alltypes.h>

int main(int argc, char** argv) {
    printf("Test Test: %d\n", argc);
    fflush(stdout);
    return 0;
}

1.38.41

➜ docker run --rm -it -v `pwd`:/src trzeci/emscripten:sdk-tag-1.38.41-64bit find /emsdk_portable/ -name alltypes.h
/emsdk_portable/emscripten/tag-1.38.41/system/lib/libc/musl/arch/emscripten/bits/alltypes.h
➜ docker run --rm -it -v `pwd`:/src trzeci/emscripten:sdk-tag-1.38.41-64bit emcc -v test.c 
 /emsdk_portable/emscripten/tag-1.38.41/system/include/libcxx
 /emsdk_portable/emscripten/tag-1.38.41/system/lib/libcxxabi/include
 /emsdk_portable/emscripten/tag-1.38.41/system/include/compat
 /emsdk_portable/emscripten/tag-1.38.41/system/include
 /emsdk_portable/emscripten/tag-1.38.41/system/include/libc
 /emsdk_portable/emscripten/tag-1.38.41/system/lib/libc/musl/arch/emscripten
 /emsdk_portable/emscripten/tag-1.38.41/system/local/include
 /emsdk_portable/emscripten/tag-1.38.41/system/include/SDL
 /emsdk_portable/clang/tag-e1.38.41/build_tag-e1.38.41_64/lib/clang/6.0.1/include

1.38.43

➜ docker run --rm -it -v `pwd`:/src trzeci/emscripten:sdk-tag-1.38.43-64bit find /emsdk_portable/ -name alltypes.h
/emsdk_portable/emscripten/tag-1.38.43/system/lib/libc/musl/arch/emscripten/bits/alltypes.h
➜ docker run --rm -it -v `pwd`:/src trzeci/emscripten:sdk-tag-1.38.43-64bit emcc -v test.c
...
 /emsdk_portable/emscripten/tag-1.38.43/system/include/libcxx
 /emsdk_portable/emscripten/tag-1.38.43/system/lib/libcxxabi/include
 /emsdk_portable/emscripten/tag-1.38.43/system/include/compat
 /emsdk_portable/emscripten/tag-1.38.43/system/include
 /emsdk_portable/emscripten/tag-1.38.43/system/include/libc
 /emsdk_portable/emscripten/tag-1.38.43/system/lib/libc/musl/arch/emscripten
 /emsdk_portable/emscripten/tag-1.38.43/system/local/include
 /emsdk_portable/emscripten/tag-1.38.43/system/include/SDL
 /emsdk_portable/clang/tag-e1.38.43/build_tag-e1.38.43_64/lib/clang/6.0.1/include

latest

➜ docker run --rm -it -v `pwd`:/src trzeci/emscripten:latest find /emsdk_portable/ -name alltypes.h
/emsdk_portable/emscripten/tag-1.38.43/system/lib/libc/musl/arch/emscripten/bits/alltypes.
➜ docker run --rm -it -v `pwd`:/src trzeci/emscripten:latest emcc -v test.c                        
...
 /emsdk_portable/emscripten/tag-1.38.43/system/include/libcxx
 /emsdk_portable/emscripten/tag-1.38.43/system/lib/libcxxabi/include
 /emsdk_portable/emscripten/tag-1.38.43/system/include/compat
 /emsdk_portable/emscripten/tag-1.38.43/system/include
 /emsdk_portable/emscripten/tag-1.38.43/system/include/libc
 /emsdk_portable/emscripten/tag-1.38.43/system/lib/libc/musl/arch/emscripten
 /emsdk_portable/emscripten/tag-1.38.43/system/local/include
 /emsdk_portable/emscripten/tag-1.38.43/system/include/SDL

Tried also upstream just in case and looks that it works just fine. At least there is no sign that it shouldn't.

Do you thin that you can change ci script and check with emcc -v to see what we have there?

from emscripten-docker.

trzecieu avatar trzecieu commented on June 26, 2024

@andrewleech
I was able to reproduce this issue with your repository, and indeed it's something changed in 1.38.42+

I've found:

ifdef EMSCRIPTEN
    CPP += -isystem $(EMSCRIPTEN)/system/include/libc -cxx-isystem $(EMSCRIPTEN)/system/include/libcxx
endif

In your make file, this looks incompatible with emscripten-core/emscripten#9197

Simple changing it to:

ifdef EMSCRIPTEN
	CPP += -isystem $(EMSCRIPTEN)/system/include/libc
	CPP += -isystem $(EMSCRIPTEN)/system/lib/libc/musl/arch/emscripten
	CPP += -cxx-isystem $(EMSCRIPTEN)/system/include/libcxx
endif

Fixed the problem with compilation

from emscripten-docker.

andrewleech avatar andrewleech commented on June 26, 2024

I was just testing it myself and it appears to be somewhat of a false alarm; the first stage of building is using clang to pre-process a bunch of stuff.
It's clang that can't find the header, not emcc.

Yes, your change looks good and makes sense based on my findings, I'll submit a patch for that to the micropython project upstream.

Thanks so much for your help!

from emscripten-docker.

trzecieu avatar trzecieu commented on June 26, 2024

Happy to help!
Cheers,

from emscripten-docker.

fei2020 avatar fei2020 commented on June 26, 2024

Thank you. I fix the same problem according to your way. Then I get another error that can't find wasi/api.h. I add
"CPP += -isystem $(EMSCRIPTEN)/system/include/" to fix it too.
BTW. @andrewleech I use upy 1.11 release. Is your submit realeased in upy 1.12?

But my questions are:
1 Why the same micropython project get different when use different emscripten version?
2 Why $EMSCRIPTEN env var was geted rid of after emscripten 1.38.29. I am not sure the exact version. I just know 1.38.29 has $EMSCRIPTEN. But when I use 1.38.33, I must set the env var handly to meet the micropython ports/javascript/makefile.

from emscripten-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.