Skip to content

rustbuild: Assert directory creation succeeds#40337

Merged
bors merged 1 commit into
rust-lang:masterfrom
alexcrichton:racy-dirs
Mar 9, 2017
Merged

rustbuild: Assert directory creation succeeds#40337
bors merged 1 commit into
rust-lang:masterfrom
alexcrichton:racy-dirs

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
create_dir_all call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call create_dir_racy which handles
concurrent invocations, as multiple build scripts may be trying to create the
native dir.

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton

Copy link
Copy Markdown
Member Author

cc @petrochenkov

another instance of this failure happened at https://travis-ci.org/rust-lang/rust/jobs/208686112 and I'm hoping this'll fix it.

Unfortunately I can't reproduce locally so this is just a guess to a fix.

@brson

brson commented Mar 7, 2017

Copy link
Copy Markdown
Contributor

@bors r+

Awesome function.

@bors

bors commented Mar 7, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit e412af2 has been approved by brson

@petrochenkov

petrochenkov commented Mar 7, 2017

Copy link
Copy Markdown
Contributor

My best guess is that maybe several processes try to create the native directory and subdirectories in it simultaneously. E.g. one job tries to create_all native/libbacktrace while another tries to create_all native/jemalloc and one of them fails somehow. So, create_dir_racy may help, or native could be pre-created in advance...

@alexcrichton

Copy link
Copy Markdown
Member Author

@petrochenkov yes that's my belief as well. I didn't find a great spot to create the dir ahead of time so I just left it here

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 8, 2017
rustbuild: Assert directory creation succeeds

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.
@alexcrichton

Copy link
Copy Markdown
Member Author

@bors: p=1

I think this is also causing #40358

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 8, 2017
rustbuild: Assert directory creation succeeds

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.
@bors

bors commented Mar 8, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e412af2 with merge 0806855...

@bors

bors commented Mar 8, 2017

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@alexcrichton

Copy link
Copy Markdown
Member Author

@bors: retry

  • build timeout

@bors

bors commented Mar 9, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e412af2 with merge 5c9208f...

bors added a commit that referenced this pull request Mar 9, 2017
rustbuild: Assert directory creation succeeds

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.
@bors

bors commented Mar 9, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: brson
Pushing 5c9208f to master...

@bors bors merged commit e412af2 into rust-lang:master Mar 9, 2017
@alexcrichton alexcrichton deleted the racy-dirs branch March 17, 2017 14:52
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 this pull request may close these issues.

6 participants