fix: version inconsistencies when using custom version #62
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.
Problem
Recently, we initiated the use of a custom version in the workspace-rs crate to fix one of the issue nearcore had when building wasms with newer rust version. However, this change introduced an unintended consequence where other crates began encountering issues due to a mismatch in the sandbox version being utilized. The sandbox was defaulting to downloading this version https://github.com/near/sandbox/blob/ee06569991da4a3a69f3cc575715a3fdc06935da/crate/src/lib.rs#L15 instead of the newly specified custom version. The root cause of this mismatch seems to be originating from line https://github.com/near/sandbox/blob/ee06569991da4a3a69f3cc575715a3fdc06935da/crate/src/lib.rs#L126
Solution
This Pull Request proposes a solution to harmonize the versioning system by recording the SANDBOX_VERSION in a temporary file. This approach ensures that the version data can be retrieved and utilized consistently across different crates, thereby preventing the sandbox from defaulting to the original version. The temp file acts as a single source of truth for the version information and is referred by :https://github.com/near/sandbox/blob/ee06569991da4a3a69f3cc575715a3fdc06935da/crate/src/lib.rs#L123
to determine the correct version to download and use.