“Git submodule init requires perl. Cannot install Perl, am running CoreOS. Sadness.”
- https://twitter.com/glasnt/status/534926961957535744
I’ve been recently pushed head first into the land of CoreOS and Docker, attempting to get a consolidation of efforts together to get our Haskell project widgets in an automatically deployable, scalable state, and I hit this particular issue.
CoreOS doesn’t come with any scripting languages. Which is a good thing, because it means CoreOS is very light.
But it becomes an issue when executing git submodule ...
requires Perl.
$ git submodule init
/usr/libexec/git-core/git-submodule: line 159: perl: command not found
So I thought “why is this so?”, and executed a command I never thought I’d have to do:
git clone https://code.google.com/p/git-core/
A few minutes in the code base and I find that there’s a little shell file called git-submodule.sh
which has a function called module_list
that embeds raw Perl in order to do some fancy pattern matching. This method is used by about half the functions in the file, so it’s a little bit important.
The INSTALL file mentions that Perl is just in just a little bit of the system, but fails to mention this submodule limitation.
The work around? git clone <submodule repo>
in my repo.
The actual fix? Work out how/if you can do the same sort of functionality in pure shell.
Probaility of success - probably limited.
It’s always interesting, however, to see that even some of the fundemental Linux constructs are just shell, Perl and C all the way down.