Skip to content

Report the stanc flags make/local added in stan_build_info() - #1283

Merged
jgabry merged 2 commits into
v1.0from
build-info-from-make
Sep 22, 2026
Merged

jgabry merged 2 commits into
v1.0from
build-info-from-make

Conversation

@jgabry

@jgabry jgabry commented Sep 22, 2026

Copy link
Copy Markdown
Member

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

This PR and the summary below were assisted by AI. I have reviewed all code and doc.


stan_build_info() now includes stanc_options_from_make under
configuration: the STANCFLAGS that make/local added to the stanc call,
minus any the call's own stanc_options overrode. The build record already
held it; #1278 left it out of the public result and Codex's review suggested
adding it. The case is the same as for include_paths: make/local can
change after a build, so the file alone doesn't say which flags the build
saw.

  • R/build_record.R: the field in the result and a printer line after
    stanc_options; roxygen bullet, and the "leaves out" paragraph no longer
    names it.
  • dev-notes/compilation-state.md §8: withheld sentence and diagnosis rule
    updated, example shape gains the field; contract regenerated.
  • tests/testthat/test-build-info.R: the field is expected in the public
    shape and read back as recorded.

The second commit makes the function visible and tidies its printer:

  • vignettes/cmdstanr-internals.Rmd: the build record section reads the
    record back with $build_info() and points at stan_build_info(). The
    example now copies bernoulli into tempdir() under its own name, so the
    paths and the record file read as bernoulli rather than a random
    tempfile name, and the record listing is narrowed to that model.
  • print.stan_build_info(): include_paths prints "none" when empty like
    the other option lines, and the status lines for a missing, unreadable,
    mismatched or wrong-format record are under 80 characters and say what
    happened and what to do.
  • One snapshot test covers the printed form of every record state, in place
    of the fragment checks.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Jonah Gabry

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

The build record already held stanc_options_from_make, the STANCFLAGS
that make/local contributed to the stanc call. The public result left
it out with the other assembly fields. It is kept now for the same
reason as include_paths: make/local can change after a build, so the
file alone does not say which flags the build saw.

Part of #1258.
The build record section of the vignette now reads the record back with
$build_info() and points at stan_build_info() for a bare executable
path. The example copies bernoulli into tempdir() under its own name, so
the paths and the record file read as bernoulli. The printer says
"none" for empty include_paths as it does for the other option lines,
and the status lines for a record that is missing, unreadable,
mismatched or in another format fit in 80 columns and say what happened
and what to do. One snapshot test covers the printed form of every
record state.

Part of #1258.
@jgabry
jgabry changed the base branch from master to v1.0 September 22, 2026 20:47
@codecov-commenter

codecov-commenter commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v1.0@76aaede). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             v1.0    #1283   +/-   ##
=======================================
  Coverage        ?   93.47%           
=======================================
  Files           ?       19           
  Lines           ?     7263           
  Branches        ?        0           
=======================================
  Hits            ?     6789           
  Misses          ?      474           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgabry
jgabry marked this pull request as ready for review September 22, 2026 23:57
@jgabry
jgabry merged commit 90db219 into v1.0 Sep 22, 2026
15 checks passed
@jgabry
jgabry deleted the build-info-from-make branch September 22, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants