You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you may know, we have created an unholy beast by wrapping twoliter in Bazel. An implementation that I am sure makes even you, perhaps ask "why".
A fun thing that Bazel does, is that if you have several inputs to a rule where the dependency graph has put them firmly parallel to each other, it will build those in parallel, whether you want Bazel to or not. (It is incredibly difficult to serialize actions in Bazel based on an engineer's opinion)
This has put me in the weird position of having found a couple of race issues in twoliter, and also suffering from their existence. Here, race issue means "if I for some stupid reason start more than one twoliter process, this will break".
The issues are two, one is writing out the tools/ folder. I understand that you do want to do this every time you run twoliter to avoid a host of "this is broken on my machine". I ended up implementing a file lock for writing it out to avoid the odd double-remove race condition.
For the second one, which is removing the verification tags for the SDKs, I ended up with a bit larger implementation - this implementation is that I am actually hashing the contents of the verification tags and comparing before removing/writing out again. I also found that in a few places you gratuitously remove the verification tags several times instead of just writing them out again, perhaps squarely to stop me from doing what I am doing. It happens as you can see in this log excerpt:
There was a third call to ::project::lock::verification originally, but this was part through my 'fix', it does however still paint a pretty good picture of it being called multiple times (removing the verification tags) a bit redundantly.
I will attach a PR that contains these fixes for your amusement. We are carrying this patch for now (also hence the binary is called twoliter__bin, an artefact of building it using Bazel).
The text was updated successfully, but these errors were encountered:
mikn
linked a pull request
Mar 6, 2025
that will
close
this issue
Overall though, I am thoroughly surprised at how well it works to run twoliter in parallel. I would've bet money on that the docker stuff would've blown up in my face, so I am pleasantly surprised this was all I needed to do to make it work. :)
That said, in our implementation, we only build the actual images of each variant as we offload all package building to another process that builds the kit itself. I imagine starting 4 twoliter processes against the same source tree including overlapping package builds would've ended in disaster..?
Hi!
As you may know, we have created an unholy beast by wrapping
twoliter
in Bazel. An implementation that I am sure makes even you, perhaps ask "why".A fun thing that Bazel does, is that if you have several inputs to a rule where the dependency graph has put them firmly parallel to each other, it will build those in parallel, whether you want Bazel to or not. (It is incredibly difficult to serialize actions in Bazel based on an engineer's opinion)
This has put me in the weird position of having found a couple of race issues in
twoliter
, and also suffering from their existence. Here, race issue means "if I for some stupid reason start more than onetwoliter
process, this will break".The issues are two, one is writing out the tools/ folder. I understand that you do want to do this every time you run
twoliter
to avoid a host of "this is broken on my machine". I ended up implementing a file lock for writing it out to avoid the odd double-remove race condition.For the second one, which is removing the verification tags for the SDKs, I ended up with a bit larger implementation - this implementation is that I am actually hashing the contents of the verification tags and comparing before removing/writing out again. I also found that in a few places you gratuitously remove the verification tags several times instead of just writing them out again, perhaps squarely to stop me from doing what I am doing. It happens as you can see in this log excerpt:
There was a third call to
::project::lock::verification
originally, but this was part through my 'fix', it does however still paint a pretty good picture of it being called multiple times (removing the verification tags) a bit redundantly.I will attach a PR that contains these fixes for your amusement. We are carrying this patch for now (also hence the binary is called
twoliter__bin
, an artefact of building it using Bazel).The text was updated successfully, but these errors were encountered: