feat(cross): Move embedder build to --prepare step - #195
Open
MEverett90 wants to merge 4 commits into
Open
Conversation
…ter. When --prepare --build are combined, the result from --prepare is passed through directly, skipping the second _buildEmbedder call entirely — no redundant augment rebuild.
When --build falls back to _buildEmbedder(skipIfBuilt: true), check a .emb-source-stamp file in the build root against a SHA256 fingerprint of the embedder source tree (file paths + sizes + mtimes). If the stamp matches and all backend binaries are present, the cmake/meson step is skipped entirely; otherwise the build runs and a new stamp is written. Without this, skipIfBuilt only checks for the presence of built binaries — source edits between --prepare and --build would be silently ignored because cmake is never invoked to notice them.
Replace the mtime-based source fingerprint with SHA-256 content hashing so that git checkout, cp -a, and coarse-granularity filesystems (HFS+, FAT32) no longer produce false skip-if-built cache hits. Also fixes the _EmbedderResult doc comment that was accidentally concatenated with _StagedLibs's, removes a redundant .where(success) filter after an exhaustive check, and normalizes path construction to use p.join consistently. Adds unit tests for sourceFingerprint covering determinism, content change detection, file add/remove, hidden-dir exclusion, and mtime-independence.
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.
Description
Type of Change