Enable xbuildenv source introspection via a marker file - #414
Open
agriyakhetarpal wants to merge 9 commits into
Open
Enable xbuildenv source introspection via a marker file#414agriyakhetarpal wants to merge 9 commits into
agriyakhetarpal wants to merge 9 commits into
Conversation
ryanking13
reviewed
Jul 27, 2026
Comment on lines
+64
to
+68
| # If source is not provided, derive it from the metadata file, so that | ||
| # pointing PYODIDE_CROSS_BUILD_ENV_METADATA_URL at the nightly metadata | ||
| # can still record what was installed. | ||
| if source is None: | ||
| source = source_for_metadata_url(self.metadata_url) |
Member
There was a problem hiding this comment.
I don't think this is needed. If a user passes any metadata URL, we should assume it is a custom URL.
Comment on lines
+191
to
+194
| replaced_path = download_path.with_name(download_path.name + ".replaced") | ||
| shutil.rmtree(replaced_path, ignore_errors=True) | ||
| download_path.rename(replaced_path) | ||
| return replaced_path |
Member
There was a problem hiding this comment.
Well, I don't like this behavior. How about adding the source to the xbuildenv directory instead when downloading? For example, we can use 0.29.3-debug or 0.29.3-nightly instead of sharing 0.29.3. By doing that, we can remove the SOURCE_MARKER_FILE and use the directory name as the version name, which is consistent with the previous behavior.
Comment on lines
+32
to
+35
| # An environment installed with --url has no release behind it to name, so the | ||
| # URL it came from is its source. A distinct type rather than a bare str, so | ||
| # that a URL cannot be passed where a release stream is expected. | ||
| SourceURL = NewType("SourceURL", str) |
Member
There was a problem hiding this comment.
I don't quite get what the benefit of using a wrapped type is in this case. Of course, parse don't validate is a good practice, but do we need any validation at all for this URL?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don't particularly like the ergonomics of this PR... hence, this is ready for review, but not ready to merge just yet and I am scouting opinions.
The idea is to have a file called
.xbuildenv-source, which will record where the xbuildenv came from – whether it's a release xbuildenv, a stable-debug xbuildenv, a nightly one, or a nightly-debug one. We can think of these as "channels". Of course, we also support custom URLs for the source of the xbuildenv, in which case we record the URL itself into the marker file.LMK what you think about this!