-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Download pre-compiled bootstrap from CI #112598
Conversation
r? @ozkanonur (rustbot has picked a reviewer for you, use r? to override) |
r? @jyn514 |
i could not find the button to turn the pr into draft it right now works but it is not a clean solution. I am not sure how to clean this it has a few hacks that i am not happy with |
This comment has been minimized.
This comment has been minimized.
RIght now the wip code still tries to download even if there is a bootstrap locally. I am not sure what is the best way to handle this case. I first thought about chekcing if the cache folder has a bootstrap binary and then skipping download but this does not consider the case when user updates their old copy of the source code and in this case x.py will still use old bootstrap binary. What do you think is the best way to handle this case ? |
i don't have time for reviews, sorry. onur is working on the shell script side, he's a good reviewer. r? @ozkanonur |
I can do the review by the coming weekend. Until then, you can squash your commits and undraft the PR once it's ready. @rustbot author |
I think this is ready for initial review the redownload logic is not fully clean but I am open to suggestions for best way to detect changes. I also screwed up my first rebase and the bot added a label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's time to update this log
Something like Checking if bootstrap needs to be downloaded or built before processing.
should fit better
The one problem that I did not find a clean solution for still is even if there is a built bootstrap binary in the build folder and there is no changes it still tries to download so I think the |
This comment has been minimized.
This comment has been minimized.
Yes, this should be checked too. You can create a stamp file on the same path with bootstrap binary and check that for this particular check. |
I added the stamp check. I am not sure about the best way to check the logic without having a CI artifact for the latest commit |
src/bootstrap/bootstrap.py
Outdated
return True | ||
|
||
|
||
|
||
def download_bootstrap(self, commit_hash): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many spaces
src/bootstrap/bootstrap.py
Outdated
def last_bootstrap_commit(self): | ||
top_level = output(["git", "rev-parse", "--show-toplevel"]) | ||
|
||
cmd = ["git", "rev-list", "--author={}".format(self.git_merge_commit_mail), | ||
"-n1", "--first-parent", "HEAD"] | ||
merge_base = output(cmd) | ||
|
||
path = "{}/src/bootstrap".format(top_level) | ||
cmd = ["git", "diff-index", "--quiet", "HEAD", "--", path] | ||
|
||
ret = subprocess.Popen(cmd, cwd=self.rust_root) | ||
code = ret.wait() | ||
if code != 0: | ||
return None | ||
else: | ||
return merge_base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command alone git log -1 --pretty=format:%H src/bootstrap
does what you need
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you need short version of the commit hash, simply lowercase the H
in --pretty
src/bootstrap/bootstrap.py
Outdated
def bootstrap_out_of_date(self, commit): | ||
stamp_path = pathlib.Path(self.bin_root()).joinpath("bootstrap/.bootstrap-stamp") | ||
if not stamp_path.exists(): | ||
return True | ||
|
||
return stamp_path.read_text != commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems wrong as it will always return True
because we don't have the stamp file on fresh repository.
I haven't looked into this in detail, but I think the following steps should get the job done easily:
Regardless of whether we need to compile or download, we need to make sure the stamp file has been generated. |
Wait do we distribute the stamp-file with the CI as well. I thought it gets created after a successful download to mark the artifact. |
No, this is not needed. |
☔ The latest upstream changes (presumably #113037) made this pull request unmergeable. Please resolve the merge conflicts. |
trying to rebasae my branch and getting this error. and it is not helpful at all it first does not tell which crate has this dependency and second it does not tell where this exceptions file or sections is |
oh found it it was in the tools tidy deps |
rust/src/tools/tidy/src/deps.rs Line 57 in 214a0d1
|
Some changes occurred in src/tools/cargo cc @ehuss |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #113229) made this pull request unmergeable. Please resolve the merge conflicts. |
@dvtkrlbs any updates on resolving the conflicts? |
I will update my branch in the following days. Was there an easy way to resolve submodule conflicts there was a way to force reset them to HEAD without going through the conflict resolving but I don't remember how. |
i really despise git sometimes I thought the rebase was resolved did the push and forgot about it. somehow it reset my branch. Looking at the reflog now to restore it. |
This PR builds on the work done by #98483 and downloads the bootstrap from the artifacts server if there is not any changes on the bootstrap source code. If the download fails it fallbacks to local build.
fixes #99989
helps with #94829