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

Building with VS2022 under Windows 11 #21

Closed
suchja opened this issue May 2, 2023 · 20 comments
Closed

Building with VS2022 under Windows 11 #21

suchja opened this issue May 2, 2023 · 20 comments

Comments

@suchja
Copy link

suchja commented May 2, 2023

Solution: #21 (comment)


I'm trying to get this (as well as the InfernoEmbedded fork) to build for several hours now. Unfortunately the node-gyp is not working. Most likely it is not an issue at all with this repo, but with my configuration. However, as you guys figured out how to build, I hope someone can point me into the right direction. I'm willing to create some enhanced installation / build instructions, if you think it is required (I do ;).

I'm using Win11 (in a VM) and VS2022 (including the desktop C++ workload). I've installed NVM for windows and I am using node 8.17.0 as suggested. Also I finally installed pyenv with Python 2.7.18.

The problem I'm mainly facing is this:

gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2022
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS - will only use this version
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS looking for Visual Studio 2013
gyp ERR! find VS - not found
gyp ERR! find VS msvs_version does not match this VS Command Prompt or the
gyp ERR! find VS installation cannot be used.
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Users\lernmoment\AppData\Roaming\nvm\v8.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at findVisualStudio2013 (C:\Users\lernmoment\AppData\Roaming\nvm\v8.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16)
gyp ERR! stack at regSearchKeys (C:\Users\lernmoment\AppData\Roaming\nvm\v8.17.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16)
gyp ERR! stack at regGetValue (C:\Users\lernmoment\AppData\Roaming\nvm\v8.17.0\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7)
gyp ERR! stack at C:\Users\lernmoment\AppData\Roaming\nvm\v8.17.0\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:288:5)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at maybeClose (internal/child_process.js:915:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
gyp ERR! System Windows_NT 10.0.22621
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\lernmoment\AppData\Roaming\nvm\v8.17.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\deepnest-cmidgley
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I've added the following lines to my .npmrc and I would think, that it is working:

msbuild_path="C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\MSBuild.exe"
msvs_version=2022

However, it looks like it is not able to use my VS2022. Is somebody using VS2022 for build deepnest? Otherwise I would assume that node-gyp is simply not compatible with VS2022 (or at least not the old node-gyp version used here).

@ghost
Copy link

ghost commented May 4, 2023

@suchja , may I suggest that we get initially your requirements straight?

  • under Windows 11
    • => is this a MUST requirement, or can we fallback to Windows 10 here?

@suchja
Copy link
Author

suchja commented May 4, 2023

@abebeos

may I suggest that we get initially your requirements straight?

Absolutely!

I currently have only Win11 for development. The release version should run on Win10. I wasn't aware that there are such differences. Is it because building the addon.cc involves the WinSDK?

Sorry, but I'm not aware of any other requirements. Ado you need to know something else?

@ghost

This comment was marked as outdated.

@ghost
Copy link

ghost commented May 4, 2023

@suchja , is the anonymous backer on bountysource you?

@ghost

This comment was marked as outdated.

@bosd
Copy link
Contributor

bosd commented May 4, 2023

My tech skills are not on par for this. But maybe I can give some pointers..

@suchja

I'm trying to get this (as well as the InfernoEmbedded fork) to build for several hours now.

The code in this repo is from @cmidgley, which also has containts the commits of the InfernoEmbedded fork.
Correct me if I'm wrong.

However, as you guys figured out how to build
I think this is the main issue now with this code.
(Personally I don't have the knowdledge/ did not even make an attempt)

Another fork which might be wortwhile looking into is this one.
Some dependencies are updated. Also supports a more recent python version (or not??)
https://github.com/9swampy/Deepnest/tree/develop

The changes from that repo have not been commited here.
There is an docker image based on this one. Which some people had some success with.

@ghost

This comment was marked as outdated.

@ghost
Copy link

ghost commented May 4, 2023

@suchja , I can eliminate the error (you have) on my side simply by falling back to VS2019

Can you try this:

Build with VS2019

# unset VCINSTALLDIR
set VCINSTALLDIR=

npm config set msvs_version 2019

npm install

npm run w:build

npm run w:start

VS2022

Otherwise I would assume that node-gyp is simply not compatible with VS2022 (or at least not the old node-gyp version used here).

after doing some research, this seems to be true. Not sure how trivial it is to update (you should avoid this, use the existent code of this project until it is updated officially)

@ghost
Copy link

ghost commented May 4, 2023

Sorry, but I'm not aware of any other requirements. Ado you need to know something else?

Is VS2022 a MUST requirement, or can you fall-back to VS2019?

If VS2019 is ok, then the issue is solved (I would update the doc here a little bit to make things clearer, thus others do not fall into the same trap)

@ghost
Copy link

ghost commented May 4, 2023

(@bosd , ty, this needs now just a doc update. Will await confirmation of @suchja, and will then send something in to fix the docs)

@ghost
Copy link

ghost commented May 5, 2023

draft revision of the build instructions:

@cmidgley
Copy link
Contributor

cmidgley commented May 5, 2023

I attempted to upgrade to the latest everything earlier (including the latest Node and therefore node-gyp), but there were too many changes to Electron involved so I moved it as far forward as possible without breaking that. Somebody experienced with Electron likely could do those changes efficiently but it's not my expertise. There may be more involved, but that seemed to be the bulk of the lift.

@suchja
Copy link
Author

suchja commented May 5, 2023

Thank you all for your immense effort and the high quality and fast feedback! I'll start from scratch with a new VM and give the different provided options a try. Hope that I'll be able to do so on this weekend.

@ghost
Copy link

ghost commented May 5, 2023

Hey, @suchja, i got involved here in context of the bounty, see #21 (comment).

Ignoring my concrete questions and results is not the way to go.

You do not need a new vm.

@ghost
Copy link

ghost commented May 5, 2023

@suchja , is the anonymous backer on bountysource you?

Can someone please clarify who backed the bounty? https://app.bountysource.com/issues/120217906-building-with-vs2022-under-windows-11

@ghost ghost mentioned this issue May 5, 2023
12 tasks
@ghost
Copy link

ghost commented May 5, 2023

@cmidgley , I've added your info re updating to

@ghost
Copy link

ghost commented May 6, 2023

I've added a basic CI here, and it builds fine, just by falling back to a windows-2019 runner (uses VS2019).

https://github.com/deepnest-io/Deepnest/actions/runs/4899908971/jobs/8750207768

So, @suchja, this issue is solved, once you've verified on your side, please close thus I can process the bounty and go on with the other tasks here.

EDIT: see updated readme for instructions: https://github.com/deepnest-io/Deepnest/blob/master/README.md#prerequisites

@ghost
Copy link

ghost commented May 7, 2023

Did some additional work to get the project running, see APEX issues and the MAJOR issues/sub-issues:

@ghost
Copy link

ghost commented May 8, 2023

Closing, in order to speedup things and go on with:

@ghost ghost closed this as completed May 8, 2023
@ghost
Copy link

ghost commented Sep 26, 2023

@suchja , hi there!

As you possibly know, bountysource stopped paying out bounty-workers since early this year

bountysource/core#1586

The bountysource app is down since mid Sep. 2023

https://app.bountysource.com/issues/120217906-building-with-vs2022-under-windows-11

Paypal Buyer Protection

Though you got the service from me, I did not receive the payment, bountysource has kept the money.

You are now eligible for paypal buyer protection (others have gone successfully this path) :

bountysource/core#1586 (comment)

If you could do this, and pay me directly, you could keep the 10% for your efforts.

Thank you.

(EDIT: notified bounty-issuer additionally via email)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants