-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Theia not buildable on Windows #11235
Comments
@msujew
As I am new to all this stuff, is there a way to force the usage of a newer node-gyp version? |
@paul-marechal Any better recommendations? |
This doesn't tell us anything regarding an eventual failure.
This is clearly stating the problem. I've had issues with npm |
@paul-marechal I have installed Visual Studio 2022 manually. Not 2017 as I am not able to find that. Maybe my bad, but for a new setup I thought 2022 should also work. If that assumption is wrong, please let me know. Visual Studio 2022 is NOT RECOGNIZED by node-gyp in version 7.1.2 that is used by the Theia build. This is a bug in node-gyp and was fixed in a version 8.4 if I read the ticket correctly. But updating to a newer node-gyp version via npm did not change anything, as the Theia build is NOT CONSUMING a newer node-gyp version. There is neither an indication in the Theia docs, the nvm docs, or the node-gyp docs on how I can solve this. From my understanding a newer node-gyp version needs to be used to make it work with Visual Studio 2022 as the older version does not recognize that version. But how and where can I force the build to use the newer node-gyp version? |
I'm just surprised that you are having this issue as I have been developing for Theia on Windows for quite some time now, and recently had to help interns setup their own Windows machine and didn't encounter your issue. Maybe just an issue with VS 2022 indeed?
|
Looking at my setup, I am using VS 2019 available here: https://visualstudio.microsoft.com/vs/older-downloads/ edit: The VS Build Tools setup even seem to propose older MSVC versions (see bottom): I'll try installing VS 2022 see if I have the same problem as you. |
From your trace you had not set
But after trying on my side, it still doesn't work and is indeed a "bug" from node-gyp: They seem to explicitly list all supported versions, and if something falls out of it then it won't work. This is a pretty surprising mechanism to me, but after looking at their PR it looks like this is why. Installing The MSVC v142 (VS 2019) from the 2022 installation also doesn't seem to help. edit: To add insult to the injury, yarn seems to pick a random Sorry if I came across with a bad tone, I've seen so many working installations on Windows that I took some shortcuts here. The conclusion is that without updating your node-gyp installation, then using VS 2022 won't work. This is out of this repo's hands, but you can do this by following the following instructions: https://github.com/nodejs/node-gyp/blob/master/docs/Updating-npm-bundled-node-gyp.md Alternatively, you can use VS 2019 from https://visualstudio.microsoft.com/vs/older-downloads/. edit: Note that in our documentation we mention using VS 2017. |
Not sure if this is really random. If I execute
I followed the instructions you linked to, to update the the node-gyp version in the node installation. But it did not have any effect. It still uses the 7.1.2 version. Nothing I tried so far lead to using node-gyp in version 8.4.1 when calling yarn in the theia root folder.
Yes the documentation mentions this. As I said initially, I am new to the whole web-based IDE development and Visual Studio topic. So I simply followed the tutorial and the links provided there. And this lead to a Visual Studio 2022 installation. I noticed that there are options for installing the 2017 and 2019 versions within the installation and I selected those options. But as you also noticed, without any effect. I now installed VS 2019 manually, and suddenly get another error:
I assume it is some networking error. I am behind a proxy firewall and have CNTLM configured. I have set the proxy configuration for npm and yarn. But with no success. Any idea? |
This new error means you got passed the node-gyp build, it is now Found the following info:
If I understand correctly you need to set a few environment variables:
|
And it seems like the highest hoisted node-gyp version is not the one being "installed" by yarn under
We can see the path used to run node-gyp in
This is quite confusing, and looks like a quirk from Yarn? Explicitly declaring a dev-dependency on |
@paul-marechal Thanks a lot for your support!
That was the missing part indeed. I configured the proxy for npm and for yarn as described here, but I missed the environment variables for the global agent (probably because I was not aware of that thing). Maybe the proxy configuration settings needed for the Theia build (npm/yarn/global agent) would be interesting as a chapter in the Developer docu?
I think that is exactly the answer to my initial question. :) Let me know once the PR got merged. Then I will uninstall the 2019 version again and try to build with only 2022 and the Theia build. |
Today I tried to create a Theia based application as described here https://theia-ide.org/docs/composing_applications/ Having only Visual Studio 2022 installed it is impossible to build. Again the node-gyp version issue. But I am also not able to add a newer node-gyp version to the dev dependencies of the package.json. Probably I still don't fully understand how the build works. I had to install Visual Studio 2019 to make the build work. Yes it is described that you should use a 2017 (2019 also works, but not 2022), but the link in the documentation points only to the download of the 2022. This is misleading for newcomers. https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#building-on-windows BTW, in the building on windows section it still says that node 12.14.1 should be used, but in the top it information was updated to >= 14. |
It's a dependency mess. For some reason, some transient packages pull various versions of node-gyp, and even when a more up to date node-gyp version is installed at the top of the package tree, Yarn keeps running a different version which makes no sense to me. Can you share your
Ultimately there's no good reason for 2022 to not work... We just got to figure out here how we can get all the tooling to play well enough to pick up the right node-gyp version. My current guess is that it's a Yarn bug (as it doesn't seem to generate scripts pointing to the top-most node-gyp), though it's only a guess for now. It could be a good idea to mention this limitation in the documentation until this is sorted out, I agree.
Good catch, PRs are welcome ;) |
I followed the Build your own IDE/Tool tutorial and added the dev dependency:
The problem is that the yarn command is not even able to work and stops with this message:
Only after I installed Visual Studio 2019 the build works at least until - resolve 1 extension - (which then fails for some socket connection). After that is done the
That output actually looks ok from what I can see. But somehow the initialization fails. Or is it somehow possible to configure the dependency to be taken up in an earlier step? BTW, when calling
Is this known? Should it be this way? Or does this show up an issue, either in the project setup as shown in the documentation or in my local setup? And do you have any idea about the following error?
I'm behind a proxy and have configured the proxy via environment variables (HTTP_PROXY, HTTPS_PROXY, GLOBAL_AGENT_HTTP_PROXY, GLOBAL_AGENT_HTTPS_PROXY, ELECTRON_GET_USE_PROXY), via npm config and yarn config. Is there any configuration I have missed that could cause the issue. I haven't found any information on that. Or could it be some other networking isssue I haven't thought of? |
@fipro78 Are you using a Theia newer than
Yeah, that's a webpack issue, but it doesn't affect the build in any way. |
Hm, well I am using the package.json that is shown in the documentation which is using the Where would I need to set the Looking into the examples I haven't seen the usage of the |
@fipro78 You can run
In the script which calls the
We have the plugins in the root of our repo instead of the examples. You can see the Line 110 in 7445e23
Your build failed at the point where the |
@msujew What I meant by "didn't see in the examples" is, that the builtin-extension-pack is not used anywhere in the examples. It is only mentioned in the documentation, but without any explanation what this plugin is used for. I have found the sources and the readme here: https://github.com/eclipse-theia/vscode-builtin-extensions But if it is required, why is it not used by any of the examples that consume built-in plugins? Probably I again misunderstand something. :( |
@fipro78 Theia users usually pin their Theia version to the one they want to use (the newest is 1.27.0 as of yesterday). That way they don't accidentally pull in mismatching versions and know exactly what they're pulling. Updating Theia versions can be as simple as updating the pinned Theia dependencies, assuming no breaking changes prevent you from compiling. Our documentation usually refers to As the name suggests, the builtin extension pack is an extension pack that contains all builtin extensions. It isn't required in any way, and there are other ways to pull all builtin extensions on build (such as declaring them explicitly) if you want. The builtin extensions are just the list of extensions that are deployed with vscode by default. |
@msujew @paul-marechal should we update the documentation with some information uncovered in this issue? If we are happy with the state of the doc, let's close this. |
If we have no action item and no actual bug seeming to come out of this, I'm closing the issue. |
I tried to follow the documentation for building Theia on Windows:
https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#building-on-windows
I installed the necessary tools and tried to build, but it fails with the following error:
I have installed the Visual Studio Build Tools and the Visual Studio Community and got of course the 2022 version. After trying several things I noticed this ticket: nodejs/gyp-next#132
I locally installed node-gyp 8.4.1 (the newest 9.0 seems to be incompatible with the npm version 12.14.1 that is recommended in the documentation) but that didn't change anything. The build still seems to use node-gyp 7.1.2
Since I am not (yet) aware of all the structures for building Theia etc., where can I update the node-gyp version to be able to build locally on a Windows machine?
The text was updated successfully, but these errors were encountered: