vscode-proto3 icon indicating copy to clipboard operation
vscode-proto3 copied to clipboard

Can not compile protos on windows

Open rogeralsing opened this issue 7 years ago • 17 comments

I'm not sure if this is a windows issue or a general bug. Bug I can't compile my protos using the "proto3: Compile this proto" and there is no output anywhere so it's hard to say what is wrong.

These are my settings

    "protoc": {
        "path": "C:\\proto\\protoc.exe",
        "options": [
            "--gofast_out=plugins=grpc:.",
            "--proto_path=.",
            "--proto_path=c:\\projects\\src"
        ]
    }

and this works from cmd line:

protoc --gofast_out=plugins=grpc:. --proto_path=. --proto_path=c:\projects\src messages.proto

rogeralsing avatar Sep 28 '16 16:09 rogeralsing

Hi, thank you for the feedback.

Maybe you didn't have an active proto document when you execute 'proto3: Compile this proto' command? Sorry for this problem.

Buy the way, could you trigger the syntax check when you save proto file (write some bad syntax, save the proto file, and to see if there are wavy lines) ? If syntax check works, this command should also work.

zxh0 avatar Sep 29 '16 07:09 zxh0

The wavy lines works, i just tested it.

The main issue IMO is that there is no place to see the output so it becomes impossible to see if the issue is that some path or something can't be resolved.

The Protos do build fine in command line, and neither the "compile this" or "compile all" works for me, nothing happens

rogeralsing avatar Sep 29 '16 17:09 rogeralsing

Any progress on this?

It is unclear how windows paths should be escaped user settings:

{
    "editor.fontFamily": "Fira Code Retina",
    "editor.fontSize": 16,
    "editor.fontWeight":"400",
    "editor.fontLigatures": true,
    "protoc": {
        "path": "c:/proto/protoc.exe",
        "options": [
            "--gogoslick_out=plugins=grpc:.",
            "-I=.",
            "-I=c:/projects/src"
        ]
    }
}

I have tried many permutations and I'm still unable to get this to work. It looks like the plugin is using some default settings, as it do find errors etc. but it cannot find my imported protos

rogeralsing avatar Nov 17 '16 10:11 rogeralsing

i will try my best to make some progress this weekend :)

zxh0 avatar Nov 18 '16 02:11 zxh0

hi, not sure but i guess the problem is caused by the gogoslick_out option. i will do more investigation tomorrow.

zxh0 avatar Nov 19 '16 14:11 zxh0

I have tried with others like --gofast_out also.

rogeralsing avatar Nov 19 '16 18:11 rogeralsing

Slight slight progress on this one. At least the new version returns an error message "missing output directives" Not quite sure what that actually means. but it's not completely silent as it was before

rogeralsing avatar Nov 29 '16 16:11 rogeralsing

Really sorry for the slow response. I think the problem is that this extension can not work well with protobuf-golang-plugin. I will investigate more when I get some time.

zxh0 avatar Nov 30 '16 10:11 zxh0

This problem seems to have not been fixed.

rc452860 avatar Mar 11 '19 12:03 rc452860

still not working

lesomnus avatar Mar 29 '19 05:03 lesomnus

image

not working too!

nealwon avatar Apr 24 '19 11:04 nealwon

I am sorry guys. I have no windows machine & time budget for now. I will try to solve this problem when I get some time.

zxh0 avatar Apr 24 '19 12:04 zxh0

My system is OSX 10.14.3

nealwon avatar Apr 28 '19 05:04 nealwon

Not working also on Linux, same error "missing output directives"

AdallomRoy avatar Dec 28 '20 11:12 AdallomRoy

Same on macos. I am unable to make this work. I also get "could not import work/services/product/proto (no required module provides package "work/services/product/proto")compiler" when trying to import the proto in golang.

ragvri avatar Feb 17 '21 13:02 ragvri

Working for me on Windows 10 environment PATH include protoc

settings

    "protoc": {
        "options": [
            "--proto_path=${workspaceRoot}",
            "--go_out=."
        ],
        "path": "protoc"
    }
syntax = "proto3";
package pb;

option go_package = "/pb";
message User {
int32 id = 1;
string name = 2;
}

imloama avatar Apr 10 '23 09:04 imloama

+1

zs-dima avatar Sep 28 '23 17:09 zs-dima