-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Providing target option for emcc #4841
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
Comments
Currently emcc uses the suffix of the output file to know what to emit, and there isn't another way to set that. I'd prefer not to add such redundancy if we don't absolutely need to. Can't cargo somehow pass along |
I think this is the issue you mentioned. However there is still no way to do it using cargo. It's only possible using rustc |
Oh, ok. Sorry, I'm not that familiar with rust so rustc/cargo differences confused me. This seems like basic functionality that would be useful in cargo, couldn't it be added there? |
I'm not sure, but looks like it's not possible because cargo tries to build the whole project and uses rustc's |
It is necessary if you don't want to use the EMCONFIGURE_JS hack. For example ffmpeg is cross-compile aware and is perfectly fine with a patched emcc.py with explicit output type control. And I think the code will end up more readable if done properly (pre-compute output and intermediate filenames before task execution). |
Yeah, good points. Sounds ok to me. The one question I have is what to do with ambiguity, like |
In that case I think we should ignore inferring the content of the file from the |
Well, the user has expressed two contradictory intents ;) Perhaps we should show an error in that case? |
It's not contradictory intent so much as a nonsense filename, which is a much weaker signal than |
The issue is that, for better or for worse, filenames have not just been hints in emcc - when asked At minimum we should emit a warning, but I lean to an error myself. |
I agree with both of you. IMO flags should be used instead of extensions to specify output type. But since they aren't in emscripten, an error is probably best. |
Is the issue that this would change behavior for existing users? Why would they start adding the explicit output preference and be relying on the existing behavior? Or is it that having two ways to specify output would cause confusion as to which was preferred? I think by having one of the two take priority, users can expect it to work consistently. At a high level, my concern is that we'd be adding code, and by extension rules for users, in order to limit flexibility, and I'm not sure what the benefit there is. |
Oh, sorry I just reread the thread. If we are going to add a new flag, it should override the filename-selection because the whole point of having the flag right now is to use in situations where using the filename as a selector is inconvenient or impossible. Most likely this will mean that the output extension is something generic like no extension at all, or |
Ok, sounds like mostly we are leaning towards a warning here. Before deciding, though, let's see what @juj thinks when he's back from vacation. |
@kripken Was this ever resolved? I'd much rather use Cargo than raw rustc. |
I would be ok with adding something like
I don't think any warnings would need to be emitted if one uses confusing/contradicting suffixes, because existing behavior without the |
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Is it possible to provide another way to build HTML?
Looks like currently it's not possible to use
-o
option with file target using other tools like cargo.Would be great to have a way to do something like
ref cross-rs/cross#36 (comment)
The text was updated successfully, but these errors were encountered: