build: resolve binary release tag dynamically from GitHub releases API#16
Merged
Merged
Conversation
Replace the hardcoded `const RELEASE_BASE_URL` / `CALLBACKS_VERSION` /
`CALLBACKS_BASE_URL` strings with a `const RELEASE_TAG = Ref{String}(...)` that is
populated at build time by `resolveReleaseTag()`. That function queries the GitHub
releases API, selects the newest `libs-*` tag (falling back to the most recent
release overall, and finally to a hardcoded default when the API is unreachable or
rate-limited), honors GITHUB_TOKEN/GH_TOKEN, and logs the chosen tag via @info/@warn.
Both the runtime libraries and the ModelicaCallbacks shim now derive their URLs
from the single resolved tag, so the build automatically follows the latest binary
release instead of pinning a stale `v0.1.0` that 404s. (Publishing the
`*-callbacks.tar.gz` asset onto that release remains a separate task.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bfe1a85 to
ca9cb67
Compare
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.
Summary
deps/build.jlhardcoded the GitHub release tag used to download the prebuilt native libraries and the ModelicaCallbacks shim. The callbacks URL pointed at av0.1.0tag that does not exist (onlylibs-v0.1.0does), so the shim download always 404s — and on Windows, where there is nogcctoolchain, the source-compile fallback also fails, leaving external-C error handling without its shim.This replaces the hardcoded
constURLs with a single release tag that is resolved dynamically at build time from the GitHub releases API.What changed
const RELEASE_TAG = Ref{String}(DEFAULT_RELEASE_TAG)populated at build time byresolveReleaseTag().resolveReleaseTag():libs-*binary-release line (these are intentionally decoupled from the package source version),libs-v0.1.0default if the API is unreachable / rate-limited,GITHUB_TOKEN/GH_TOKENto avoid the anonymous rate limit in CI,@info/@warn.releaseBaseURL()→ the single resolved tag.Why
The dev/user build should follow the latest binary release rather than pin a stale (and in the callbacks case, nonexistent) tag. With this change the build automatically picks up a newer
libs-*release as soon as one is cut, with no code edit.Verification
Ran
Pkg.build("OMRuntimeExternalC"; verbose=true)on Windows + Julia 1.12.6:The runtime libs download and extract correctly. The callbacks shim still 404s because the
*-callbacks.tar.gzasset is not yet published on thelibs-v0.1.0release — that is a separate follow-up (publishing the asset via the existingCI.ymlrelease job), independent of this change.🤖 Generated with Claude Code