Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to import compile commands or compilation flags #1241

Open
RagnarGrootKoerkamp opened this issue Oct 8, 2021 · 9 comments
Open
Assignees

Comments

@RagnarGrootKoerkamp
Copy link
Contributor

RagnarGrootKoerkamp commented Oct 8, 2021

I think someone else also brought this up last week. It would be nice if there was a way to automatically import compiler flags (or just the full compilation scripts, but compile and run command only as in languages.yaml would be preferable).

That way we can just re-import a contest/problemset instead of having to manually edit the file each time.

@meisterT
Copy link
Member

meisterT commented Oct 9, 2021

I agree that this would be a nice feature, it would also allow us to display these in the team interface.

Is there a spec for languages.yaml that we can use?

@RagnarGrootKoerkamp
Copy link
Contributor Author

RagnarGrootKoerkamp commented Oct 9, 2021

I don't think it's officially spec'ed yet, but problemtools has the ground truth. The comments in the file explain the syntax.
https://github.com/Kattis/problemtools/blob/develop/problemtools/config/languages.yaml

BAPCtools also uses it.

@RagnarGrootKoerkamp
Copy link
Contributor Author

One thing to keep in mind is that currently DOMjudge only has global language settings, so importing this for a contest would necessarily override the global settings, so there needs to be some extra warning/confirmation somewhere.

@nickygerritsen
Copy link
Member

The API spec now has fields for compiler flags (and run stuff), which is probably the spec we want to go with.

@meisterT
Copy link
Member

Can you please link to the (new?) section in the spec?

@nickygerritsen
Copy link
Member

https://ccs-specs.icpc.io/master/contest_api#languages

see compiler and runner

@meisterT
Copy link
Member

meisterT commented Sep 3, 2022

@meisterT
Copy link
Member

This will be a lot easier when #1238 is implemented.

@meisterT meisterT self-assigned this Nov 10, 2022
@meisterT
Copy link
Member

I started implementing supporting compiler and runner version commands the first step and discussed the approach with @tuupke yesterday.

The idea is that you can define for each language a version command and an optional runner command. The judgehosts can collect the output of these commands and we can create an (optional) languages page for the teams that shows the enabled languages and their versions (later also the command lines).

There will be an easy way to mark one of these outputs as canonical and promote it from this table to the language table.

Upon registering / judgehost startup, for each enabled language, the judgehost runs the version commands and reports back the output. In the database we need a new table where we store the (most recent) output for each combination of language and judgehost.

When handing out judgetasks, the judgetasks get enriched with the version commands. Then, on compilation of a submission, you also run the version commands and report them back with the testcase result.

In strict mode, the server compares this output with the canonical output. Then it ignores the result (of this testcase and all other cases in the batch) and disables the judgehost (or judgehost/language combo).

In non-strict mode, this could at least be flagged on the submission itself (and perhaps as an internal error which is not disabling anything, but less easy to miss).

meisterT added a commit to meisterT/domjudge that referenced this issue May 7, 2023
Progress towards DOMjudge#1241

Each language has canonical information while we store the latest info
per judgehost in a separate table.
The information from the judgehost is currently just informative, a
next step would be to actually disable judging from this judgehost in
case of a version mismatch.

The canonical information can be exposed to the teams via a config
option.
meisterT added a commit that referenced this issue May 8, 2023
Progress towards #1241

Each language has canonical information while we store the latest info
per judgehost in a separate table.
The information from the judgehost is currently just informative, a
next step would be to actually disable judging from this judgehost in
case of a version mismatch.

The canonical information can be exposed to the teams via a config
option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants