tweag / topiary

https://topiary.tweag.io/
MIT License
579 stars 29 forks source link

Load JSON and TOML grammars before tests in `cli-testers.rs` #779

Closed nbacquey closed 1 month ago

nbacquey commented 1 month ago

Description

We need to prefetch JSON and TOML grammars before running the tests, on pain of race condition: If multiple calls to Topiary are made in parallel and the grammar is missing, they will all try to fetch and build it, thus creating an empty .so file while g++ is running. If another instance of Topiary starts at this moment, it will mistake the empty .so file for an already built grammar, and try to run with it, resulting in an error.

Closes #767

Checklist

Checklist before merging: