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

extra::workcache is not 100% re-entrant, but rustpkg acts like it is #10461

Closed
pnkfelix opened this issue Nov 13, 2013 · 3 comments
Closed

extra::workcache is not 100% re-entrant, but rustpkg acts like it is #10461

pnkfelix opened this issue Nov 13, 2013 · 3 comments

Comments

@pnkfelix
Copy link
Member

From what I can tell via my instrumentation of workcache.rs and rustpkg, it appears like the workcache will blithely overwrite the backing database file if you have two simultaneous instances with the same backing store.

I should be clear here: If a client is aware of this behavior, and does not assume anything about whether cache results survive from run to run, then maybe they will be fine. (So whether or not the workcache is strictly speaking "re-entrant" depends on how strong a specification we are expected it to satisfy.)

As in, consider this order of events:

No initial file. WC1 and WC1 will both be setup with the same non-existing path.
WC1 starts; no file to load
WC2 starts; no file to load
each gathers its own local data
WC2 dropped: it outputs its database
WC1 dropped: it outputs its database, and overwrites WC2 results.

This means that you cannot treat the cache results as something you can rely upon being there.

From what I can tell, one or more of the rustpkg tests has one invocation of rustpkg nested within another one, analogous to the WC1/WC2 outline above.

I believe this, perhaps among other things, is what is causing tests::test_c_dependency_no_rebuilding to fail on my platform.

@alexcrichton
Copy link
Member

Nice find! I was struggling for days with this and couldn't come up with anything!

@metajack
Copy link
Contributor

Related to #9650 #9649

@gereeter
Copy link
Contributor

Rustpkg is gone, so this should probably be closed.

@jdm jdm closed this as completed Apr 20, 2014
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

No branches or pull requests

5 participants