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

Test: Multi-platform builds #6866

Closed
2 tasks done
chrmarti opened this issue Jun 28, 2022 · 3 comments
Closed
2 tasks done

Test: Multi-platform builds #6866

chrmarti opened this issue Jun 28, 2022 · 3 comments
Labels
containers Issue in vscode-remote containers testplan-item Test plan item/assignments for upcoming release
Milestone

Comments

@chrmarti
Copy link
Contributor

chrmarti commented Jun 28, 2022

Refs: #5652

Complexity: 3

Create Issue


  • Install Dev Container CLI 0.7.0: npm i -g @devcontainers/cli (installs system-wide)
  • Set "experimental": true in Docker Desktop's preferences:

image

  • Create own builder: docker buildx create --name mybuilder --use
  • Build for multiple platforms, e.g.: devcontainer build --workspace-folder <workspace folder> --platform linux/arm64,linux/amd64 --image-name <your Docker ID>/test-multi-platform --push
    • Requires a workspace folder with a devcontainer.json. Use F1 > Remote-Containers: Add Development Container Configuration Files to add one.
    • Requires you being logged in to Docker. (Either via Docker Desktop or docker login.)
  • Check the manifest shows the built platforms: docker manifest inspect <your Docker ID>/test-multi-platform
  • Try some varations. Use docker buildx inspect to show a list of supported platforms.
  • After testing, switch back to default builder: docker buildx use default
@chrmarti chrmarti added containers Issue in vscode-remote containers testplan-item Test plan item/assignments for upcoming release labels Jun 28, 2022
@chrmarti chrmarti added this to the June 2022 milestone Jun 28, 2022
@jrieken jrieken removed their assignment Jun 28, 2022
@karrtikr
Copy link

karrtikr commented Jun 29, 2022

Attempting to install npm i -g @devcontainers/cli fails for me with the following error:

npm ERR! code 1
npm ERR! path C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\@devcontainers\cli\node_modules\node-pty
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.18.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.13 found at "C:\Users\karraj\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS 
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16        
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (child_process.js:390:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at maybeClose (internal/child_process.js:1058:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22518
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\karraj\\AppData\\Roaming\\nvm\\v14.18.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\@devcontainers\cli\node_modules\node-pty
npm ERR! gyp ERR! node -v v14.18.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

Is there a recommended version for node/npm or any other prerequisites I should be aware of?

Update: I've tried installing the latest stable version of npm/node etc, it's still failing but with a different error.

@chrmarti
Copy link
Contributor Author

Currently you need a C++ compiler to compile one of the dependencies when installing. See https://github.com/microsoft/vscode/wiki/How-to-Contribute on how to install one (without installing Visual Studio, but that would work too).

@karrtikr
Copy link

karrtikr commented Jun 30, 2022

I've tried both Visual Studio Build Tools & Visual Studio community, and set npm config set msvs_version 2022. The gist of this error is find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community", I believe I'm running into nodejs/node-gyp#2527 (comment) where VS 2022 isn't supported with Windows 11 insiders.

See full error

C:\Users\karraj>npm i -g @devcontainers/cli
npm ERR! code 1
npm ERR! path C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\@devcontainers\cli\node_modules\node-pty
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.18.2 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.13 found at "C:\Users\karraj\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2022
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack     at C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (child_process.js:390:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack     at maybeClose (internal/child_process.js:1058:16)
npm ERR! gyp ERR! System Windows_NT 10.0.22518
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\karraj\\AppData\\Roaming\\nvm\\v14.18.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\karraj\AppData\Roaming\nvm\v14.18.2\node_modules\@devcontainers\cli\node_modules\node-pty
npm ERR! gyp ERR! node -v v14.18.2
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

At this point it's best if someone else can have a look, I've mentioned on slack.

@karrtikr karrtikr removed their assignment Jun 30, 2022
@rzhao271 rzhao271 reopened this Jun 30, 2022
@rzhao271 rzhao271 self-assigned this Jun 30, 2022
@rzhao271 rzhao271 removed their assignment Jun 30, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers testplan-item Test plan item/assignments for upcoming release
Projects
None yet
Development

No branches or pull requests

4 participants