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

Failed to Lock when fetching lib #1149

Merged
merged 1 commit into from
Jun 30, 2017
Merged

Conversation

MartinNowak
Copy link
Member

Windows 10
Dub: 1.3.0

cmd: dub run --build=debug --arch=x86 --compiler=dmd

Fetching libevent 2.0.2+2.0.16 (getting selected version)...
Failed to lock 'C:\Users\User Name\AppData\Roaming\dub\packages\libevent-2.0.2_2.0.16\libevent.lock'.

on dub.json:
"dependencies": {
     "requests": "~>0.3.2",
     "htmld": "~>0.2.16"
}

Maybe is relate to long path names?

@SrMordred
Copy link
Author

SrMordred commented Jun 13, 2017

Ok it´s path related.
resolved when adding:
--cache=local or
--cache=system

I believe its long path or the space on the user name that cause the issue.

@MartinNowak
Copy link
Member

MartinNowak commented Jun 14, 2017

Seems like we sometimes leave those lock files around on aborted dub runs, maybe related to a CTRL+C abort (which doesn't cleanup).
What we could prolly try, instead of dealing with SIGINT on all platforms, is always downloading+extracting to tempfolder, then attempting an atomic folder rename.
Could be a bit wasteful for CI systems running multiple parallel instances of dub.
Alternatively having PID/expiration files that allow to remove stale locks would be an options as well.
Or maybe better use native OS locks that hopefully automatically unlock when a process exits.

So far we didn't have any reported issues with https://github.com/dlang/druntime/blob/2db828bd4f21807254b770b3ec304f14596a9805/src/rt/cover.d#L399, so that could make a better replacement.

@MartinNowak
Copy link
Member

Dub's current lockFile is here.

MartinNowak added a commit to MartinNowak/dub that referenced this pull request Jun 17, 2017
- get rid of lingering locks by replacing FS locks with OS locks
  The get freed on process termination. On the downside we can't
  delete the lock files without a race.
@MartinNowak MartinNowak requested a review from s-ludwig June 17, 2017 14:25
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 61.663% when pulling b4275e6 on MartinNowak:fix1149 into 13581f8 on dlang:master.

@MartinNowak MartinNowak changed the base branch from master to stable June 28, 2017 21:11
@dlang-bot
Copy link
Collaborator

Thanks for your pull request, @MartinNowak!

@MartinNowak MartinNowak added this to the 1.4.0 milestone Jun 28, 2017
string path;
}
import std.datetime, std.stdio : File;
import std.algorithm.mutation : move;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails on 2.066 and below -> std.algorithm : move

@s-ludwig
Copy link
Member

Looks good. I can also confirm that I ran into this a few times when I cancelled a package download using Ctrl+C.

- get rid of lingering locks by replacing FS locks with OS locks
  The get freed on process termination. On the downside we can't
  delete the lock files without a race.
@dlang-bot dlang-bot merged commit 2af7481 into dlang:stable Jun 30, 2017
@MartinNowak MartinNowak deleted the fix1149 branch June 30, 2017 13:36
@MartinNowak
Copy link
Member

Yikes, stupid dlang/dlang-bot#69, hope the tests will be all right.

@wilzbach
Copy link
Member

Yeah seems like stable didn't had required CI checks.
I just enabled them for now.

image

MartinNowak added a commit to MartinNowak/dub that referenced this pull request Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants