Closed gitcrumbs closed 1 year ago
Can you please describe your setup?
One thing we didn't mention in the release notes for the binaries is that the windows one is built for mingw. We do not presently have a visual studio version. Additionally, the prebuilt protoc-gen-js binaries are dynamically linked, so wondering if it's a version mismatch.
I added this exe file in the environment variables path and trying to generate the files using protoc command. I get the below error on executing the command.
I rebuilt this project using bazel and VS Build Tools 2019. New exe-file works fine.
I think the original file was built via mingw with dynamic library which is not included in archive. But I didn't find a way to build via mingw.
I also encountered this problem, please help me ! ! !
We dynamically link against libstdc++ and do not provide a DLL with the expectation that it and other dependencies are already in your PATH. Can you confirm if you already have libstdc++ available?
Libraries libstdc++-6.dll and libwinpthread-1.dll does not exists in OS Windows by default. Installing MinGW only to get two libraries is not a good idea for js developers. Also MinGW installer doesn't copy libraries to any (system) directory where program can find it.
Thank you for the info. For this particular plugin, we expected users to have MinGW. However, if the installer isn't placing the libraries anywhere useful, then we have a problem. At a minimum we should document the steps required to get it running.
We can also look into the feasibility of distributing the DLLs themselves. Ideally we would use static linking, but it's just not how we're setup at present.
+1 to this problem.
I have tried several pre-built version of MinGW libraries, when I copy the dlls into same folder where protoc-gen-js located, the error from #issue-1402244641 disappeared. Instead, showing an another error:
protoc-gen-js is from https://github.com/protocolbuffers/protobuf-javascript/releases/download/v3.21.2/protobuf-javascript-3.21.2-win64.zip
+1
+1
Similar to @Gateswong, having found and added those two .dll's to the same directory as the protoc-gen-js executable I still fail to run the protoc command:
> protoc --js_out=import_style=commonjs:grpc proto/tv.proto
--js_out: protoc-gen-js: Plugin failed with status code 3221225781.
It doesn't help that the error message is basically meaningless.
For what it's worth I just generated the client I wanted inside WSL and copied files back into windows. Doesn't take that long.
Faster than install c++ redistributables, VS build tools, MinGW etc and finding out none of it helps 😆
Using the following I can generate an .exe that works great when run from Powershell with Node 14 installed:
choco install visualstudio2019buildtools visualstudio2019-workload-vctools
$env:BAZEL_VC="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC"
git clone https://github.com/protocolbuffers/protobuf-javascript && cd protobuf-javascript
git checkout v3.21.2
npm install
bazel build plugin_files
Get protoc-gen-js.exe from .\bazel-bin\generator
Right now the distributed version (3.21.2) of protoc-gen-js.exe for Windows is effectively useless as there are no work arounds known that allows it to function. I even attempted to use it within MinGW to no avail.
I've recently created the protoc-gen-js
npm project (https://github.com/yinzara/protoc-gen-js) that creates a simple way of getting the appropriately compiled binary available on any supported OS however it's currently ineffective for Windows because of this issue.
I have to say the sudden an unannounced decision to remove the "protoc-gen-js" plugin from being built into protoc
yet not actually making it function separately for all supported platforms has made us have to lock our protoc
to an old unsupported version for all languages now. Prevents us from properly using proto3 optional and other newer features across our enterprise. Makes 3rd party protobuf projects like ProtobufJS
and buf
's Protobuf-ES
actually be better supported than the reference implementation plugins.
I assume your normal internal build tools that currently make the releases will always use MinGW and using a different environment is hard or impossible.
What if you disabled the release for the win32 and win64 assets in Github from that internal tool and instead used Github Actions?
A community member (I'd be happy to) could submit a github actions configuration and you could use that to do the release of just the windows binaries.
Sorry for the delay; I was trying to see if I could get the build going, but running into problems that would take some time to sort through. We don't have an inherent limitation preventing windows builds; the current setup is just an artifact of what support was available to me at the time (it's bootstrapped off the work of others).
That said, if you or anyone else is able to contribute a GitHub Action, I think that would significantly improve the situation. My main request is that the action pull down a pre-built protoc from the official GitHub project like we currently do in our other actions.
Feel free to assign the review directly to me.
I've just updated the latest release with new protoc-gen-js binaries for win32/64 (thanks again @yinzara for the build actions that produced them).
Please let me know if you encounter any issues with them.
Two errors :
.
Unable to generate js files using protoc-gen-js files