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

Error: invalid cross-device link #30

Closed
codevin opened this issue May 14, 2022 · 14 comments · Fixed by #50
Closed

Error: invalid cross-device link #30

codevin opened this issue May 14, 2022 · 14 comments · Fixed by #50

Comments

@codevin
Copy link

codevin commented May 14, 2022

When I did 'bud create ff-bud', I got this error:
| rename /tmp/bud-create-3425471412 ff-bud: invalid cross-device link
Possibly because /tmp is different partition than the current directory. Rename will work only in same partition?

@matthewmueller
Copy link
Contributor

matthewmueller commented May 14, 2022

Ah interesting, can you test if Go's os.Rename() works across your partition?

@codevin
Copy link
Author

codevin commented May 14, 2022 via email

@codevin
Copy link
Author

codevin commented May 14, 2022

Usually /tmp will be different partition, and so it is common problem.

Workaround: Create a subdir in /tmp itself, and in that run the bud command to create the app. After that, move the directory to desired location.

(To solve this problem in bud, there are Copy directory packages in golang. They can be used, and the /tmp dir deleted. )

@codevin
Copy link
Author

codevin commented May 14, 2022

Oh no. Bud uses rename even during many other steps, say when we do bud run...

@matthewmueller
Copy link
Contributor

matthewmueller commented May 14, 2022

Usually /tmp will be different partition, and so it is common problem.

This does indeed seem like a pretty common problem that we'll want to fix.

Workaround: Create a subdir in /tmp itself, and in that run the bud command to create the app. After that, move the directory to desired location.

Not sure I'm following. Wouldn't /tmp/subdir also be in a different partition? Do you mind elaborating?

@codevin
Copy link
Author

codevin commented May 15, 2022 via email

@matthewmueller
Copy link
Contributor

matthewmueller commented May 15, 2022

When /tmp is in separate partition, all its subdirectories are obviously in
the same partition. So rename will work properly.

But wouldn't your app still be on a separate partition? To not end up in weird states, Bud builds into /tmp and then renames the directory into /your_app.


I'm tempted to move the cache and tmp directories into your project's bud build directory Most people will .gitignore that directory anyways. I was thinking of doing this earlier to keep everything self-contained, but wasn't sure if it was worth cluttering up the bud directory. These problems seem to make this solution more enticing. That should fix this issue and also #27.

@matthewmueller
Copy link
Contributor

matthewmueller commented May 15, 2022

@codevin Would you mind pulling down the branch in the following PR and testing if this fixes your problem? #50

You can get Bud running locally by following the Contributor Guide.

@codevin
Copy link
Author

codevin commented May 15, 2022 via email

@matthewmueller
Copy link
Contributor

Oh right, sorry it's getting late 😅 There's still $TMPDIR usage in bud create.

@matthewmueller
Copy link
Contributor

@codevin Can you pulling the latest on that branch and trying again? I just added b906630.

@cloudlena
Copy link

I'm having the same problem with b906630:

| rename /tmp/bud-create-1544231090 s3bud: invalid cross-device link

For me, /tmp is on the same partition as the directory I'm operating in:

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 476.9G  0 disk
├─nvme0n1p1 259:1    0   512M  0 part
├─nvme0n1p2 259:2    0    24G  0 part [SWAP]
└─nvme0n1p3 259:3    0 452.4G  0 part /

@matthewmueller
Copy link
Contributor

matthewmueller commented May 15, 2022 via email

@cloudlena
Copy link

cloudlena commented May 15, 2022

Yes, strings.Contains(err.Error(), "invalid cross-device link") fixes it for me 👍

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

Successfully merging a pull request may close this issue.

3 participants