-
Notifications
You must be signed in to change notification settings - Fork 694
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
Always output a tarball from cc_binary to simplify logic. #936
Conversation
…hange the result of --config=wasm builds that were previously outputting a single file.
cc @trybka |
Its maybe a little sad that |
# If we have more than one output file then create tarball | ||
if len(files) > 1: | ||
# If we have one or more output files then create a tarball | ||
if len(files) >= 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just drop this if/else
completely. If you a worried that would loose coverage perhaps just assert(len(files))
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would prefer to maintain the check. I don't expect it to be triggered, but we're not losing anything by keeping it, so I figure it's better to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but then at least re-write it to use early-return style and avoid the indentation:
if not len(files):
print('emcc.py did not appear to output any known files!')
sys.exit(1)
.. the rest here without any indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Hopefully it will. I believe the majority of emscripten users are building and using both the .wasm file and the .js wrapper, so this should affect a very small number of users. It's not too bad to generate a genrule that would untar the archive for you if someone is insistent in not using wasm_cc_binary. And if this does generate enough complaints, we can always go back and add the In short, this simplifies the code, eliminates a potential external dependency, and shouldn't affect very many users. |
LGTM (with sbc100's suggested tweak) |
not sure why the test-linux check is failing; what I did shouldn't have any effect there. |
Looks like an unrelated binaryen failure:
|
Ok, thanks! Let me know if there's anything else I should do to get this merged. Happy to wait and rebase if necessary. :) |
Looks like this is still failing. Is there something I need to update to get it to pass? |
I think you just need to rebase (or merge), no? |
…hange the result of --config=wasm builds that were previously outputting a single file.
Thanks! Sorry about that, my git experience is still quite minimal. I just need an approval now please and thanks! |
This will change the result of --config=wasm builds that were previously outputting a single file.
Helps prepare for windows support (#814) and removes the need for #929 to add an external python dep.