Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%1 is not a valid Win32 application #3923

Closed
fferri opened this issue Nov 20, 2017 · 5 comments
Closed

%1 is not a valid Win32 application #3923

fferri opened this issue Nov 20, 2017 · 5 comments

Comments

@fferri
Copy link

@fferri fferri commented Nov 20, 2017

I'm trying to get the Lua generator working on Windows (MSYS2/mingw64).
I installed 'protobuf' with luarocks.
It installed also the file /mingw64/lib/luarocks/rocks/protobuf/1.1.1-0/protoc-plugin/protoc-gen-lua, which I can run in a terminal without errors due to missing packages and such.
But if I run the protobuf compiler with this file as a plugin, I get:

$ protoc --plugin=protoc-gen-lua=/mingw64/lib/luarocks/rocks/protobuf/1.1.1-0/protoc-plugin/protoc-gen-lua --lua_out=. pubsub.proto
--lua_out: protoc-gen-lua: %1 is not a valid Win32 application.

Useful info:

$ pip3 show protobuf
Name: protobuf
Version: 3.4.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: protobuf@googlegroups.com
Author-email: protobuf@googlegroups.com
License: 3-Clause BSD License
Location: /usr/lib/python3.6/site-packages
Requires: six, setuptools
@xfxyjwf xfxyjwf added this to Backlog in Fixit Q4`17 (P2 Bugs) via automation Dec 11, 2017
@xfxyjwf
Copy link
Contributor

@xfxyjwf xfxyjwf commented Dec 14, 2017

@fferri Could you attach the protoc-gen-lua binary you are using?

@xfxyjwf xfxyjwf self-assigned this Dec 14, 2017
@xfxyjwf xfxyjwf moved this from Backlog to In progress in Fixit Q4`17 (P2 Bugs) Dec 14, 2017
@fferri
Copy link
Author

@fferri fferri commented Dec 14, 2017

@xfxyjwf you can find protoc-gen-lua here https://github.com/urbanairship/protobuf-lua inside the protoc-plugin directory. it is a python script (it's the same thing you get by installing the luarocks package I mentioned)

@xfxyjwf
Copy link
Contributor

@xfxyjwf xfxyjwf commented Dec 14, 2017

@fferri Hmm, a python script? If I remember correctly, the plugin must be either a .exe or a .bat. Could you try to create a .bat wrapper about the python script and try again?

@xfxyjwf
Copy link
Contributor

@xfxyjwf xfxyjwf commented Dec 14, 2017

I have verified a .bat file will work. Just create a protoc-gen-lua.bat file with the following content:

@<path_to_python.exe> <path_to_protoc-gen-lua>

and invoke protoc with:

protoc --plugin=protoc-gen-lua=protoc-gen-lua.bat --lua_out=. <proto>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants