I like to use the Chromium browser instead of the WebKit browser in my OS X project.
I downloaded the binary files at https://cefbuilds.com
I builded with cmake that creates a cef.xcodeproj.
Once I open that and want to build it. It first gives me problems because virtual bool Execute needs to be override. When I solved that error it goes a lot futher but crashes at:
cefsimple /bin/sh: tools/make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted
make: *** [cefsimple_buildpart_2] Error 126
Command /bin/sh failed with exit code 2
Can anyone explain what I'm doing wrong?
In OS X versions 10.7.4 and above extended attributes are added to executable files (including shell scripts) and handled by the security settings you have defined for your account. For example checking the xattr on one of your build scripts might look similar to this:
$ ls -l# make_more_helpers.sh
-rwxr-xr-x# 1 Hellman staff 3564 Sep 2 07:02 make_more_helpers.sh
com.apple.quarantine 23
When Xcode tries to execute the script (again depending on your security settings) it will look at the extended attributes and determine whether or not to allow it to execute. If it finds that the creator of the script has not been approved you will receive an error such as:
make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted
Fortunately it's an easy fix and there are quite a few ways to remedy it. One such way would be to associate scripts that are part of projects you build with Xcode. You could also open the script in an editor that is allowed to run scripts and re-save it, or just recursively scan your build directory for files with quarantine attributes and remove the attribute:
xattr -rd com.apple.quarantine /path/to/build
After you do this you should notice that doing another ls -l# on your script the # following the permissions and the com.apple.quarantine should be removed. Now when you try building your project the script should be allowed to execute and succeed.
↳ https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/BeforeYouBegin/BeforeYouBegin.html
Related
[OSX 10.10.5, XCode 7.0.1]
I'm getting an error during my build stating that Otool can't copy a file:
error: otool: can't open file: /usr/local/opt/llvm/lib/libclang.3.6.dylib: (No such file or directory)
The two lines before the error (and what I think is causing it, because there are no other error indications) are:
cp -p /usr/local/opt/llvm/lib/libclang.3.6.dylib /Users/me/Library/Developer/Xcode/DerivedData/MiCASE-asvgjysohljplretlamgcpgnxgiq/Build/Products/Debug/MiCASE.app/Contents/Frameworks
cp -p /usr/local/opt/llvm/lib/libclang.3.6.dylib: /Users/me/Library/Developer/Xcode/DerivedData/MiCASE-asvgjysohljplretlamgcpgnxgiq/Build/Products/Debug/MiCASE.app/Contents/Frameworks
When I manually perform the command in a terminal, it works fine. I've set the permissions of the dynamic library to me:admin 777, so the file definitely exists. Thus I don't understand why I am getting the error.
This leads me to believe there is something else that is failing but the build log isn't showing it.
I'm also getting this error at the end of the script, but I think it's due to the above:
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
Solution
#trojanfoe, thanks for the info.
The problem was that as part of the build, a script was being run. In the script otool was being used to extract dependencies, and filtering of its output was done incorrectly. Fixing the filtering resolved the issue.
I'm trying to create a xulrunner app for OS X 10.9+. I need it to be standalone, i.e. to not require any extra additional software (including Firefox) to be installed on the box along with the app.
I was not able to google up an up-to-date guide on how to do that. It seems that I've hit every issue described here: https://bugzilla.mozilla.org/show_bug.cgi?id=923979
One of the last ones is:
$ open MyApp.app
LSOpenURLsWithRole() failed with error -10810 for the file /Path/To/MyApp.app.
Here is an what I have so far:
https://drive.google.com/file/d/0BxRquYs2Nx92ZTZaVjk0QThMN2c/view?usp=sharing
How can I create an OS X .app for a modern (v36+) xulrunner application?
You are on the right track, there is just one major issue you are facing.
If you were to run you application by the command line, you would get some output like this.
$ SampleApplication.app/Contents/MacOS/xulrunner
Mozilla XULRunner 33.0
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
As we can see, the executable did not automatically run the Contents/Resources/application.ini like the tutorials say it will. This is a known issue, and the popular workaround among XULRunner users is to create a stub shell script to pass the required argument to the xulrunner binary.
Here is a script I've whipped up to do just that.
#!/bin/sh
runpath="`dirname "$0"`"
contentsdir="`cd "$runpath"/.. > /dev/null && pwd`"
exec "$runpath/xulrunner" --app "$contentsdir/Resources/application.ini"
Save this text to a file in your MacOS directory and give it executable permissions. For sake of example, I will use sampleapplication. Here is the command to set executable permissions.
chmod +x sampleapplication
Now, modify your Info.plist to execute this script instead of executing xulrunner directly by setting the CFBundleExecutable entry to match your stub shell script.
<key>CFBundleExecutable</key>
<string>sampleapplication</string>
Now when you run your application, it should work. If you are getting an error saying "The application cannot be opened because its executable is missing", you may want to rename the application bundle, or follow the advice in that question to avoid the caching issue.
Bonus Info
You can remove the Contents/Frameworks/XUL.framework directory, it is no longer used and placing the XUL.framework contents in the MacOS folder is now the correct place to put them.
You should also copy the dependentlibs.list file from the Contents/MacOS to the Contents/Resources directory, although XULRunner 33 seems to be getting on fine without it.
I've been attempting to implement the Perl script found here: best way to add license section to iOS settings bundle
I've followed the instructions given to a T but when I go to run my project I get the following error after changing the permissions of the script to CHMOD 755:
No such file or directory at ./LicenseScript.pl line 10.
Command /bin/sh failed with exit code 2
Why won't my app compile?
I am getting below error when taking checkout from svn using a script.
**[Test] $ /bin/sh -xe /tmp/hudson8576425899836211909.sh
+ sh /cvsrx/rxapp/build_dir/Jenkins_Scripts/test.sh
Could not load program svn:
Could not load module /opt/freeware/lib/libssl.so.
Dependent module /usr/lib/libcrypto.a(libcrypto.so.1.0.1) could not be loaded.
Member libcrypto.so.1.0.1 is not found in archive
Could not load module svn.
Dependent module /opt/freeware/lib/libssl.so could not be loaded.
Could not load module .
Build step 'Execute shell' marked build as failure
Finished: FAILURE**
In test.sh I have written just one line svn co /path to svn branch/
I am in middle of some test so please don't ask why am not using jenkins in build svn plugin.
here,I am able to take checkout on command prompt using svn co /path to svn branch/
But not if I write this command line in script and run in execute shell of jenkins.
Any help please ?
Am using jenkins on AIX 7 platform.
I had softlinks from /usr/bin/svn to /opt/freeware/bin/svn.SVN installed at /opt/freeware/bin/svn ..... By default when i do which svn its showing /usr/bin/svnBut When i deleted those softlinks and exported path,Jenkins didnt recognize SVN at all.And which svn command doesnot show any svn installed . PFB logs of jenkins :
`
/bin/sh -xe /tmp/hudson5607872610124977868.sh
+ export PATH=/opt/freeware/bin/svn/:/opt/freeware/bin/svnversion:/opt/freeware/bin/svn:/opt/freeware/bin/svnversion/:/usr/java5/lib:/opt/freeware/bin/svnversion/bin:/usr/local/bin:/usr/bin:/usr/X11R7/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/sbin:/
+ echo /opt/freeware/bin/svn/:/opt/freeware/bin/svnversion:/opt/freeware/bin/svn:/opt/freeware/bin/svnversion/:/usr/java5/lib:/opt/freeware/bin/svnversion/bin:/usr/local/bin:/usr/bin:/usr/X11R7/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/sbin:/opt/freeware/bin/svn/:/opt/freeware/bin/svnversion:/opt/freeware/bin/svn:/opt/freeware/bin/svnversion/:/usr/java5/lib:/opt/freeware/bin/svnversion/bin:/usr/local/bin:/usr/bin:/usr/X11R7/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/sbin
+ cd /usr/local/apps/Jenkins_new/scripts
+ ./test.sh
Could not load program /opt/freeware/bin/svn:
Could not load module /opt/freeware/lib/libssl.so.
Dependent module /usr/lib/libcrypto.a(libcrypto.so.1.0.1) could not be loaded.
Member libcrypto.so.1.0.1 is not found in archive
Could not load module svn.
Dependent module /opt/freeware/lib/libssl.so could not be loaded.
Could not load module .
./test.sh[3]: svn: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE`
ReInstalling Jenkins solved my problem !! It was due to corrupt plugin which happened due to server restart.
Thanks Everyone
I have not seen the exact command of svn you have used in test.sh, but would advice you to give full path of SVN in your calling line, eg /usr/bin/svn co .....
And if also possible make an entry in your test.sh for export PATH and export LD_LIBRARY_PATH setting them to values which are paths of the mentioned .so files
I see you're using Hudson/Jenkins. Hudson and Jenkins use SVNKit internally when checking stuff in and out of Subversion. This means that the command line svn client may not be installed on your system, or that it may have other problems.
It is also possible that there are multiple svn clients on your system. For example, you may have one under /usr/bin/svn and one under /usr/local/bin/svn. If Subversion is working from the command line, but not in the script, you may have a different $PATH setup when you're executing from the command line vs. the script from Hudson/Jenkins. You can add to your script (if it's BASH) the line type svn to see where your executing svn from. It may be different from what you are using from the command line. It may also be nice to print out $PATH as part of your script.
It would also be helpful to see the svn command that your script is executing, and tell us what you're trying to do. You can also add to your script the following lines:
PS4="\$LINE: "
set -xv
These lines will turn on shell script debugging, and help you locate where your script is having problems.
This will give you some clues as to what is going wrong in your script.
Reply
Thanks David. Here only 1 svn path exists (usr/bin/svn)but created as a softlink see -->cd /usr/bin/svn lrwxrwxrwx 1 root system 26 Jul 1 14:34 svn -> ../../opt/freeware/bin/svn. Also soflink of libs.so is created see --> lrwxrwxrwx 1 root system 15 Sep 13 18:15 libssl.so -> libssl.so.1.0.1 .......... Is it possible that softlink is creating these problems ?? Before requesting to remove these softlinks ,i need confirmation that these softlinks are creating problems.
Softlinking isn't unusual for Unix. For example, I have Ant, Grails, Maven, Subversion, and many other packages installed under /opt on my Mac. In order not to have to include each and every one of these in my path, I soft link all of the binaries for those programs under /usr/local/bin. About 80% of the programs under /usr/local/bin are merely soft links elsewhere.
Library soft links are also very common. This usually has to do with version numbering. When a program requests a library, it may or may not include the library's version number. So, you have libfoo-2.0.3.so on your drive. This is the actual version of foo. However, few programs will request that particular version. Instead, they may simply request they need Version #2 of foo or just say they need to link to foo.
To handle this, you will have libfoo2.0.3.so soft linked to libfoo-2.so for programs that specify they need version 2 of foo. Then, libfoo-2.so will be soft linked to libfoo.so. This way, libfoo will be called no matter what. If I install, libfoo2.0.4.so, I can change the link to libfoo-2.so to point to version 2.0.4 instead of version 2.0.3, and anything that depends upon Foo will be picking up the correct version.
Instead, let's look at the error message:
Could not load module /opt/freeware/lib/libssl.so.
Dependent module /usr/lib/libcrypto.a(libcrypto.so.1.0.1) could not be loaded.
Member libcrypto.so.1.0.1 is not found in archive
For some reason, it couldn't access the file /usr/lib/libcryto.a. Is this file on you machine? Is it in /usr/lib? If not, where is it located?
So, where did you get this version of Subversion from? Why is the link to the /opt/freeware/bin/ directory? Was this part of your system?
It could be that Subversion on your system is not complete and never did work. In Jenkins, the Subversion repository is accessed by the SVNKit Jarfile which is embedded inside Jenkins/Hudson itself, so it wouldn't really be a surprise to find that the Subversion binary didn't work.
Are you able to do anything with Subversion from the command line? If not, you may have to install a new version of Subversion from Perzl which is where CollabNet points to for an AIX version of Subversion. (It's at least up to date at version 1.8.4).
You may even want to change the soft link at /usr/bin/svn to point to the newer, working version of Subversion.
The system log on my Mac Mini is showing this error in the system log:
Mar 7 17:51:18 My-Mac-mini com.apple.launchd[1] (org.mongodb.mongod[432]): posix_spawn("/opt/local/bin/mongod", ...): No such file or directory
Mar 7 17:51:18 My-Mac-mini com.apple.launchd[1] (org.mongodb.mongod[432]): Exited with code: 1
Mar 7 17:51:18 My-Mac-mini com.apple.launchd[1] (org.mongodb.mongod): Throttling respawn: Will start in 10 seconds
I have install MONGODB using Brew, and it works properly.
I have used LOCATE to attempt to track the source of the launching PLIST (I guess).
How do I track the source of what Apple's "launchd" is attempting to run?
You can search the LaunchDaemons folders for that job label:
grep -Rl ">org\.mongodb\.mongod<" /System/Library/LaunchDaemons /Library/LaunchDaemons
(Note: the backslashes and angle-brackets in the search string are needed to avoid false matches, and if you don't have them wrapped in double-quotes, you'll get unexpected results.)
If it's installed using the standard conventions, it should be in /Library/LaunchDaemons/org.mongodb.mongod.plist, but this command should find it whatever it's named.
Once you've found it, you can disable it with:
sudo launchctl unload -w /Library/LaunchDaemons/org.mongodb.mongod.plist
(Or whatever the actual file path is.) If you want, you can also remove the file, but the -w option makes the unload permanent so that isn't really necessary.
Hmmm... did you have it installed with Macports at one time? Cause that looks like the location for the ports installation of it (whereas i would expect brew to put it in /usr/local). If that is the case then try doing
sudo port unload mongodb
and that should unload the posts specific plist which is probably registered to load at boot time. If you're going to use Brew id probably set about clearing out ports completely.