Skip to content

ci: check a dependent package compiles with juliac --trim=safe - #312

Merged
MichaelHatherly merged 2 commits into
masterfrom
mh/juliac-ci
Oct 20, 2026
Merged

MichaelHatherly merged 2 commits into
masterfrom
mh/juliac-ci

Conversation

@MichaelHatherly

Copy link
Copy Markdown
Member

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.

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.
@MichaelHatherly MichaelHatherly added the skip-changelog PR needs no CHANGELOG.md entry label Oct 20, 2026
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.
@MichaelHatherly
MichaelHatherly marked this pull request as ready for review October 20, 2026 21:06
@MichaelHatherly
MichaelHatherly merged commit eeb4419 into master Oct 20, 2026
15 checks passed
@MichaelHatherly
MichaelHatherly deleted the mh/juliac-ci branch October 20, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog PR needs no CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant