-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Deprecate --bind
in favor of just -lembind
. NFC
#16087
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
Conversation
f05491d
to
e0b29bf
Compare
I'm in favour of this change from semantic perspective. But, just to be clear, that's all it is - a semantic change - and the new syntax doesn't provide any capabilities towards #14729? |
No it doesn't. Its just a minor step. |
Sounds good! |
adding @kripken to make sure he is on board with my plan. To be clear, I'm not determined to remove the old flag.. at least not for a while :) |
@@ -24,6 +24,9 @@ See docs/process.md for more on how version tagging works. | |||
`emcc` now uses this mode when the `--embed-file` option is used. If you | |||
use `file_packager` directly it is recommended that you switch to the new mode | |||
by adding `--obj-output` to the command line. (#16050) | |||
- The `--bind` flag used to enable embind has been deprecated in favor of | |||
`-lembind`. The semantics have not changed and the old flag continues to | |||
work. (#16087) |
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.
this is no longer in the right place
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.
It looks correct to me.. but perhaps this relates to an earlier version?
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.
Oh, I think I misread it. lgtm
This was originally introduced 10 years ago to work around a bug that occurred on windows vista (See 4ab1c8a). Its not clear if the bug was in cmake or in windows itself, or in the version of python. Windows Vista has been unsupported for a very long time now so I think ever attempted to verify this bug still exists would be very tricky. What is more, the underlying tools such as clang don't support this behavior so any user who suffered from this bug likely wouldn't be able ot use clang outside of emscripten. For example: ``` clang ' --version' clang: error: no such file or directory: ' --version'; did you mean '--version'? clang: error: no input files ``` I don't know of any tools that don't work like that above, so I don't see why we should be any different. The motivation for removing this now is that it came up in discussion when working on code nearby (#16087) and it seems to poinless at best and confusing/incomaptiable at best (since it prevents the use of filenames that start or end in space).
This was originally introduced 10 years ago to work around a bug that occurred on windows vista (See 4ab1c8a). Its not clear if the bug was in cmake or in windows itself, or in the version of python. Windows Vista has been unsupported for a very long time now so I think ever attempted to verify this bug still exists would be very tricky. What is more, the underlying tools such as clang don't support this behavior so any user who suffered from this bug likely wouldn't be able ot use clang outside of emscripten. For example: ``` clang ' --version' clang: error: no such file or directory: ' --version'; did you mean '--version'? clang: error: no input files ``` I don't know of any tools that don't work like that above, so I don't see why we should be any different. The motivation for removing this now is that it came up in discussion when working on code nearby (#16087) and it seems to pointless at best and is also a compatibility issue (since it prevents the use of filenames that start or end in space).
…6115) This was originally introduced 10 years ago to work around a bug that occurred on windows vista (See 4ab1c8a). Its not clear if the bug was in cmake or in windows itself, or in the version of python. Windows Vista has been unsupported for a very long time now so I think even attempted to verify this bug still exists would be very tricky. What is more, the underlying tools such as clang don't support this behavior so any user who suffered from this bug likely wouldn't be able ot use clang outside of emscripten. For example: ``` clang ' --version' clang: error: no such file or directory: ' --version'; did you mean '--version'? clang: error: no input files ``` I don't know of any tools that don't work like that above, so I don't see why we should be any different. The motivation for removing this now is that it came up in discussion when working on code nearby (#16087) and it seems to pointless at best and is also a compatibility issue (since it prevents the use of filenames that start or end in space).
All that the `--bind` flag does is enable the embind library (native and JS portions), so I think its more clear if we just use the normal `-l` method of including it. Historically `--bind` has sounded to some (including myself) like a verb rather than the name of a library leading to folks to believe that the linker is actually doing the binding, whereas all the binding is done either at compile time or at load time. No "binding" happens during linking.
Out of curiosity, can the semantics of embind actually be reduced to just linking a library? How much emcc magic is still needed now and/or if we cared enough in the future? |
As far as I know embind has been nothing more than a library (composed of a JS library and native library). I don't think anything in particular happens at link time (the JS libraries are not doing anything special AFAICT) .. that magic mostly happens in static ctors (which register types) and at runtime dynamically. If we ever do something more complex such as a wasm-bindgen type tool I think I would advocate for making is a separate executable. |
ok cool that makes sense. The js-library-plus-native-library bit is interesting. Is that special-cased for embind, or is it possible for anyone to make libraries that have both JS and wasm components (i.e. that are considered part of the same single library)? |
As of today, a non-core library would need to require something like Lines 1396 to 1400 in e35d017
Core JS libraries can also be included via |
FWIW I'm in favour but last time this was attempted, there were some concerns (admittedly, that was ages ago): #4816 |
On nice.. thanks for digging that up. I'll be sure to take that into account. |
All that the
--bind
flag does is enable the embind library (nativeand JS portions), so I think its more clear if we just use the normal
-l
method of including it.Historically
--bind
has sounded to some (including myself) like averb rather than the name of a library leading to folks to believe that
the linker is actually doing the binding, whereas all the binding is
done either at compile time or at load time. No "binding" happens
during linking.