Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-consistent behavior regarding emscripten #6348

Closed
FrancoisChastel opened this issue Oct 10, 2018 · 3 comments
Closed

Non-consistent behavior regarding emscripten #6348

FrancoisChastel opened this issue Oct 10, 2018 · 3 comments
Assignees
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: documentation (cleanup)

Comments

@FrancoisChastel
Copy link

Description of the problem / feature request:

When trying to implement emscripten porting to a C/C++ project, non-consistent errors appears regarding the modification of compiler used with exactly the same parameters.

After coming through a guide concerning the usage of emscripten and some investigation, I am not able to figure out a way to be unlocked at all and I presume it's coming from the poor integration with other compilers.

I get the following exact error :

ERROR: /private/var/tmp/_bazel_root/7eac25f81ba1cb3897eb750dd5c677da/external/openssl/BUILD:1100:1: undeclared inclusion(s) in rule '@openssl//:openssl':
this rule is missing dependency declarations for the following files included by 'external/openssl/openssl/crypto/x509/x_crl.c':

when remplacing inside the emcc.sh from the tutorial, emcc to clang some errors still appears but are related to the code. Switching to other compilers does not make it appear as well.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Implement the tutorial into a project with external dependencies.

What operating system are you running Bazel on?

macOS High Sierre - 10.13.6 (17G2307)

What's the output of bazel info release?

release 0.14.0

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

I would like to produce documentation for porting C/C++ big code base using bazel and emscripten in the next few weeks if the project is successful

@scentini scentini added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Oct 16, 2018
@FrancoisChastel
Copy link
Author

FrancoisChastel commented Oct 23, 2018

Forgot to mention I found a fix for this problem : .d files are poorly managed with a toolchain using Emscripten.

You need to clean the .d files after the calls of emcc by cleaning what is recommended AND by cleaning absolute paths to the _bazel_root :

find . -name "*.d" -exec sed -i -e "2d" {} \;
find . -name "*.d" -exec sed -i -e "s/xxx///g" {} \;

with xxx the file name of the actual output of your bazel instance, to find it, you need to run bazel info and it should the output_base value.

@hlopko
Copy link
Member

hlopko commented Oct 23, 2018

Emscripten is not a Bazel supported toolchain, only a topic for tutorial. Please don't use it in production (unless you invest in productionalizing it :) Thanks for understanding.

@hlopko hlopko closed this as completed Oct 23, 2018
@nornagon
Copy link

nornagon commented Jun 3, 2019

What @hlopko said, but if you really like sed and just want to hack something up to get it working, plopping this in emcc.sh worked for me:

find . -name "*.d" -exec sed -i -e 's/^\( *\)\/.*external/\1external/' {} \;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: documentation (cleanup)
Projects
None yet
Development

No branches or pull requests

5 participants