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

involve rustup when determining toolchain paths #666

Merged
merged 18 commits into from
Mar 20, 2020
Merged

Conversation

drahnr
Copy link
Collaborator

@drahnr drahnr commented Feb 17, 2020

Start of impl to handle #87

@drahnr
Copy link
Collaborator Author

drahnr commented Feb 17, 2020

Does not cover the case cargo +nightly b which is due to a missing mtime in the proxy cache.
Workspaces with different toolchains (i.e. with https://github.com/paritytech/substrate ) don't work yet either, possible due to the same root cause.

@drahnr drahnr force-pushed the master branch 2 times, most recently from 5c589b8 to 6a18f86 Compare February 17, 2020 17:33
@drahnr drahnr changed the title involve rustup when determining toolchain paths, part 1, incomplete involve rustup when determining toolchain paths Feb 17, 2020
@drahnr
Copy link
Collaborator Author

drahnr commented Feb 17, 2020

Is the restriction to rsut 1.36 necessary? That's why the CI fails since Option<Option<_>> does not yet have the flatten.

@drahnr
Copy link
Collaborator Author

drahnr commented Feb 18, 2020

use a lookup for the compiler_path to a Box<dyn CompilerProxy> which is used for the exact compiler lookup depending on the cwd current working dir.
RustupProxy runs rustup which rustc and creates a Rust / Box<dyn Compiler> instance.
This information is then stored with modifaction time stored as if the Proxy never existed.

Current ugliness:

  • compiler type needs to be known so the correct proxy can be picked up - this is all mingled in detect_compiler right now, which returns a Rust and RustupProxy (or more precisely: (Box<dyn Compiler>, Option<Box<dyn CompilerProxy>>)

@drahnr
Copy link
Collaborator Author

drahnr commented Feb 20, 2020

This was more work than anticipated and the futures pre-stabilization caused quite a few not anticipated changes.
I'd like some feedback on the allover idea, and maybe on how to reduce the clutter a bit.

@drahnr drahnr requested a review from froydnj February 21, 2020 10:08
@drahnr
Copy link
Collaborator Author

drahnr commented Feb 21, 2020

Verified this at least solves #663 .

Copy link
Contributor

@chmanchester chmanchester left a comment

Choose a reason for hiding this comment

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

Thank you for taking on this change, I think we certainly want to take something like this, although I agree it would be nice to be able to simplify the implementation. froydnj might be able to provide a more detailed review.

@drahnr
Copy link
Collaborator Author

drahnr commented Mar 4, 2020

@froydnj if you could give some feedback so I can move this forward, that'd be great

Copy link
Contributor

@froydnj froydnj left a comment

Choose a reason for hiding this comment

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

I do not have brilliant ideas on how to simplify things right now: the cache structure is necessarily more complicated because of rustup. Some comments below.

src/server.rs Outdated Show resolved Hide resolved
src/server.rs Outdated Show resolved Hide resolved
src/server.rs Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
src/compiler/compiler.rs Outdated Show resolved Hide resolved
src/server.rs Outdated Show resolved Hide resolved
src/server.rs Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/compiler/compiler.rs Outdated Show resolved Hide resolved
@drahnr
Copy link
Collaborator Author

drahnr commented Mar 5, 2020

@froydnj I addressed all concerns and verified it works using spearow/juice as a demo project - there are still 2 open comments :)

@drahnr
Copy link
Collaborator Author

drahnr commented Mar 9, 2020

@froydnj can we clarify the last point, (either implement one of both options or merge this as is) unless there are any remaining issues? that'd be much appreciated - thanks!

@drahnr
Copy link
Collaborator Author

drahnr commented Mar 11, 2020

@froydnj @luser I implemented a hybrid solution of what both you suggested, after all they are not really exclusive and work very well hand in hand. Given the fact that it is only run once per task on the client, the amount of additional work required should be negligible since it's cached for subsequent compiles.

@drahnr
Copy link
Collaborator Author

drahnr commented Mar 11, 2020

b4aabf0 was added to make +beta happy, also part of #683

@drahnr
Copy link
Collaborator Author

drahnr commented Mar 19, 2020

Rebased, removed obsolete changes and resolved all review comments.

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.

4 participants