Skip to content

Remove what a build and a syntax check leave in the temp directory - #1275

Merged
jgabry merged 3 commits into
v1.0from
temp-file-cleanup
Sep 18, 2026
Merged

jgabry merged 3 commits into
v1.0from
temp-file-cleanup

Conversation

@jgabry

@jgabry jgabry commented Sep 17, 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 created with AI assistance. I have reviewed all code.


Every build copied the Stan program into the session's temporary directory and left the copy there, along with the C++ make generated from it and the executable it linked (the install copies the executable rather than moving it). check_syntax_stan_file() left the C++ stanc wrote, and the stanc --info run behind $variables() left the JSON it read. All of it now goes when the call ends.

R removes the directory itself on a clean exit, so this only mattered for long sessions and for sessions that crash or are killed, whose directories stay. Two tests check that a build adds only the model's $hpp_file() to tempdir() and that a syntax check and variables_stan_file() add nothing.

This PR also gives CI a first run over the three commits pushed to v1.0 directly after #1273: the readRDS() exposed-functions fix, the NEWS reflow and the test-directory tidy.

Part of #1258.

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:

A build copied the Stan program into the session's temporary directory
and left the copy there, with the C++ make generated from it and the
executable it linked, since install_executable() copies the executable
rather than moving it. check_syntax_stan_file() left the C++ stanc wrote
and stanc_info() the JSON it read. All of it now goes when the call ends.
From Codex's closing note on the Stage 4 review.

Part of #1258.
@codecov-commenter

codecov-commenter commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             v1.0    #1275   +/-   ##
=======================================
  Coverage        ?   93.21%           
=======================================
  Files           ?       17           
  Lines           ?     7048           
  Branches        ?        0           
=======================================
  Hits            ?     6570           
  Misses          ?      478           
  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.

The test that moves a built project to a new directory compared the
executable's modification time with a Sys.time() taken microseconds
after the copy, and on two Windows runners the file came out newer by
under a microsecond. Whether the executable is reused is a decision
about the record, so the test now lives in test-model-rebuild-rules.R
beside the renamed-program test, in that file's mocked shape: build
once, rename the directory, and check that make is not called again.

Part of #1258.
A WSL run takes about two hours and twenty minutes. Twice on 2026-09-17
a run stalled inside R CMD check with nothing printed, once until the
runner lost contact after three hours and once until it was cancelled by
hand after five. Without a job timeout a stalled run holds a runner for
the six-hour default and prints no testthat output when it dies.
@jgabry
jgabry marked this pull request as ready for review September 18, 2026 00:04
@jgabry
jgabry merged commit 99b997d into v1.0 Sep 18, 2026
15 checks passed
@jgabry
jgabry deleted the temp-file-cleanup branch September 18, 2026 00:04
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