Skip to content

Commit

Permalink
Update vscode-cpptools to v1.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
puremourning committed May 1, 2022
1 parent 35907da commit ed310cd
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 10 deletions.
17 changes: 8 additions & 9 deletions python3/vimspector/gadgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
'language': [ 'c', 'cpp', 'rust' ],
'download': {
'url': 'https://github.com/Microsoft/vscode-cpptools/releases/download/'
'${version}/${file_name}',
'v${version}/${file_name}',
},
'do': lambda name, root, gadget: installer.InstallCppTools( name,
root,
gadget ),
'all': {
'version': '1.7.1',
'version': '1.9.7',
"adapters": {
"vscode-cpptools": {
"name": "cppdbg",
Expand All @@ -53,28 +53,27 @@
'linux': {
'file_name': 'cpptools-linux.vsix',
'checksum':
'2ea9dd1bfbeff0b8153c45fa74692290307a33a2129dea36509efc8b35d515b9',
'74187bc858ce9e16a6ebd2a5157cd311d145d479aedb4d04ff568ea705d9e5a4',
},
'linux_arm64': {
'file_name': 'cpptools-linux-aarch64.vsix',
'checksum':
'0136033788c805f09b56175926403a26a79857197ea4d6addd699e1a99ce9401',
'4a7c571732f3b449b5ce79f03898c0b614365a8093337fe3808fcb2077897565',
},
'macos': {
'file_name': 'cpptools-osx.vsix',
'checksum':
'bab71db23b9221c6d5d40c7bb2243570ebe49a3bb7b9893033440681d27aa440',
'94175d74a5cc776ea5342e8907304745a6812458fb8f8569fe31d46891627f3b',
},
# doesn't work: https://github.com/microsoft/vscode-cpptools/issues/7035
'macos_arm64': {
'file_name': 'cpptools-osx-arm64.vsix',
'checksum':
'9dc7630463a9dce048bf96f30028f30a41889fea7be89c6d20cb93d156a9f3d6',
'02d0005e9bc5808435259f1ae81b0614659b978a9b87b983322caab63d66f4f0',
},
'windows': {
'file_name': 'cpptools-win32.vsix',
'checksum':
'469dcd619576cca700e917fef5e3f12ddce9d760d77e768042bd9566fadd71cb',
'98258c716284e81035b0368c558740dcbc425b6c1a19f9ed842db1da7a0817fa',
"adapters": {
"vscode-cpptools": {
"name": "cppdbg",
Expand All @@ -99,7 +98,7 @@
'windows_arm64': {
'file_name': 'cpptools-win-arm64.vsix',
'checksum':
'0427118d853d9262af824b28d102bbb6c11dc2eb66ff7f694336fd731ac404f7',
'64b9511ad570670219c0f2bd29dde18ea6ce4612f450c569a3745df761e0f38f',
},
},
'debugpy': {
Expand Down
14 changes: 13 additions & 1 deletion support/gadget_upgrade/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Manually updating shipped gadgets
# Auto download and checksum

This is useful for binary gadgets with lots of packages (like cpptools)

1. Update ../../python3/vimspector/gadgets.py with the new version/url, but
remove the checksums (set to `''`)
2. run ./download_and_checksum_gadget.py gadget_name to download the packages
for each platform/version and print the checksums
3. update ../../python3/vimspector/gadgets.py with the checksums
2. run ./download_and_checksum_gadget.py gadget_name again to veryify (should
all match and not re-download)

# Manually downlaoding and updating shipped gadgets

Download the gadget files manuall from their official source into this dir.
Run `./checksum.py <list of files>` to get the checksums.
Expand Down
56 changes: 56 additions & 0 deletions support/gadget_upgrade/download_and_checksum_gadget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env python3

import sys
import os
import string

# Gaim access to vimspector libs
sys.path.insert(
1,
os.path.abspath( os.path.join( os.path.dirname( __file__ ),
'..',
'..',
'python3' ) )
)

from vimspector import installer, gadgets

gadgets_to_sum = sys.argv[ 1: ]
results = []
for gadget_name in gadgets_to_sum:
if gadget_name not in gadgets.GADGETS:
print( f"WARNING: Unknown gadget {gadget_name}", file=sys.stderr )
continue

gadget = gadgets.GADGETS[ gadget_name ]
if 'download' not in gadget:
print(
f"WARNING: Gadget not downloadable (probably a git clone?) {gadget_name}",
file=sys.stderr )

destination = '.'

last_url = ''
for OS in 'linux', 'macos', 'windows':
for PLATFORM in 'x86_64', 'x86', 'arm64':
spec = {}
spec.update( gadget.get( 'all', {} ) )
spec.update( gadget.get( OS, {} ) )
spec.update( gadget.get( OS + '_' + PLATFORM, {} ) )

url = string.Template( gadget[ 'download' ][ 'url' ] ).substitute( spec )
if url == last_url:
# Probably not different for this arch
continue

file_path = installer.DownloadFileTo(
url,
destination,
file_name = gadget[ 'download' ].get( 'target' ),
checksum = spec.get( 'checksum' ) )

checksum = installer.GetChecksumSHA254( file_path )
results.append( f"{ gadget_name } { OS }_{ PLATFORM }: { checksum }" )

for result in results:
print( result )

0 comments on commit ed310cd

Please sign in to comment.