natsukagami / kjudge

A simple system for hosting competitive programming contests.
GNU Affero General Public License v3.0
23 stars 11 forks source link

Auto convert CRLF and LF for uploaded code and tests #87

Open minhnhatnoe opened 1 year ago

minhnhatnoe commented 1 year ago

Is your feature request related to a problem? Please describe.

In many cases, code and testcases are sent from a Windows client to a Linux judging server, possibly creating compatibility issues.

Describe the solution you'd like

The judging server should be able to detect it's host OS, then convert all text files received to the respective format.

Additional context

Should we implement some type of distributed judging, all workers should be able to detect the OS type and convert files independently.

natsukagami commented 1 year ago

Hmm, I wonder when this will cause a problem?

minhnhatnoe commented 1 year ago

I haven't had the time to fiddle around, but I believe that using CRLF in .sh files renders the she-bang invalid.

minhnhatnoe commented 1 year ago

Pull Request https://github.com/natsukagami/kjudge/pull/103 solves this.