[PATCH] bootstrap: use fcntl locking on Solaris - #161357
Conversation
|
r? @clubby789 rustbot has assigned @clubby789. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
How hard would it be to add flock support to solaris? And how long would that take before we could depend on that support from the rust side? Edit: Forgot Solaris is no longer open source. |
It would be pretty hard. Plus we would then need to wait for new Solaris 11.4 CBE release. Also Rust is expected to run/build on older Solaris 11.4 releases too... |
3ad6498 to
89d1a5a
Compare
|
While it would be a while before rust can depend on it, adding flock support to Solaris now would fix other programs that use But if it is hard to implement, I can understand it not getting implemented any time soon. |
This comment has been minimized.
This comment has been minimized.
Solaris does not provide flock, so std::fs::File deliberately does not support its locking API there. Its earlier fcntl emulation was removed because fcntl locks are process-scoped rather than handle-scoped. The bootstrap build lock only coordinates separate bootstrap processes and is held for the lifetime of the process, making fcntl locking suitable for this narrower use. Add a Solaris-specific backend while retaining std file locking on other platforms.
89d1a5a to
4a2ec55
Compare
Solaris does not provide flock, so std::fs::File deliberately does not support its locking API there. Its earlier fcntl emulation was removed because fcntl locks are process-scoped rather than handle-scoped.
The bootstrap build lock only coordinates separate bootstrap processes and is held for the lifetime of the process, making fcntl locking suitable for this narrower use. Add a Solaris-specific backend while retaining std file locking on other platforms.
Note: LLM was used to generate it.