Trouble re side-by-side installs of cef 3112 and 3202 on Mac

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Trouble re side-by-side installs of cef 3112 and 3202 on Mac

Postby DanKegel » Tue Oct 24, 2017 9:07 pm

The Mac has a lovely feature where libraries containing Objective C have to have unique class names; see e.g.
https://qnoid.com/2013/02/12/How-to-deb ... se-(Part-1).html
https://qnoid.com/2013/02/12/How-to-deb ... se-(Part-2).html#main
for how it occasionally trips up developers. The symptom is lots of warnings at runtime,
and if your app looks up one of the classes by name, possibly a crash.

That kind of makes sense, having two different versions of a library in the same app is madness.

But evidently they don't have to be in the same app. I've installed two different versions of cef
so multiple apps can link to them without bundling them (yeah, I know, I'm asking for it),
and if I do that with cef 3112 and cef 3202, I see warnings like

Class CrCoreCursor is implemented in both /opt/foo/deps-64-12/ce
f3202/Release//Chromium Embedded Framework.framework/Chromium Embedded Framework
(0x11824e908) and /opt/foo/deps-64-12/cef3112/Release//Chromium Embedded Fra
mework.framework/Chromium Embedded Framework (0x10c0bfce8). One of the two will
be used. Which one is undefined.

otool -L on the app shows only one of the two. Not sure why the other library ends up
being referred to by the app.

(This also happens with earlier versions, and I have a sed script to make the classes unique when I build cef,
but in 3112, the number of classses involved exploded.)

Has anyone else here hit this?
DanKegel
Mentor
 
Posts: 59
Joined: Fri Nov 08, 2013 12:46 pm

Re: Trouble re side-by-side installs of cef 3112 and 3202 on

Postby magreenblatt » Tue Oct 24, 2017 10:08 pm

What you're doing is unsupported. That said, if the frameworks have sequential version numbers (shown by otool -L) then you can have your app require a specific version. Or you can modify the ld search path so only one copy is found. See https://developer.apple.com/library/con ... lines.html
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Trouble re side-by-side installs of cef 3112 and 3202 on

Postby DanKegel » Wed Oct 25, 2017 7:48 pm

I cleaned up the script that I use to build and install the wrapper, and added it to https://github.com/dankegel/tinycef/

My side-by-side scenario is now easy to try on osx, e.g.
brew install cmake ninja wget
git clone https://github.com/dankegel/tinycef
cd tinycef
sudo make prefix
make cefbranch=3112
make cefbranch=3163
tiny.app/Contents/MacOS/tiny

But, uh, the runtime error I was kvetching about doesn't happen.

Maybe my old build script was brain-damaged, or maybe reproducing it requires 3202, which doesn't have a mac build yet at
http://opensource.spotify.com/cefbuilds/index.html

Best case, I now have a nicer build script, and a minimal test case for further problems.

Thanks again...
DanKegel
Mentor
 
Posts: 59
Joined: Fri Nov 08, 2013 12:46 pm

Re: Trouble re side-by-side installs of cef 3112 and 3202 on

Postby DanKegel » Thu Nov 09, 2017 12:34 pm

My current theory is that this happened when an app linked both directly and indirectly to
3112, and then the library that depended on 3112 was upgraded to depend on 3202.
Voila, instant conflict within a single process.
DanKegel
Mentor
 
Posts: 59
Joined: Fri Nov 08, 2013 12:46 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 69 guests