-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo build with dependencies fails on Cygwin referring to git-core/templates #1295
Comments
It seems to fail even when I try to explicitly change the init.templatedir on the local git config. I was using Which changed the local config to point to the windows style path. But running cargo build still resulted in the same error. |
Also tried setting the $GIT_TEMPLATE_DIR environment variable to a windows compatible path. I have set it on both Windows native environment variables and Cygwin environment variables, the libgit2 in Cargo doesn't seem to look up the $GIT_TEMPLATE_DIR. See: http://git-scm.com/docs/git-init#_template_directory The environment variable should have higher precedence than any configuration. |
Fixed this by doing a global git config:
So therefore my conclusions are, why is Cargo's libgit2 not respecting |
I think that dealing with cygwin-related paths and such is not necessarily under Cargo's or libgit2's purview. I think that you'll get much more mileage just using windows paths everywhere unless you know for a fact that the tool is controlled by cygwin. For dealing with |
I put an issue on libgit2 libgit2/libgit2#2910 With regards to the Basically if I run:
Cargo build works. If I run instead:
Cargo build doesn't work. This means Cargo build's libgit2 is not taking into account the locally configured path only the global path. There's also a thing called The git template directory according to the git documentation says that it should be queried in this order: GIT_TEMPLATE_DIR, local config, global config, system config, default path. |
So the behavior you're looking for is that the local |
I see what you mean, I was unaware of git clone being considered a global command. It's just that it kind of makes sense if you start a repo, change the init.templatedir for that current repo, and then run git clone or whatever libgit2 is doing in order to bring in dependencies for that particular project's repo. Otherwise, what's the point of having a local init.templatedir then? |
Ah what I mean is that the checkout of git repositories is a global operation because all Cargo projects share the same cache for git dependencies. I would expect a clone of a submodule, for example, to use the local |
Ok, so we are in agreement that the local He said libgit2 doesn't check environment variables. But can be passed configuration paths. Perhaps this means cargo should be checking them and passing the correct configuration path? (Specifically the local init.templatedir). |
I think I may not quite yet grapple what |
After trying
cargo build --verbose
on a project in Cygwin with a single dependency, this is the output:/cygdrive/c/cygwin64/usr/share/git-core/templates/
does exist, since I went there and saw stuff in it.Perhaps this has something to do with cygwin pathing issues? The Cargo is a windows 64 bit build. Which I suspect means that Cargo is taking the cygwin PATH of
/cygdrive/c/cygwin64/usr/share/git-core/templates/
and trying to access it, which would not be possible through a windows executable. My git is not a windows based git, is supplied from Cygwin's git.which git
returns/usr/bin/git
.It can be fixed by utilising something like cygpath in order to convert unix style paths into windows style paths:
But of course you don't want to use cygpath executable. Perhaps in the Windows version of Cargo you can detect whether the path looks like a cygwin style PATH, and convert it directly. All Cygwin paths always start with
/cygdrive/
.Cargo version:
cargo 0.0.1-pre-nightly (9404539 2015-02-09 20:54:26 +0000)
The text was updated successfully, but these errors were encountered: