Problem with nested bundle in 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.

Problem with nested bundle in MAC

Postby rado » Wed Apr 11, 2018 2:33 pm

I'm using browser app bundle nested inside my main process app bundle. As I've already found out it is problem in new CEF versions (I have 3.3325) so I've set the framework_dir_path and browser_subprocess_path in CefSettings structure passed to CefInitialize() in browser process.
When I start the browser process it is still unable to start renderer process. In the debug.log I can see something like this:

ERROR:launch_mac.cc(164)] posix_spawnp(/Users/........../myMain.app/Contents/MacOS/my.app/Contents/Frameworks/my Helper.app): -13 Permission denied


The path seems to be correct. What can be the problem? Owner of the directory and permissions seems to be ok. Strange thing is that even if I use wrong path, it still shows Permission denied, not invalid path error.
Thank you.
rado
Expert
 
Posts: 145
Joined: Wed Oct 05, 2011 3:32 am

Re: Problem with nested bundle in MAC

Postby magreenblatt » Wed Apr 11, 2018 2:43 pm

rado wrote:As I've already found out it is problem in new CEF versions

What is a problem in new CEF versions?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Problem with nested bundle in MAC

Postby rado » Wed Apr 11, 2018 3:10 pm

magreenblatt wrote:
rado wrote:As I've already found out it is problem in new CEF versions

What is a problem in new CEF versions?

I'm not 100% sure if nested bundle was working for me in older CEF version without need of the "framework_dir_path" option because I was also working on different scenario (initially I didn't use nested bundle structure) and I'm not working on project full time so after weeks of other work I forget what exactly was working so I've thought the "framework_dir_path" option was added to newer version because of some new design in CEF.
rado
Expert
 
Posts: 145
Joined: Wed Oct 05, 2011 3:32 am

Re: Problem with nested bundle in MAC

Postby magreenblatt » Wed Apr 11, 2018 4:25 pm

Nested app bundles is the default/recommended structure. See the README.txt file included with the binary distribution.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Problem with nested bundle in MAC

Postby rado » Sat Apr 14, 2018 3:13 am

There is misunderstanding, I'm afraid I haven't explained it clearly so I've reproduced simple steps.
Let's say I want to run original cefsimple.app at this location:
/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app
It is contained in app bundle testtest.app. It is main application which has no clue about CEF using cefsimple just as worker process.

When I try to start cefsimple using: open -a "/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app"
It won't run, because it will complain it cannot find cef framework.

So I've modified the cefsimple_mac.mm by inserting two lines setting framework_dir_path and browser_subprocess_path:

Code: Select all

// Specify CEF global settings here.
  CefSettings settings;
   
   CefString(&settings.framework_dir_path) = L"/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app/Contents/Frameworks/Chromium Embedded Framework.framework";
   CefString(&settings.browser_subprocess_path) = L"/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app";

  // SimpleApp implements application-level callbacks for the browser process.
  // It will create the first browser instance in OnContextInitialized() after
  // CEF has initialized.
  CefRefPtr<SimpleApp> app(new SimpleApp);

  // Initialize CEF for the browser process.
  CefInitialize(main_args, settings, app.get(), NULL);



Now It opens the browser window, but it is empty and this is in the cefsimple_debug.log:

Code: Select all
[0414/100216.768811:ERROR:launch_mac.cc(164)] posix_spawnp(/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Co
ntents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app): -13 Permission denied
[0414/100216.773592:ERROR:launch_mac.cc(164)] posix_spawnp(/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Co
ntents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app): -13 Permission denied
[0414/100216.777742:ERROR:launch_mac.cc(164)] posix_spawnp(/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Co
ntents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app): -13 Permission denied
[0414/100216.779642:ERROR:gpu_process_host.cc(370)] !GpuDataManagerImpl::GpuAccessAllowed()
[0414/100216.779773:ERROR:browser_gpu_channel_host_factory.cc(120)] Failed to launch GPU process.
[0414/100217.011000:ERROR:gpu_process_host.cc(370)] !GpuDataManagerImpl::GpuAccessAllowed()
[0414/100217.012321:ERROR:launch_mac.cc(164)] posix_spawnp(/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Co
ntents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app): -13 Permission denied
[0414/100217.675546:ERROR:gpu_process_host.cc(370)] !GpuDataManagerImpl::GpuAccessAllowed()
[0414/100217.676395:ERROR:launch_mac.cc(164)] posix_spawnp(/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Co
ntents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app): -13 Permission denied
[0414/100217.678240:ERROR:service_manager_context.cc(252)] Attempting to run unsupported native service: /Users/rado/Library/Developer/Xcode/
DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app/Contents/Frameworks/Chromium Embedded Framework.framework/content_re
nderer.service


Do you have idea what could be wrong? I'm trying distribution cef_binary_3.3325.1756.g6d8faa4_macosx64.
rado
Expert
 
Posts: 145
Joined: Wed Oct 05, 2011 3:32 am

Re: Problem with nested bundle in MAC

Postby rado » Sat Apr 14, 2018 3:21 am

BTW result is the same also when I don't alter cefsimple and try it with command line arguments:

Code: Select all
open -a "/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app" --args --framework-dir-path="/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app/Contents/Frameworks/Chromium Embedded Framework.framework" --browser-subprocess-path="/Users/rado/Library/Developer/Xcode/DerivedData/bin/Products/Debug/testtest.app/Contents/MacOS/cefsimple.app/Contents/Frameworks/cefsimple Helper.app"
rado
Expert
 
Posts: 145
Joined: Wed Oct 05, 2011 3:32 am

Re: Problem with nested bundle in MAC

Postby magreenblatt » Sat Apr 14, 2018 9:24 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Problem with nested bundle in MAC

Postby rado » Sat Apr 14, 2018 12:38 pm

Thank you, now it works. My mistake was that in --browser-subprocess-path I've specified path to app bundle, not the executable (I had to add the /Contents/MacOS/cefsimple Helper).
rado
Expert
 
Posts: 145
Joined: Wed Oct 05, 2011 3:32 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 74 guests