I've spent the last couple of days trying to get a...
# spicedb
a
I've spent the last couple of days trying to get a PHP library working so that I could use PHP and SpiceDB over gRPC. Using the Ruby project as my starting point, I was able to get classes to generate. However I've had a lot of issues. Some seem to be with the tooling for generating classes and the bug that put me at a complete standstill may be related to the protobuf PHP extension. The SpiceDB PHP library I created can be found here (it doesn't work): https://github.com/alsbury/chiphpotle The issue that I'm having is documented briefly here: https://github.com/alsbury/chiphpotle/issues/1 If anyone has any ideas on how I can get to the bottom of this, I'm interested in feedback. Getting a working PHP library for SpiceDB would open up SpiceDB to a large community.
j
Let me take a look. I spent a bit of time looking into this on Friday.
I think we might need to pull down the protos for protoc-gen-validate and also build those
one big difference I see between my composer.json and yours is the versions
Copy code
"php": "^8",
        "grpc/grpc": "^v1.42.0",
        "google/protobuf": "^v3.20.1"
i used a newer google/protobuf
did you manually write the missing stubs in GBPMetadata?
a
Yes, I just stubbed them out to see what would happen. I’m still new to gRPC, so I’m not quick in debugging. Trying to figure out what versions and tools to use and how to get them working together.
What version of google/protobuf did you end up using? I can’t remember how I ended up with that specific version.
j
I pinned v3.20.1 as shown above. I know I started out by copy and pasting from the gRPC docs and then tried to bump them to what the other SDKs versions were and then lowered them until they worked, lol.
a
Ok, for some reason I thought that was what was in my composer.json.
@jzelinskie I've updated my repo. Versions have been updated. Also added the commands to run in readme to replicate the issue I'm running into. If you can take a look, I'd appreciate it.
Thanks
Copy code
Fatal error: Unable to load descriptor: Depends on file 'validate/validate.proto', but it has not been loaded
 in /var/www/src/GPBMetadata/Authzed/Api/V1/PermissionService.php on line 132
is what you should see