SavchenkoValeriy / emacs-swift-module

Write Emacs packages in Swift!
https://savchenkovaleriy.github.io/emacs-swift-module/documentation/emacsswiftmodule/
GNU General Public License v3.0
69 stars 3 forks source link

Warnings trigged by loading multiple modules #16

Closed roife closed 11 months ago

roife commented 11 months ago

Thanks for the great package. I have used it developing multiple dynamic modules. However, when I loading the modules constructed with emacs-swift-module, it throws warning as the following:

objc[49686]: Class _TtC16EmacsSwiftModule9LazyHook0 is implemented in both libEMT.dylib (0x12a405080) and libmacime.dylib (0x129ba6f78).

One of the two will be used. Which one is undefined.

I guess it is because the symbol name within two modules are duplicated. And I want to know how to solve the warning.

SavchenkoValeriy commented 11 months ago

Thanks for the feedback. That's something that I didn't even check before. I'll look into it!

roife commented 11 months ago

This situation only occurs when loading multiple libraries written using Swift dynamic module.

SavchenkoValeriy commented 11 months ago

Yeah, I figured, but thanks for clarification 🙏. I experimented a bit with linker flags 🎏 , but SwiftPM doesn't provide much freedom there. Right now I think about exposing EmacsSwiftModule as dynamic library as well and using it for building modules.

roife commented 11 months ago

Wow, this solution sounds very reasonable!

citrus-lemon commented 11 months ago

I am sorry. I did not reproduce this issue. I tried to load two modules with using emacs-swift-module and my emacs works well as usual.

I am on Emacs "GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.1.0, NS appkit-2487.20 Version 14.1 (Build 23B74)) of 2023-11-05"

Can we have an experiment to verify this issue?

SavchenkoValeriy commented 11 months ago

@citrus-lemon I was able to reproduce it. Make sure you launch Emacs from shell to see the output there.

SavchenkoValeriy commented 11 months ago

The issue should be fixed now. I didn't add an automated test though (which I should in time), but it requires some refactoring of how I do tests.