Skip to content

Add --force-output-type option #5575

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

Closed
wants to merge 2 commits into from

Conversation

dreifachstein
Copy link

Fixes #4841

@kripken
Copy link
Member

kripken commented Sep 13, 2017

This looks correct and also like a reasonable thing to add. But there was some debate on this in that issue, let's wait for feedback from @juj and others.

Also, this will need tests. Can add in tests/test_other.py, can search for similar emcc options and see how they are tested, for a basis to start from etc.

@dschuff
Copy link
Member

dschuff commented Sep 14, 2017

+1, I think this is a good thing to have, and I also like this name for it, over the other ideas in #4841

@juj
Copy link
Collaborator

juj commented Sep 22, 2017

Make sure to change the merge target branch to incoming rather than master. Also, it is probably better to rebase to work on this feature on top of source incoming branch, since master is a bit of time away. (master=stable, incoming=latest dev)

emcc.py Outdated
elif '.' in target:
final_suffix = target.split('.')[-1]
else:
final_suffix = ''
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this case in particular, it would be good to add a comment about what this does. I presume it will build to an object file? (same as .o?)

@dreifachstein dreifachstein changed the base branch from master to incoming September 22, 2017 23:33
@dreifachstein
Copy link
Author

Tests added.
Fix a case when specified js output filename contains no dots.

@klieth
Copy link

klieth commented Nov 22, 2017

Any plans for merging this PR? I've run into the same issue as others in #4841 and would love to have this fix available.

@saschanaz
Copy link
Collaborator

Currently this PR seems to silently ignore --force-output-type when with -c, -E and -M. Shouldn't it be an error?

@stale
Copy link

stale bot commented Sep 18, 2019

This issue has been automatically marked as stale because there has been no activity in the past year. 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.

@stale stale bot added the wontfix label Sep 18, 2019
@stale stale bot closed this Sep 25, 2019
@RReverser
Copy link
Collaborator

Looks like this was accidentally abandoned; can we revisit / land it?

@sbc100
Copy link
Collaborator

sbc100 commented Oct 19, 2022

I think this feature landed as --oformat= in #12640, unless I didn't understand fully this proposal?

@RReverser
Copy link
Collaborator

Huh, I'll have to check. I've grepped emcc --help for "out", didn't see anything relevant, and thought it's not there. In fact, it seems that oformat doesn't show up in --help or on https://emscripten.org/docs/tools_reference/emcc.html either.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 19, 2022

Ah, I guess i forgot to update the documentation. Sorry about that.

@RReverser
Copy link
Collaborator

No problem at all. But yeah, it would be helpful to add it.

Maybe emcc.py could use one of those argument parsers that auto-generate --help? Not sure if that's more effort or less though.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 20, 2022

No problem at all. But yeah, it would be helpful to add it.

Maybe emcc.py could use one of those argument parsers that auto-generate --help? Not sure if that's more effort or less though.

That would be great! IIRC i've tried it a few times in the past and always given up.. but I assume its not completely impossible.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 20, 2022

No problem at all. But yeah, it would be helpful to add it.
Maybe emcc.py could use one of those argument parsers that auto-generate --help? Not sure if that's more effort or less though.

That would be great! IIRC i've tried it a few times in the past and always given up.. but I assume its not completely impossible.

(One problem I seem to remember is that emcc passes any arguments it doesn't understand directly to clang.. also the ordering of flags and non-flags is import: e.g. -Wl,--whole-archive libfoo.a -Wl,--no-whole-archive. Its kind of tricky to not end up with something bespoke I think).

@RReverser
Copy link
Collaborator

(One problem I seem to remember is that emcc passes any arguments it doesn't understand directly to clang

Right, but emcc --help already mostly outputs its own options (not generic clang ones, except where meaning is overridden), so that wouldn't change much. Also, such auto-generated --help could always be complemented with manual options that need to be documented in addition to automatically parsed ones.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 21, 2022

I meant the use an auto-generated option parser (which comes with auto-generated help docs) its tricky in situations like emcc for various reasons. The main pitfalls/limitation that I remember are the two I mention above. Those make it hard to use optparse which is the normal python way to do such things.

I'm not saying its impossible, just that have tried and failed in the past.

@RReverser
Copy link
Collaborator

Yeah that's reasonable; just thought it might help to automate some work, but I recognise it might cause more problems than it solves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Providing target option for emcc
8 participants