The working copy requires a newer version of Subversion than Xcode supports - xcode

I just installed Xcode 4.6 (I had Xcode 4.5.1). I just opened an existing project and got this message:
The working copy "path/to/my project" requires a newer version of Subversion than Xcode supports.
I am currently using Cornerstone for svn, and understand that I can probably ignore this message - but since I want to be up-to-date, what do I need to do to resolve this issue?

The Xcode 4.6 default use the SVN 1.6.X, but you project's SVN info maybe 1.7.X (That may update by Cornerstone). As a result, when you try to update, the error message'll show. So we have to let the Xcode use the latest 1.7.X SVN.
I also met the same problem. That's my solution:
Install the Homebrew, we'll use it to install the latest SVN:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
install the latest SVN:
brew install subversion
Backup the old SVN file and link the latest SVN:
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
mkdir bak.svn
mv svn* bak.svn
ln -s /usr/local/Cellar/subversion/1.7.8/bin/svn* /Applications/Xcode.app/Contents/Developer/usr/bin/
Restart Xcode

In my case, the latest SVN placed at path /usr/bin/, therefore the step 3 will look like this:
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
mkdir bak.svn
mv svn* bak.svn
ln -s /usr/bin/svn* /Applications/Xcode.app/Contents/Developer/usr/bin/

Related

Mac command line tools 11.4 no longer has svn

I just updated XCode and the command line tools to 11.4. Now when I run svn it says "svn: error: The subversion command line tools are no longer provided by Xcode". The release notes say "Command line tool support for Subversion — including svn, git-svn, and related commands is no longer provided by Xcode. If you need Subversion or related command line tools the you need to install the Command Line Tools package by running xcode-select --install." I seem to be in a loop here, as the tools are installed. Has anyone experienced this problem and resolved it?
macOS Catalina
I had the same issue after upgrading to Catalina 10.15. It's clearly mentioned in the Apple website that SVN is deprecated in Xcode 11:
You can find it here: https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes
Command line tool support for Subversion — including svn, git-svn, and related commands — is no longer provided by Xcode.
The solution is to install the standalone Command Line Tools package instead:
sudo rm -rf /Library/Developer/CommandLineTools
followed by:
sudo xcode-select --install
This will replace the bundled Command Line Tools with the standalone package.
If it doesn't work for you then try to install it with brew.
brew install svn
brew is a package manager for MacOS so if you don't have it installed then you can simply install it: https://brew.sh/
macOS Big Sur
I faced the same issue Today (16th November 2020) after upgrading to MacOS Big Sur. I was able to fix it by installing the SVN again using brew install svn command.
If you faced permission errors after running above command, you can fix it by running following command.
sudo chown -R $(whoami) /usr/local/*
brew install svn
in Xcode 11.4. Svn has been removed.
I had same issue from Netbeans and have done the following from command line and now all fine
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install svn
Coming from a FreeBSD background we elected to install SVN via MacPorts which is akin to FreeBSD Ports. So basically one would first need to install MacPorts and then install SVN as follows:
sudo port install subversion
Some details -
Install MacPorts: https://www.macports.org/install.php
Install SVN: https://trac.macports.org/wiki/howto/Subversion
It took less than five(5) minutes and works well for us.
I switched to SVNKIT which works very well for my purposes. Since I'm doing a lot of Java development is no drawback for me that SVNKIT is based on Java.
The big advantage is that SVNKIT will still work even if Apple throws SVN out completely.
I found svn still available on my Mac (upgraded from 10.15.x -> Big Sur, including XCode upgrade) in
/Library/Developer/CommandLineTools/usr/bin/svn
In the Apple Developers forum I read the suggestion to make an alias, which worked for me. However, considering svn is being dropped by Apple, this will probably not work on new installs, but it could be useful for those of us that just want it to work for now after upgrading.
alias svn=/Library/Developer/CommandLineTools/usr/bin/svn
Note: I found it easier to just make a symbolic link to svn:
ln -s /Library/Developer/CommandLineTools/usr/bin/svn /usr/local/bin/svn
my mac os version is macOs Catalina 10.15.5,I try
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
brew install svn
but it not work.so I try to install with source code.It's work!
tar xvf subversion-1.14.0.tar.gz
cd subversion-1.14.0
./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util
make
now,you can find it in /usr/local/bin/
Based partly on the other answers here, I built from source with this procedure:
Download & unpack svn source tarball (NOT zip file!) from
https://subversion.apache.org/download.cgi
cd subversion-1.14.0
./get-deps (this seems to have downloaded apr and apr-util but not
built them)
cd apr
sudo mkdir /usr/local/opt
(because I did not already have such a directory on a fresh Mac)
./configure --prefix=/usr/local/opt/apr
make
make test
(saw lots of "OK" and "SUCCESS", plus one failure in "testsock")
sudo make install
cd ../apr-util
./configure --prefix=/usr/local/opt/apr-util --with-apr=/usr/local/opt/apr
cd ..
make
./configure --with-apr=/usr/local/opt/apr --with-apr-util=/usr/local/opt/apr-util --with-lz4=internal --with-utf8proc=internal
make
sudo make install
The top instructions (removing the command line tools, xcode-select --install, and brew install svn) worked for me (Monterey, 12.5.1, on an M1 pro). Thanks!
However, after I did the brew install, I had to manually remove the old svn version from /opt/local/bin before the new version would run. (discovered with $ which svn). Might be the result of migrating from the old laptop to the new one.

How to install older version(1.6.18) svn on MAC

The MAC provide the #1.7.10 SVN client, but my project is using #1.6.18 SVN.
So that I received the error message "Working copy is too old (format 10, created by Subversion 1.6)"
Current I CANNOT upgrade my project svn version. So I think the only way for me is re-install the older version SVN. (please kindly advise me if there is better solution)
And my questions are:
Can I use the #1.7 SVN client on #1.6 SVN working copy? IF NO
How can I uninstall older SVN and re-install older version SVN?
Thanks for your help.
There's no problem using version 1.7.10 even if your server is 1.6.8. What you shouldn't do is share working copies between systems. There is no guarantee that one Subversion client will use the same working copy format as another. For example, some Windows clients use _svn directories instead of .svn directories -- especially for VisualStudio development.
For the longest time, most clients used the default Subversion client format that has pretty much remained unchanged until the 1.7 client. In that client, the .svn folders found in each directory were removed to have just a single .svn folder in the root of the directory. This makes the 1.7 command line client working copy incompatible with the earlier formats.
You never explained how your Mac has a 1.6.8 working copy on it. Is it that you have some sort of GUI client on your Mac that is using the older format, or do you have a share that you use on two different systems. If you're doing the latter, don't. Check out a separate working copy on each system.
If you need to share changes between working copy without doing a commit, use the svn diff command to create a patch file. Then use svn patch to apply this patch file to the other working copy.
A 1.7 client can work on a 1.6 WC after you execute svn upgrade. After that event, 1.6 clients will not be able to use that working copy.
You can install another version of SVN to a non-default path, and either put that path earlier in your $PATH environment variable, or specify the full path to the binary each time you use it (if you go this route, you can create an alias in your shell to simplify it, but be careful as you might get confused as to which svn is which)
Install the older version in a location on your path that is either higher than the default implementation.
i.e. svn is installed in /usr/bin/ by default (as I can see on my system) but usr/local/bin is higher in my PATH, so if I were to do this I would install the older version in usr/local/bin
There is another way. You can rollback from 1.7 (should work on Mavericks) to 1.6.
Save your existing 1.7 install to another folder
sudo mv /usr/bin/svn* ~/Documents/svn_1.7
Install XCode and symlink the 1.6 version from there
/Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svn /usr/bin/svn
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svnadmin /usr/bin/svnadmin
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svndumpfilter /usr/bin/svndumpfilter
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svnlook /usr/bin/svnlook
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svnserve /usr/bin/svnserve
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svnsync /usr/bin/svnsync
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/subversion-1.6/bin/svnversion /usr/bin/svnversion
Voila!

How to update my version of git on OSX 10.8

I'm on OSX 10.8.2 and I'm running git git v1.7.4.4
I just installed git on a remote server and it's version 1.11.x. I'm I would like to be running the same version of the software but I cannot figure out how to update git on my laptop.
I attempted to follow the steps listed here, which instruct to download the git-OSX-installer, run the install (which ran smoothly) and then do:
$ sudo mkdir -p /usr/local/bin
$ sudo ln -s /usr/local/git/bin/git /usr/local/bin/git
But after this I do git --version and it's still 1.7.4.4. Did I just reinstall the same version? Or did I install a newer version somewhere else?
I've been reading similar questions and I think the issue is that OSX ships with an old version of git installed in a different location then where the git-osx-installer or mac ports will put it. But I'm not sure how to correct this. Thanks in advance for your advice.
Update:
which git returns:
/usr/bin/git
echo $PATH returns:
/opt/local/bin:/opt/local/sbin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194#global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin
Update2:
ESL ~/Downloads$ export PATH=/usr/local/bin:$PATH
ESL ~/Downloads$ which git
/usr/local/bin/git
ESL ~/Downloads$
ESL ~/Downloads$ git --version
git version 1.8.1.3
It appears I installed the newer git version in local. So should I add the export PATH=/usr/local/bin:$PATH to my .bash_profile? Is it a problem that both versions of git are installed?
I added export PATH=/usr/local/bin:$PATH to the bottom of my ~/.bash_profile and now the new version of git runs.
The best way to update any binary on a Mac OSX machine is to use the package(s) developed specifically for Mac (a .dmg or .pkg download).
In the case of git this is at: http://git-scm.com/download/mac
(clicking on this link should automatically start the download of the latest version of git for Mac).
However, in this case (at least for my 10.8.3 MacBook) this was not quite the whole story: the package installs git in /usr/local/git and then adds that path at the end of $PATH - which defeats the whole purpose IMO.
I have manually modified my .bashrc so as to have something similar to what suggested above:
export PATH=/usr/local/git/bin:$PATH
Once you do that, you should see the correct version of git being picked:
$ git --version
git version 1.8.2.2
Note that this won't work for any app that is launched interactively (eg, via the docking bar) - you'll have to run the additional script provided in the downloaded package; see the README for instructions.
Since /usr/bin shows up before /usr/local/bin in your path, the git executable in /usr/bin will be given precedence.
try this in your shell:
export PATH=/usr/local/bin:$PATH
which git
On a side note, I'd strongly recommend using homebrew for managing installations such as this on macos
I had a similar issue in Cygwin (linux environment compiled for windows). I would do
which git
and it would respond with the correct location of the updated git compiled from source, but wouldn't actually use it until I did
hash -r git
I don't claim to understand what this did or why it had to be done, but after that git --version replied with '1.8.2.rc0.22.gb3600c3' which was clearly no longer the old git shipped with Cygwin. This may not apply to OSX, but give it a shot if which git is locating the updated binary.

Git command "git svn rebase" not working with XCode 4.3.1

I have cloned few SVN Project on my system, I used to do "git svn rebase" to sync them up with SVN Repositories. Now after updating XCode to version 4.3.1, this command stopped working.
Executing "git svn rebase" on my mac (v 10.7.3) gives me error "git: 'svn' is not a git command".
I suspect, Apple is no longer installing git-svn with new XCode. Do anybody has any idea, how to fix this issue?
Thanks.
I'm quite sure git-svn never came included in the command line tools but I might be wrong. Anyhow, that's not the point, use macports (or any alike, it just happens I use this one) to get it installed:
$> sudo port selfupdate
$> sudo port variants git-core
Here you're shown the different variants for a given port (in this case git-core), and amongst them there is the one we need:
...
svn: Bi-directional subversion repository support
...
We install it by typing
$> sudo port install git-core +svn
And off you go, you should be able to use git-svn again!

Unable to get MacPort functionality after installing Xcode 4.3

I am having trouble getting MacPorts to function properly. I just installed OSX Lion 10.7.3 I downloaded and installed MacPorts first, and then after reading the requirements, I downloaded Xcode4.3 from the App Store, and then installed it. I launched Xcode and it looks to be operational and functional. However when I attempted to port with MacPorts, it gave me this error message(excerpt):
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
I followed the advice from:
How do i install additional packages for Xcode on OSX Lion to allow MacPorts to work
and installed command_line_tools_for_xcode from the Preferences within Xcode. I closed Xcode, and again got the errors:
$ sudo port install libsocketsPassword:
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
---> Computing dependencies for libsockets
---> Dependencies to be installed: openssl zlib
---> Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').
Error:
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error:
Error: Target org.macports.extract returned: unable to find Xcode
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: openssl zlib
Error: Status 1 encountered during processing.
I am uncertain where to go next with this. How do i trouble shoot my Xcode and MacPort interface?
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
(And you've installed the optional command line tools)
Everything will start working fine after installation of "Command Line Tools for Xcode" package.
You can get it from here: https://developer.apple.com/downloads/index.action#
Please see the MacPorts migration instructions for Xcode 4.3.
The instructions are pretty involved. You need to run xcode-select to set a new tools path, update developer_dir in macports.conf (as described by Henk Poley), re-install MacPorts (ouch), and finally uninstall and re-install all of your ports (double ouch).
Edit: libpvx still wouldn't install after the above. Two extra steps were required:
sudo ln -s /Developer /
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /SDKs
YMMV if you have different ports installed!
Also in /opt/local/etc/macports/macports.conf change the line with developer_dir to point to / instead of /Developer.
After
sudo xcode-select -switch /Applications/Xcode.app
I also had to run
sudo xcodebuild -license
and accept the licence
Here is a solution that has worked for me:
Install Command Line Tools for Xcode
Xcode -> Preferences -> Downloads
Help MacPorts find the right Xcode folder
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app
Create symbolic links for clang compilers as they now live elsewhere
sudo ln -s `which clang` /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s `which clang++` /Applications/Xcode.app/Contents/Developer/usr/bin/
Try using trunk, there's no release supporting Xcode 4.3 yet.
Setting the developer path in /opt/local/etc/macports.conf works for me,
developer_dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
since most of the compilers are stored there now instead of /usr/bin under Developer.
None of this works for me. Wait for macports to release a new version that officially supports XCode 4.3+
sudo mv /usr/bin/xcodebuild /usr/bin/xcodebuild.old
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild /usr/bin/xcodebuild
Starting with Xcode 4.3, the command-line build tools are not installed by default. Launch Xcode, open the Preferences, and go to the Downloads tab. From there you should have an option to install the command-line tools.
You can also download them from the web here: https://developer.apple.com/downloads/index.action
Disclaimer: I haven't installed Xcode 4.3 yet. I have only read about it on the web.
As of 27/2/2012, the official suggestion from MacPorts seems to be to not use XCode 4.3 and instead use 4.1 through 4.2.1, which can be downloaded from Apple.
There is a bug ticket which might be useful to follow the evolution of this.
Incidentally, and as reported in my comment #11 in that bug report, I am able to build ports without warnings by using the 2 most sane-looking suggestions found in this question: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer and changing developer_dir in /opt/local/etc/macports/macports.conf to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
I have macports installed without admin/root privileges, so I was unable to test the xcode-select answers. However, I observed that Pall Melsted's answer worked, but not initially. What I found out was that I had not accepted the Xcode 4.5 license agreement!
If you have just installed Xcode for the purposes of macports, and you haven't accepted the Xcode license yet, you might get the error presented by the original post. When I checked my Xcode version using /usr/bin/xcodebuild -version, I was given the prompt to read and accept the license. After doing so, and after having made the changes suggested by Pall to the macports.conf developer_dir, it all works now.
As alternative: you can make downgrade of Xcode to 4.2.1 version. DMG of Xcode 4.2.1 placed here: https://developer.apple.com/downloads/index.action
After this MacPorts became works fine for me.
This is fixed in MacPorts 2.0.4.
To upgrade:
Download MacPorts 2.0.4 from the install site or run sudo port selfupdate.
Run the MacPorts migration described here to reinstall all ports. This is painful but required to get back to a working state.
You should definitely run sudo xcode-select -switch /Applications/Xcode.app like everyone here says, that'll fix many problems, but certainly not all.
Afaik, all the remaining problems exist within the configuration information for various packages. You might simply reinstall MacPorts as described in the migration instructions, but I found another solution.
You should begin finding all effected port files using commands like grep /Developer/ ..., after executing sudo bash and cd /opt/local naturally.
You should identify all effected ports by using port provides ..., which I piped through sed and sort | uniq. You could simply reinstall all these ports using either port -n upgrade --force ... or separate port uninstall ... and port install ... commands.
I recommend using one large port -n upgrade --force ... command to avoid duplicate rebuilds of dependencies, using the separate uninstall and install commands afterwards.
There are of course various ports for which /Developer exists only inside text config files, meaning you can fix them manually with sed -i -e 's/\/Developer//g' ..., but you cannot do so with binaries obviously.
I'm afraid you must at minimum rebuild all your Python and Perl installations, making this upgrade an ideal time to clean out packages that depend upon older versions, ala python26 and perl5.8.
There are several technically effected ports I decided against rebuilding like fuse4x-kext, who contained /Developer inside Library/Extensions/fuse4x.kext/Contents/MacOS/fuse4x but hasn't prevented sshfs from working correctly.
I had initially installed xcode 3.2.2, after which I installed 4.3. When I ran the xcode-select, I still got the same error about no xcode project in /Applications. I then dug into the /usr/bin/xcodebuild script and found out that this was working correctly, and another instance of xcodebuild (the one installed with xcode 4.3, not the one in /usr/bin) was being run and returning the error:
xcodebuild: error: The directory /Applications does not contain an Xcode project.
It seems the /usr/bin/xcode-select does not work for xcode 4.3, (it's compiled so you can't really see why it's not working). Strings doesn't give any clues. Good thing osx has strace.. oh wait.
Anyways, the best I could do was modify /opt/local/etc/macports.conf
and uncomment the line containing the path to the xcode installation. That seems to fix my problem for the most part.

Resources