Skip to content

Failing tests involving Path comparisons #20

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

Closed
IvanUkhov opened this issue Nov 14, 2014 · 5 comments
Closed

Failing tests involving Path comparisons #20

IvanUkhov opened this issue Nov 14, 2014 · 5 comments

Comments

@IvanUkhov
Copy link

Hello,

I tried to run the test suite on a mac and got three failures:

  • repo::tests::smoke_discover,
  • repo::tests::smoke_open, and
  • repo::tests::smoke_open_bare.

All three fail when they assert that two Paths are equal. The reason is that TempDir returns paths like

/var/folders/gj/wwyd13hx79d7fffdfhw19gg80000gn/T/rs-74979-28-test

and libgit2 (that is, git_repository_path) returns paths like

/private/var/folders/gj/wwyd13hx79d7fffdfhw19gg80000gn/T/rs-74979-28-test

On a mac, /var is symlinked to /privite/var.

I don’t think that many people are suffering from this, and addressing this issue is probably not worth it. In any case, I hope it can be helpful. Thank you.

Regards,
Ivan

@lightsofapollo
Copy link

:/ yeah hitting this too underlying issue is we need path resolvepath/realpath (which seems to only be part of the rust compiler at this stage)

@alexcrichton
Copy link
Member

cc rust-lang/rust#11857 (issue for realpath)

@thommay
Copy link

thommay commented Dec 23, 2014

So this (I assume) winds up screwing me when I do cargo new:

> cargo new  --travis --git --verbose glacier-rs
Failed to create project `glacier-rs` at `/Users/thom/projects/glacier-rs`

Caused by:
  [2] Could not find '~/lib/git/' to stat: No such file or directory

> git config --get init.templatedir
~/lib/git
> ls -la ~/lib/git
lrwxr-xr-x  1 thom  staff  29 25 Jun 18:20 /Users/thom/lib/git -> /Users/thom/.dotfiles/lib/git

Changing init.templatedir to be /Users/thom/.dotfiles/lib/git allows cargo new to complete successfully.

@alexcrichton
Copy link
Member

Hm I'd be surprised if this affected cargo new, as this specific issue I believe is only related to assertions in tests.

If you change init.templatedir to /Users/thom/lib/git, does that allow cargo new to succeed? I'm curious if libgit2 is misinterpreting the ~ in the config option.

@thommay
Copy link

thommay commented Dec 24, 2014

ah, my bad jumping on issues. Yes, it works correctly given the full path
to the symlink.

On Tue, Dec 23, 2014 at 7:39 PM, Alex Crichton [email protected]
wrote:

Hm I'd be surprised if this affected cargo new, as this specific issue I
believe is only related to assertions in tests.

If you change init.templatedir to /Users/thom/lib/git, does that allow cargo
new to succeed? I'm curious if libgit2 is misinterpreting the ~ in the
config option.


Reply to this email directly or view it on GitHub
https://github.com/alexcrichton/git2-rs/issues/20#issuecomment-67990067.

alexcrichton added a commit that referenced this issue Jan 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants