buildbarn / bb-storage

Storage daemon, capable of storing data for the Remote Execution protocol
Apache License 2.0
137 stars 91 forks source link

Windows port fixes and improvements #129

Closed mou-hao closed 2 years ago

mou-hao commented 2 years ago

Hi! Hope you all are doing well!

This change includes:

The rationale for doing the last is that, if we have specified a version in go.mod, we probably want that exact version. However, if we put go_dependencies() after go_rules_dependencies(), dependencies loaded by both will be the version in go_rules_dependencies(). Reversing the order fixes this (doc). I found this when trying to upgrade golang.org/x/sys. This does mean I have to replace grpc.ServiceRegistrar with *grpc.Server in a couple of places though, probably because the go_grpc version specified in go.mod is the one being used now.

I will create another PR to bb-remote-execution following this PR. This PR is part of buildbarn/bb-remote-execution#7.

Cheers, mh

My employer has requested me to include the following disclaimer:

THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE APACHE LICENSE V.2.0. YOU MAY OBTAIN A COPY OF THE LICENSE AT https://www.apache.org/licenses/LICENSE-2.0. THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

EdSchouten commented 2 years ago

Hey! Great work! That said, could you figure out why you had to make that change to the gRPC code? We want to use ServiceRegistrar. See this commit for details:

https://github.com/buildbarn/bb-storage/commit/b5c450e0b2a91ff7e38d961cd763885e1cbadc84#diff-af62cb3a3a7c777bd1b8feed18657c3ecae951d2dbdea55527f08c8c67967c71

mou-hao commented 2 years ago

Hey! Great work! That said, could you figure out why you had to make that change to the gRPC code? We want to use ServiceRegistrar. See this commit for details:

b5c450e#diff-af62cb3a3a7c777bd1b8feed18657c3ecae951d2dbdea55527f08c8c67967c71

The generated code has type *grpc.Server instead of ServiceRegistrar once I put go_dependencies() before go_rules_dependencies(). Seeing the commit you linked, I think what I did messed up the patch... Let me try to fix this.

mou-hao commented 2 years ago

I got ServiceRegistrar back. I'll update ntCreateFile to return an error that gets matched by os.IsExist() and the remote execution tomorrow when I got time. Thanks for the quick review!