Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cvs broken on MacOs-Catalina? (cannot get working directory)

I've just upgraded my Mac to Catalina and cvs does not seem to be working. Almost every command I try gives me a variant on the error:

cvs [init aborted]: cannot get working directory: No such file or directory

This is true not just for existing repositories, but if I try to set up a new repository or a new cvsroot (as above).

I've tried re-installing cvs via Homebrew but the problem remains.

Is anyone else experiencing this and does anyone have suggestions for workarounds? (Obviously I could shift this stuff to git or similar, but its mostly legacy projects and I'm not that enthusiastic to go to the effort)

like image 709
Louise Dennis Avatar asked Oct 10 '19 19:10

Louise Dennis


Video Answer


2 Answers

In case you have homebrew:

brew remove cvs
brew install cvs

did the trick for me. The new binary will be in /usr/local/bin/cvs, make sure you call that binary and not the catalina one (in /usr/bin/cvs)
Simply typing "brew update; brew upgrade" - what you should do after an OS upgrade - will not be enough.

like image 79
digitalhippie Avatar answered Sep 18 '22 11:09

digitalhippie


cannot get working directory only exists one place in the CVS source code, so was pretty easy to track it down to something awry in xgetcwd(). xgetcwd() eventually calls getcwd(), but apparently isn't using the version defined in unistd.h in Catalina, but its own version from "getcwd.h" which is included in the CVS source.

I don't have the time to track down why it works pre-Catalina, but the following patch forces the issue and worked for me on 10.15.

--- cvs-1.12.13/lib/xgetcwd.c.orig      2019-10-10 22:52:37.000000000 -0500
+++ cvs-1.12.13/lib/xgetcwd.c   2019-10-10 22:53:32.000000000 -0500
@@ -26,8 +26,9 @@

 #include <errno.h>
 #include <limits.h>
+#include <unistd.h>

-#include "getcwd.h"
+/* #include "getcwd.h" */
 #include "xalloc.h"

 /* Return the current directory, newly allocated.
like image 21
Jason White Avatar answered Sep 20 '22 11:09

Jason White