Weirdest thing I've seen recently: omc, the OpenModelica compiler, tries to open all its input files (including libraries) for writing. It then closes them, reopens for reading, and proceeds as one'd expect.

It turns out that it does that to determine whether they're read-only: github.com/OpenModelica/OpenMo

Why? Well, it puts that information in some parser data structure: github.com/OpenModelica/OpenMo

Why? Well, it uses that when printing an error message, so that the error message can say whether the file is writeable: github.com/OpenModelica/OpenMo

Why? I have no clue.

How do I know? It messes with gittup's determination of what's an output of a compilation command.

Follow

I ended up using Bubblewrap to provide omc with a readonly view of the entire filesystem except for the directory where it should write its output....

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.