Skip to content

Support loading programs without needing a temporary directory - #477

Merged
gkreitz merged 3 commits into
Kattis:masterfrom
gkreitz:make_programs_loadable_without_tmpdir
Aug 28, 2026
Merged

Support loading programs without needing a temporary directory#477
gkreitz merged 3 commits into
Kattis:masterfrom
gkreitz:make_programs_loadable_without_tmpdir

Conversation

@gkreitz

@gkreitz gkreitz commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Preparatory change for refactoring verifyproblem.

We used to require a tmpdir just to load programs, and programs would already in their constructor populate the temporary directory. This PR postpones creation of a temporary working directory until compile is called (which now takes the directory as argument).

As this change initially caused me to have to do str(<path>) in a number of places where we call compile, I took the opportunity to move run a more towards Path objects too.

Comment thread problemtools/run/program.py
Comment thread problemtools/run/buildrun.py

@pehrsoderman pehrsoderman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an issue breaking the check for file size. Should be easy to reproduce with a source file larger than 128 kiB. We should probably add some kind of test for this also.

I will approve this, and let you decide how to handle it.

Comment thread problemtools/run/source.py Outdated
@gkreitz
gkreitz force-pushed the make_programs_loadable_without_tmpdir branch from 848ef54 to b989644 Compare August 28, 2026 09:30
@gkreitz
gkreitz merged commit 4834cc3 into Kattis:master Aug 28, 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