feat: accept target-suffixed RUSTY_V8_ARCHIVE #1816
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.
Support target-specific RUSTY_V8_ARCHIVE environment variables
Summary
This PR adds support for target-specific
RUSTY_V8_ARCHIVE
environment variables to enable cross-compilation scenarios where different archives are needed for build and target machines.Changes
RUSTY_V8_ARCHIVE_{TARGET}
environment variables (with hyphens replaced by underscores)static_lib_url()
to check target-specific archive variables before falling back to the genericRUSTY_V8_ARCHIVE
Use Case
This change allows builds that require rusty_v8 for both the build machine (e.g., build scripts) and the target machine (e.g., the final binary). Previously, there was no way to specify different archives for different targets, which could cause issues in cross-compilation scenarios.
Behavior
The environment variable lookup now follows this priority order:
RUSTY_V8_ARCHIVE_{TARGET}
(target-specific, with hyphens replaced by underscores)RUSTY_V8_ARCHIVE
(generic fallback)For example, when targeting
x86_64-unknown-linux-gnu
, the build will first check forRUSTY_V8_ARCHIVE_x86_64_unknown_linux_gnu
before falling back toRUSTY_V8_ARCHIVE
.Testing
This change is backward compatible - existing builds using
RUSTY_V8_ARCHIVE
will continue to work unchanged.