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

Enable incremental compile for zinc hermetic by adding scratch input digest for local ExecuteProcessRequest #8282

Merged
merged 46 commits into from
Sep 26, 2019

Conversation

wisechengyi
Copy link
Contributor

@wisechengyi wisechengyi commented Sep 12, 2019

Problem

Zinc hermetic does not work with incremental compile

Solution

Add local specific scratch dir for ExecuteProcessRequest with

  • unsafe_local_only_files_because_we_favor_speed_over_correctness_for_this_rule: hashing::Digest

Similar to input_files, except it is ignored in the remote case.

Reasoning being

  1. If we put classes/ into the input_files digest, it could cause severe performance issue for downloading a lot of loosing files in remoting.
  2. Zinc Incremental compile would be less of a thing when rsc/outline and native-image are ready.

@wisechengyi wisechengyi changed the title [do not review] [WIP] Implement incremental compilation for zinc hermetic Sep 12, 2019
@wisechengyi wisechengyi changed the title [WIP] Implement incremental compilation for zinc hermetic [Do not review] Add scratch dir for local ExecuteProcessRequest Sep 14, 2019
@wisechengyi wisechengyi changed the title [Do not review] Add scratch dir for local ExecuteProcessRequest [Do not review] Add scratch input digest for local ExecuteProcessRequest Sep 16, 2019
@stuhood
Copy link
Sponsor Member

stuhood commented Sep 16, 2019

Not reviewable yet, but cc @blorente : Yi is currently leaning toward a local-only sidechannel for stashing analysis. Potentially related to other local-only low-latency-JVM options.

@wisechengyi wisechengyi changed the title [Do not review] Add scratch input digest for local ExecuteProcessRequest [Do not review] Enable incremental compile for zinc hermetic by adding scratch input digest for local ExecuteProcessRequest Sep 16, 2019
@wisechengyi wisechengyi changed the title [Do not review] Enable incremental compile for zinc hermetic by adding scratch input digest for local ExecuteProcessRequest [Tests to be added] Enable incremental compile for zinc hermetic by adding scratch input digest for local ExecuteProcessRequest Sep 16, 2019
@wisechengyi wisechengyi changed the title [Discuss] Enable incremental compile for zinc hermetic by adding scratch input digest for local ExecuteProcessRequest Enable incremental compile for zinc hermetic by adding scratch input digest for local ExecuteProcessRequest Sep 20, 2019
@wisechengyi
Copy link
Contributor Author

This is now ready for review. Thanks!

Travis failed at unrelated tests.

Copy link
Contributor

@blorente blorente left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Left some minor nits, but the overall design, as discussed, lgtm

Copy link
Contributor

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Thanks, generally looks great; a few things to fix up :)

return _classes_dir_snapshot

analysis_snapshot = _get_analysis_snaoshot()
classes_dir_snapshot = _get_classes_dir_snapshot()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a classes dir? I thought Zinc could operate purely on jars? If this is necessary, can you add a comment to the code explaining why? This seems pretty weird...

Copy link
Contributor Author

@wisechengyi wisechengyi Sep 20, 2019

Choose a reason for hiding this comment

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

Indeed. zinc requires loose classfiles in the output directory in order for incremental compile to work.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

zinc was supposed to be headed in the direction of supporting operating on jars... but it didn't get there, unfortunately.

src/python/pants/engine/isolated_process.py Outdated Show resolved Hide resolved
src/rust/engine/process_execution/src/remote.rs Outdated Show resolved Hide resolved
src/rust/engine/process_execution/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks Yi!

return _classes_dir_snapshot

analysis_snapshot = _get_analysis_snaoshot()
classes_dir_snapshot = _get_classes_dir_snapshot()
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

zinc was supposed to be headed in the direction of supporting operating on jars... but it didn't get there, unfortunately.

Copy link
Contributor

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Looks good, modulo outstanding comments - thanks!

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