Repository navigation
ci: check a dependent package compiles with juliac --trim=safe - #312
Merged
Merged
Conversation
A package that depends on DocStringExtensions should still compile with `juliac --trim=safe`. Nothing checked that, so a dynamic call added to `__init__`, or to any code a trimmed binary reaches, would only surface when a downstream user tried to build. The `Juliac trim` job builds `test/juliac` on Julia `1` and runs the binary. Trimming strips docstrings from the image, so the fixture renders its `@template` and abbreviation docstrings while it builds, and the binary prints them. `just juliac` diffs that output against `test/juliac/expected.txt`. The job fails on a trim verifier error, a crash at startup, or a change to the rendered docstrings. On Julia 1.11 and later, `@doc` returns the raw `DocStr` without REPL's `docview.jl`. The fixture loads REPL to get rendered Markdown.
juliac copies the project to a temp directory, makes its `[sources]` paths absolute, and adds a HostCPUFeatures preference under `--trim`. A Manifest resolved beforehand against the original Project.toml no longer matches that copy, so Pkg warned about stale dependencies on every build. juliac runs `Pkg.instantiate()` in the copy, so the recipe's own instantiate step only produced the warning.
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.
A package that depends on DocStringExtensions should still compile with
juliac --trim=safe. Nothing checked that, so a dynamic call added to__init__, or to any code a trimmed binary reaches, would only surfacewhen a downstream user tried to build.
The
Juliac trimjob buildstest/juliacon Julia1and runs thebinary. Trimming strips docstrings from the image, so the fixture renders
its
@templateand abbreviation docstrings while it builds, and thebinary prints them.
just juliacdiffs that output againsttest/juliac/expected.txt. The job fails on a trim verifier error, acrash at startup, or a change to the rendered docstrings.
On Julia 1.11 and later,
@docreturns the rawDocStrwithout REPL'sdocview.jl. The fixture loads REPL to get rendered Markdown.