XULRunner 30.0 Upgrade - macos

I have an Mac OS X app working fine on XULRunner ver 18.0.
Now I am upgrading the XULRunner version from 18.0 to 30.0. Have followed the steps below:
Downloaded the XULRunner 30.0 Runtime
Remove the content from XULRunner.Framework directory
Copied the latest files downloaded in XULRunner 30.0 Runtime
Now while launching the application, I am getting this error:
Dyld Error Message:
Library not loaded: #executable_path/libmozglue.dylib
Referenced from: /Users/USER/Desktop/*/MyApp.app/Contents/MacOS/xulrunner
Reason: image not found

Unfortunately XULRunner is not well supported, but I was able to get around most of the errors and get it working, except for one issue which I will get to later.
Basically, all the instructions I can find for how to structure the bundle are outdated. Mozilla had to restructure the binaries due to changes in the Mac code signing layout requirements. From this bug report and some trial and error I was able to determine the layout requirements.
The first error we can see when running the Contents/MacOS/xulrunner binary from the command line.
Error 1:
dyld: Library not loaded: #executable_path/libmozglue.dylib
The entirety of the XUL.framework contents must be placed into the App's Contents/MacOS/ directory. So to fix this error, copy everything from XUL.framework/Versions/Current into your app's MacOS directory.
Ok, now the binary will run. However, that brings us to the next error which can also be seen from the command line.
Error 2:
Couldn't load XPCOM.
This error is anything but descriptive, but to solve it you simple need to copy the dependentlibs.list file (now in your MacOS directory) to your Contents/Resources/ directory.
Error 3:
Now when you run by the command line, you will get something like the following.
Mozilla XULRunner 36.0.4
Usage: xulrunner [OPTIONS]
xulrunner APP-FILE [APP-OPTIONS...]
OPTIONS
--app specify APP-FILE (optional)
-h, --help show this message
-v, --version show version
--gre-version print the GRE version string on stdout
APP-FILE
Application initialization file.
APP-OPTIONS
Application specific options.
Unfortunately, xulrunner is not automatically finding the application.ini file in Contents/Resources. For testing, we can force it through the command line. Something like the following will do the trick:
./MyApp.app/Contents/MacOS/xulrunner MyApp.app/Contents/Resources/application.ini
At the moment, the only possible solution to this last issue I can offer at the moment is to make a stud loaded, either a shell script or compiled binary that executes the necessary command to run application.ini in xulrunner.

Related

Unable to run Swift code using Command Line Tools

I downloaded Xcode CLT from developer.apple.com/downloads and then installed the package.
Wanting to try my hands at Swift, I attempted to write a simple "hello, world" program, but, things seemed to be "wrong" from the first moment I started it. Look at the following screen output:
$ xcrun swift
Welcome to Swift! Type :help for assistance.
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/repl_swift
Reason: image not found
1> s="hello, world"
Error in auto-import:
failed to get module 'Swift' from AST context
1> ^D
I am especially concerned with the "dyld" line which is about line # 3 in that output.
I searched around on the web and found that this is caused by some certificate mismatch issues. But, I have neither requested any certificates from Apple, nor issued any certificates to anyone. I just want to try out Swift without downloading the entire XCode.
So, the questions are:
why am I getting the "dyld: Library not loaded:..." error?
how can i fix it?
how can I write, compile and run simple Swift code on the command line before downloading the entire XCode?
Your help is greatly appreciated. Anxiously waiting for your reply.
Edit:
Here's how I installed the tools: I downloaded the tools from the developer.apple.com/downloads web site. I got a dmg file, which I clicked. It contained a package file. When I clicked that, it brought up a nice popup that said something to the effect "installing". I went through all the dialogs it threw at me, selecting all the default values. After a few moments, it said "installed".
I then opened emacs, wrote 10 lines of c, compiled and ran it. worked! So, I got on the web, located the most elementary swift program I could find, copied it and attempted to run it ... and boom ... I got that error. So I started the swift interpreter and typed code into it. Nope! That didn't work either!
So, given all that ... I feel I did my best to install the tools, but, please let me know if I have missed any step that could have caused the CLT to install partially and not completely.
failed to get module 'Swift' from AST context
Use the xcode-select command-line tool:
sudo xcode-select --switch /Applications/Xcode.app
or if you are using Xcode-beta then use this:
sudo xcode-select --switch /Applications/Xcode-beta.app
From the xcode-select manual:
After setting a developer directory, all of the xcode-select provided developer tool shims ... will automatically invoke
the version of the tool inside the selected developer directory.
For more info:
man xcode-select
cd /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources
and then
sudo install_name_tool -rpath #executable_path/../../../../../Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx /Library/Developer/CommandLineTools/usr/lib/swift/macosx repl_swift
Will get rid of the first part of the error. I can't figure out the 2nd part yet. (Error in auto-import). Anyone have any ideas based on the first part of the solution?

Running OSX Bundle via Open

I'm trying to make an OSX bundle using CMake/CPack on OSX that involves OpenCV and Qt (although I don't think those dependencies matter at this point). Everything compiles and the bundle is created fine, and I have a script that modifies the necessary library paths such the executable I'm making works if I run it from the Terminal within the bundle. The problem I'm having is if I try to run the MyApp.app file via the open command or by simply double clicking the app it gives me the error:
LSOpenURLsWithRole() failed with error -10810 for the file /Applications/
I've seen other solutions to other LSOpenURLsWithRole() errors involving modifying permissions, but that hasn't helped me. Also, this error code is an "unknown error" so I'm not sure how to proceed.
The solution for this ended up being that the libcocoa.dylib library was not finding the requisite libraries. See Building OSX App Bundle for a thorough answer on the subject. otool -L is your best friend.

OBD-II Simulator on OS-X

Has somebody installed OBD-II simulator on mac? I tried downloading it from this site - http://icculus.org/obdgpslogger/obdsim.html for OS-X.
After installation and opening ObdGPSLogger, I can see GPS logger window and different parameter gauges. However, after selecting Logfile, and device there is nothing happening.
In the Raw output, below is the error displayed under StdErr:
Dyld: Library not loaded: /Users/chunky/gpsd//lib/libgps.18.dylib
Referenced from: /Applications/OBD GPS Logger.app/Contents/Resources/bin/obdgpslogger
Reason: image not found
Let me know if you guys know the cause
I had the same issue here, but I got it working on a Mac downloading the obdgpslogger-0.16.tar.gz version (in the Tarball section) from this link.
You need to navigate to the downloaded folder and then run the commands:
mkdir build
cd build
cmake ..
make
make install # optional

Build error when trying to compile Chess.app

I have downloaded Chess.app from opensource.apple.com. When I run xcodebuild install I get an error:
fatal error: 'CoreFoundation/CFLogUtilities.h' file not found
#import <CoreFoundation/CFLogUtilities.h>
^ 1 error generated.
The same error occurs when Building within XCode.
I have looked in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ and, sure enough, CFLogUtilities.h is not present. I see that it's available to download from Apple's Open Source Website, but I feel like if it's linked in an app bundled with the OS, it should be installed by default, or at least after installing XCode + Command Line Tools.
Do I have to manually download and bundle the header file in order to build the project, or am I missing something?
I don't know what OS version you are using, but to compile this on 10.9 simply change CFLogUtilities.h to CoreFoundation.h.
you also either need to build the CrashReporterClient.a library and add it to the project, or remove it from the "link with libraries" build setting for the target.
a shell script will fail because iconcompiler is missing, but you can comment out that script line with a # and run just fine. I will leave it as an exercise to you to figure out how best to restore the app icon.

LLVM With Haskell, Strange Linker Error

I just installed LLVM (3.0) successfully, and got the Hackage bindings (3.0.0.0). However when I try to use it, I get the following linker error:
Loading package llvm-base-3.0.0.0 ... can't load .so/.DLL for: (dlopen(lib.dylib, 9): image not found)
There is no name after "for: ", which makes this frustrating, because I don't know what it can't find. I know there isn't much information to go on, but does anyone have any idea why this could be happening?
I am running Mac OS X, in case it matters.
It's a bug in the llvm bindings installer. I had it patched locally and just sent a pull request to bos, hopefully it will get merged soon.
To fix your problem without the patch, find the llvm-base package config file. Mine is located here:
~/.ghc/x86_64-darwin-7.4.1/package.conf.d/llvm-base-3.0.0.0-*.conf
Locate this line and delete it:
extra-ghci-libraries: ""
Then run: ghc-pkg recache --user

Resources