https://linen.dev logo
Failed to compile cargo-shuttle 0.12
# help
g
Copy code
error: failed to run custom build command for `shuttle-proto v0.12.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installh2AJri/release/build/shuttle-proto-4c1d8faba569ceb5/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=./provisioner.proto
  cargo:rerun-if-changed=./runtime.proto
  cargo:rerun-if-changed=./

  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: runtime.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-shuttle v0.12.0`, intermediate artifacts can be found at `/tmp/cargo-installh2AJri`
Rust 1.68.0
Keeping you posted as soon as we are in the clear with the release 🙂 Info for upgrading the project will be available in a bit.
g
Sure, but I don't think compiling protobufs are related to shuttle being offline 😶 🤞
g
The latest release will require
protoc
installed :/
g
ahh ok 🙂
I already have the latest one though... :/
Copy code
$ protoc --version
libprotoc 3.12.4
g
Ah, that's good! 🙂 But we are rolling out the release right now and fighting it, hence some downtime/issues is expected as announced 😄
k
It is actually not the latest, maybe you installed with
apt
? We need at least version 3.15, but the latest is 3.22. I've added a not about this to the release notes as well.
But the release notes have not been released yet 😅
g
What is the preferred way to install it?
k
I would recommend this on linux:
And this release:
The command at the bottom here should work too, but use a newer version:
g
Thanks, it seems to be working
Their version numbers are scary tho... 3.12 -> 22.2
Perhaps they moved the minor version to the major position
k
I think the major version is implied for some of the release notes, it's weird 🤔
g
just bumped into this as well, but the error message is what lead me to apt
Copy code
--- stderr
  thread 'main' panicked at 'Could not find `protoc` installation and this build crate cannot proceed without
      this knowledge. If `protoc` is installed and this crate had trouble finding
      it, you can set the `PROTOC` environment variable with the specific path to your
      installed `protoc` binary.If you're on debian, try `apt-get install protobuf-compiler` or download it from https://github.com/protocolbuffers/protobuf/releases
anyway going to try the recomended solution
For the next person who lands here (Actually wondering if it's easy to end up here) You can find the "install" instructions here https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os Note replacing step 1 with either of the below options is easier You can use (Complements to @gentle-ice-1561 for providing it)
Copy code
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.2/protoc-22.2-linux-x86_64.zip
or go to https://github.com/protocolbuffers/protobuf/releases/tag/v22.2 then under assets click the file named protoc-22.2-linux-x86_64.zip
g
I agree that this step can be clarified a lot
g
it's not unzipping for me (Since resolved instructions above updated accordingly)
Copy code
unzip protoc-3.22.2-linux-x86_64.zip 
Archive:  protoc-3.22.2-linux-x86_64.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of protoc-3.22.2-linux-x86_64.zip or
        protoc-3.22.2-linux-x86_64.zip.zip, and cannot find protoc-3.22.2-linux-x86_64.zip.ZIP, period.
@gentle-ice-1561 any chance the command you used is still in your history and you can check it for me please?
g
Unzipping worked for me, what command did you download it with?
g
let me get it
what I posted is not it
edited it to the command I used
The download command is actually the one I want
I think that's what I got wrong as well
g
I assume you set the PB_REL variable before that? IMO that step confuses more than in helps. I used
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.2/protoc-22.2-linux-x86_64.zip
, the simplest way IMO.
g
ok thanks
in hindsight don't see why I cannot just download from the website
going to just try that
actually in the interest of time
I'll just use the command you used
g
that is what wget does 😉
g
yeah that's where I got the idea from
lol
for anyone who want a link they can just click
well that pops up a scary prompt
so maybe that's not the best idea
Go to https://github.com/protocolbuffers/protobuf/releases/tag/v22.2 then under assets click the file named
protoc-22.2-linux-x86_64.zip
Thanks @gentle-ice-1561 that worked I had added 3 to the front of the version number didn't realize it was now on 22 and apt-get was still installing 3
I thought it was 3.22
g
Yeah they made it very confusing
g
Going to edit my original message with correct instructions for the next person
PS. Remember I thought it worked. Well after I ran the command I got a file. But now that I know that my command was wrong I went to look at what was actually in the file and well...
Copy code
$ cat protoc-3.22.2-linux-x86_64.zip 
Not Found
Turns out it's just the error message not the content I was after
g
Well, I wouldn't recommend running
cat
on a zip file... Anyways, seems like it might have ended up in the wrong directory?
g
I did run cat on the zip file, and turns out it wasn't a zip file. It was a text file with only "Not Found"
g
Oh 😅 , then try removing it and do the wget command again. It shouldn't act like that
g
I used your wget command got a 2.8mb file compared with the 9 byte file I'd gotten the first time
I only realized the size when it failed to unzip
But it was my fault kinda I chose the wrong filename
g
Oh, yeah that was from the previous attempt then
g
I didn't understand what the filename was supposed to be
yeah it was
I was curious what had gone wrong
the new one did unzip
g
Ahh, so this message is from tonic-build... That's unfortunate, would be nice if shuttle warned the user before compiling if
protoc
isn't found, with a less misleading message.
g
not sure what tonic-build is. But I got it after I ran
cargo install cargo-shuttle
g
It is the crate (that shuttle depends on) which requires
protoc
g
ah I see
thanks for explaining
yes I agree it might be good to do that but I'm not sure how easy it is, can't remember if this error message came from the build script or before that
If it is easy it should 100% be changed because I almost gave up when I got the second error
and I'm not sure how many ppl would join the discord to search for answer to their error message
me a few years ago wouldn't
I would in this case just leave it alone and do something else but since I started rust I've found the community to be as good as ppl said so I always try first
take you for example you've gone out of your way to help me, and I really appreciate it
updated my message again, found better instructions in the release notes
a
heyyy I am getting this error:
Copy code
error: failed to run custom build command for `shuttle-proto v0.12.0`

Caused by:
  process didn't exit successfully: `C:\Users\u\AppData\Local\Temp\cargo-installq9co5Y\release\build\shuttle-proto-1e88d0d4f21ebeb7\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=./provisioner.proto
  cargo:rerun-if-changed=./runtime.proto
  cargo:rerun-if-changed=./

  --- stderr
  Error: Custom { kind: PermissionDenied, error: "failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: \"C:\\\\protoc-22.2-win64\\\\bin\"): Access is denied. (os error 5)" }
warning: build failed, waiting for other jobs to finish...
Anyone knows how to fix it:)
posting here as it is also related to protc:)
protoc
I first got this error as well, but now it says that other error
g
Seems like you installed protoc in C:\\, and don't have permission to access it. Which method/tool did you install it with?
a
installed it manually as I was too lazy to install chocolately
🙂
but can move it to another location if that fixes it
not sure
g
Yeah, try something like C:\Program Files\protoc...
a
but its weird cause I also run sqlite from here
but ye idk
will try
okay testing rn
if it doesnt work, I will try chocolately cause just saw that I ampparently installed chocolately before
hahahah
okay it still didnt work, so set it up with chocolately now the error changed to error os 3:
Copy code
error: failed to run custom build command for `shuttle-proto v0.12.0`

Caused by:
  process didn't exit successfully: `C:\Users\u\AppData\Local\Temp\cargo-installUQSQwG\release\build\shuttle-proto-1e88d0d4f21ebeb7\build-script-build` (exit code: 1)    
  --- stdout
  cargo:rerun-if-changed=./provisioner.proto
  cargo:rerun-if-changed=./runtime.proto
  cargo:rerun-if-changed=./

  --- stderr
  Error: Custom { kind: NotFound, error: "failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: \"C:\\\\protoc-22.2-win64\\\\bin\"): The system cannot find the path specified. (os error 3)" }
warning: build failed, waiting for other jobs to finish...
😦
g
The error says it's still looking in C:\\\\protoc-22.2-win64\\\\bin\
a
ye just restarted the shell, hopefully it works now
g
Yeah thats a good start
a
it works now!
thanks a lot
had to set an environment variable manually
22 Views