Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Case sensitive imports in docker mounted directory fails (grouped write of manifest, lock and vendor: rename fallback failed) #1362

Closed
andy-h-123 opened this issue Nov 9, 2017 · 3 comments

Comments

@andy-h-123
Copy link

andy-h-123 commented Nov 9, 2017

What version of dep are you using (dep version)?

v0.3.2-48-gc47c866e

What dep command did you run?

dep ensure -v
and
dep init -v

What did you expect to see?

[root@1924b8acf468 new_working]# dep init -v
Getting direct dependencies...
Checked 1 directories for packages.
Found 2 direct dependencies.
Root project is "new_working"
 1 transitively valid internal packages
 2 external packages imported from 2 projects
(0)   ✓ select (root)
(1)	? attempt github.com/Andy-tn/testa with 1 pkgs; 1 versions to try
(1)	    try github.com/Andy-tn/testa@master
(1)	✓ select github.com/Andy-tn/testa@master w/1 pkgs
(2)	? attempt github.com/andy-tn/testb with 1 pkgs; 1 versions to try
(2)	    try github.com/andy-tn/testb@master
(2)	✓ select github.com/andy-tn/testb@master w/1 pkgs
  ✓ found solution with 2 packages from 2 projects

Solver wall times by segment:
     b-list-versions: 1.416820603s
         b-list-pkgs: 201.106367ms
              b-gmal: 200.402658ms
         select-root:   1.000953ms
         select-atom:    286.605µs
            new-atom:     184.18µs
             satisfy:    143.789µs
               other:     56.393µs
     b-source-exists:      7.444µs
  b-deduce-proj-root:      1.065µs

  TOTAL: 1.820010057s

  Using master as constraint for direct dep github.com/Andy-tn/testa
  Locking in master (b19e546) for direct dep github.com/Andy-tn/testa
  Using master as constraint for direct dep github.com/andy-tn/testb
  Locking in master (f109264) for direct dep github.com/andy-tn/testb
(1/2) Wrote github.com/Andy-tn/testa@master
(2/2) Wrote github.com/andy-tn/testb@master
[root@1924b8acf468 new_working]# dep ensure -v
Gopkg.lock was already in sync with imports and Gopkg.toml
(1/2) Wrote github.com/andy-tn/testb@master
(2/2) Wrote github.com/Andy-tn/testa@master

What did you see instead?

[root@1924b8acf468 working]# dep init -v
Getting direct dependencies...
Checked 1 directories for packages.
Found 2 direct dependencies.
Root project is "working"
 1 transitively valid internal packages
 2 external packages imported from 2 projects
(0)   ✓ select (root)
(1)	? attempt github.com/Andy-tn/testa with 1 pkgs; 1 versions to try
(1)	    try github.com/Andy-tn/testa@master
(1)	✓ select github.com/Andy-tn/testa@master w/1 pkgs
(2)	? attempt github.com/andy-tn/testb with 1 pkgs; 1 versions to try
(2)	    try github.com/andy-tn/testb@master
(2)	✓ select github.com/andy-tn/testb@master w/1 pkgs
  ✓ found solution with 2 packages from 2 projects

Solver wall times by segment:
     b-list-versions: 1.441414873s
         b-list-pkgs: 212.806489ms
              b-gmal: 205.144705ms
         select-root:     433.25µs
            new-atom:    272.972µs
         select-atom:    250.706µs
             satisfy:    169.285µs
               other:     14.572µs
     b-source-exists:      4.787µs
  b-deduce-proj-root:      2.738µs

  TOTAL: 1.860514377s

  Using master as constraint for direct dep github.com/Andy-tn/testa
  Locking in master (b19e546) for direct dep github.com/Andy-tn/testa
  Using master as constraint for direct dep github.com/andy-tn/testb
  Locking in master (f109264) for direct dep github.com/andy-tn/testb
(1/2) Wrote github.com/Andy-tn/testa@master
(2/2) Wrote github.com/andy-tn/testb@master
safe write of manifest and lock: rename fallback failed: cannot rename /tmp/dep133929297/vendor to /root/go/src/working/vendor: copying directory failed: copying directory failed: copying directory failed: destination already exists
[root@1924b8acf468 working]# dep ensure -v
Gopkg.lock was already in sync with imports and Gopkg.toml
(1/2) Wrote github.com/Andy-tn/testa@master
(2/2) Wrote github.com/andy-tn/testb@master
grouped write of manifest, lock and vendor: rename fallback failed: cannot rename /tmp/dep829476308/vendor to /root/go/src/working/vendor: copying directory failed: copying directory failed: copying directory failed: destination already exists

Context

I have narrowed this down to being an issue with 2 imports from the same github area but with different case e.g. andy-tn and Andy-tn. But it only seems to be an issue when building in a docker container, in a docker mounted directory. Very simple example, with the code

package main

import (
	"github.com/andy-tn/testb"
	"github.com/Andy-tn/testa"
)

func main() {
	testa.Test()
	testb.Test()
}

I can run dep init and dep ensure natively on my mac, or in a docker container in any directory that was not mounted, everything works as expected. However if I run it in a mounted directory (e.g. the directory /root/go/src/working if run with docker run -it -v /my/src:/root/go/src/working my-container bash) I get the error grouped write of manifest, lock and vendor: rename fallback failed: cannot rename /tmp/dep829476308/vendor to /root/go/src/working/vendor: copying directory failed: copying directory failed: copying directory failed: destination already exists. (Docker image is nothing special just a vanilla fedora 26 with golang and git installed)

@andy-h-123
Copy link
Author

andy-h-123 commented Nov 9, 2017

obviously the main issue here is the inconsistent use of github project area names in the code, not with dep (so easily fixed in client code), but as dep handles it in other situations thought it best to highlight to you

@andy-h-123 andy-h-123 changed the title Case sensitive imports in docker mounted directory Case sensitive imports in docker mounted directory fails Nov 9, 2017
@andy-h-123 andy-h-123 changed the title Case sensitive imports in docker mounted directory fails Case sensitive imports in docker mounted directory fails (grouped write of manifest, lock and vendor: rename fallback failed) Nov 9, 2017
@ibrasho
Copy link
Collaborator

ibrasho commented Nov 11, 2017

@sdboyer: Shouldn't #1079 cover this case? Or am I missing something?

@sdboyer
Copy link
Member

sdboyer commented Nov 12, 2017

hohummm. this is interesting.

the problem here seems subtly different as the main one we were testing for, inasmuch as it has the case-only variation accompanied by a non-case variation... and all above the root point. clearly i missed something on the edge, here.

this seems more contrived, and this less pressing than the original issue, but it still needs fixing. I'll see if I can have a look this week.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants