Skip to content
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

(regression?) ipfs add -r does not follow symlink directories on Windows #4750

Closed
Mithgol opened this issue Mar 1, 2018 · 3 comments
Closed
Assignees
Labels
kind/bug A bug in existing code (including security flaws) topic/windows Windows specific

Comments

@Mithgol
Copy link

Mithgol commented Mar 1, 2018

Version information:

go-ipfs version: 0.4.13-
Repo version: 6
System version: amd64/windows
Golang version: go1.9.2

Type:

Bug

Description:

In go-ipfs version 0.4.10 the command ipfs add -r directoryName where directoryName is a name of a directory symlink (created by mklink /D) worked fine on Windows (i.e. go-ipfs followed a symlink and added the linked directory's contents recursively).

Having upgraded to go-ipfs version 0.4.13 I have immediately noticed that the same command does not work any longer and outputs the following (where my directoryName is shared_singular):

added Qmd9avPa5ebj7ei5tmuzH1tf97Yd1VU6XFYHLm4krdNqyK shared_singular
 0 B / ? [-------------------------------------------------------------------=]

Also go-ipfs 0.4.13 seems to exit prematurely in such case, as indicated by the following:

  • the character ? is still visible after the slash in the progress bar;

  • the newline character is not inserted after the progress bar (for example, if go-ipfs is called in a batch file and immediately followed by the pause command, then the output of pause immediately follows the last -=] characters instead of a new line).

This bug can be reilably reproduced by running mkdir testDir and mklink /D testLink testDir and finally ipfs add -r testLink all in the same (previously clean) directory on Windows. (Though you may want to put some files in testDir after its creation to make it more obvious that these files are ignored by go-ipfs.)

@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) topic/windows Windows specific labels Mar 1, 2018
@djdv djdv mentioned this issue Mar 12, 2018
9 tasks
@djdv djdv self-assigned this Mar 30, 2018
@djdv
Copy link
Contributor

djdv commented Apr 9, 2018

@Mithgol
I believe this is the intended behaviour. #2839 (comment)
If you run ipfs object get Qmd9avPa5ebj7ei5tmuzH1tf97Yd1VU6XFYHLm4krdNqyK you can see that the link was in fact stored. H:\\dataIPFS\\shared_singular but the contents were not.
Like git, go-ipfs will store links as links.

However, there should be an option for add that lets us store the target instead of the link itself.
I will be looking into this.

@djdv
Copy link
Contributor

djdv commented Apr 9, 2018

Relevant: ipfs/go-ipfs-cmds#96

@djdv
Copy link
Contributor

djdv commented Feb 1, 2019

@Mithgol
This was resolved but I forgot to report back here. My bad!

ipfs add now supports a --dereference-args option to resolve link arguments.

@djdv djdv closed this as completed Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/windows Windows specific
Projects
None yet
Development

No branches or pull requests

3 participants