Skip to content

Improve program file handling in the run module - #499

Merged
pehrsoderman merged 5 commits into
Kattis:masterfrom
gkreitz:improve_run_api
Oct 10, 2026
Merged

pehrsoderman merged 5 commits into
Kattis:masterfrom
gkreitz:improve_run_api

Conversation

@gkreitz

@gkreitz gkreitz commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This is mostly a refactor/API clean-up, but also laying some ground work for future features (in particular, supporting constants at some point in the future).

Behavioral changes:

  • No longer crash if include files and a submission have the same path as a directory in one and a file in the other (this is now a compile error)
  • Add an explicit check if default include files has such a clash with the include files for a language
  • Add a check if the problem package contains anything which is not a file, directory, or symlink.
  • Empty directories in a program (validator, grader, example submission) are now ignored. (I can't think of a reason why anyone would depend on the old behavior, and empty directories should be very rare as basically all packages are stored in git)
  • Symlinks in program directories are now resolved to regular files/directories before compiling. This fixes some corner-case bugs w.r.t. symlinks in include files and programs

Main gist of the refactor here is that we add ProgramFiles to model, superseding IncludeFile. We load up all source code in memory, and BuildRun and Source now have a public attribute to get the file paths and their contents.

I still have some more cleaning of run in progress, but this felt like a reasonably-sized PR.

Comment thread problemtools/model/program_files.py
@pehrsoderman
pehrsoderman merged commit 5ba8faf into Kattis:master Oct 10, 2026
7 checks passed
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