mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-12 00:37:19 +10:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3277bd4fa1 | ||
|
|
08b0b1b3e5 | ||
|
|
c46abc14ee | ||
|
|
5bd755a9cc | ||
|
|
1cbc6e55bf | ||
|
|
351460f992 | ||
|
|
f7e1c11ea7 | ||
|
|
50197bbeef | ||
|
|
b319b178ea | ||
|
|
2dab7cfcdf | ||
|
|
6a86200d38 | ||
|
|
c803059121 | ||
|
|
d529fd3c20 | ||
|
|
f817226abd | ||
|
|
353c002605 | ||
|
|
3f00a255b1 | ||
|
|
23152cf50f | ||
|
|
1f31a1c27b | ||
|
|
49eb715333 | ||
|
|
bbcdc2be11 | ||
|
|
dfd7ebbf85 | ||
|
|
e087f00ff1 | ||
|
|
79bc275386 | ||
|
|
851b5f2659 | ||
|
|
e5de9c3096 | ||
|
|
3b6954231f | ||
|
|
99840540ac | ||
|
|
3103c80234 | ||
|
|
6a4668040b | ||
|
|
02755e7599 | ||
|
|
36b06dd66b | ||
|
|
33a6670cad | ||
|
|
1ef601a79b | ||
|
|
c67c2ad9f5 | ||
|
|
d164e43b78 | ||
|
|
f3ba593ae7 | ||
|
|
78b32d7931 | ||
|
|
c71f2250ce | ||
|
|
b0154c7831 | ||
|
|
23313d41ba | ||
|
|
cf48030b59 | ||
|
|
848aabfe54 | ||
|
|
34b399c05a |
@@ -20,3 +20,6 @@ indent_size = 2
|
||||
[*.patch]
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
|
||||
[*.svg]
|
||||
insert_final_newline = false
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -30,7 +30,7 @@ A clear and concise description of what you expected to happen.
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. Mac OS, Ubuntu 16.04, etc]
|
||||
- OS: [e.g. Mac OS, Ubuntu 20.04, etc]
|
||||
- Architecture [e.g. x64, ia32, arm64]
|
||||
- Version [e.g. 1.33.0]
|
||||
|
||||
|
||||
47
.github/workflows/linux.yml
vendored
47
.github/workflows/linux.yml
vendored
@@ -9,7 +9,7 @@ on:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
@@ -88,14 +88,55 @@ jobs:
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./release.sh
|
||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
- name: Update versions repo
|
||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||
run: ./update_version.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
|
||||
GITHUB_USERNAME: ${{ github.repository_owner }}
|
||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
snap:
|
||||
needs: release
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Check version
|
||||
run: ./stores/snapcraft/check_version.sh
|
||||
env:
|
||||
ARCHITECTURE: ${{ matrix.platform }}
|
||||
SNAP_STORE_LOGIN: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||
|
||||
- uses: docker/setup-qemu-action@v1
|
||||
if: env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
- uses: diddlesnaps/snapcraft-multiarch-action@v1
|
||||
with:
|
||||
path: stores/snapcraft
|
||||
architecture: ${{ matrix.platform }}
|
||||
id: build
|
||||
if: env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
- uses: diddlesnaps/snapcraft-review-action@v1
|
||||
with:
|
||||
snap: ${{ steps.build.outputs.snap }}
|
||||
isClassic: 'true'
|
||||
if: env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
- uses: snapcore/action-publish@v1
|
||||
with:
|
||||
store_login: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||
snap: ${{ steps.build.outputs.snap }}
|
||||
release: stable
|
||||
if: env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./release.sh
|
||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
|
||||
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./release.sh
|
||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,6 +2,9 @@ vscode
|
||||
VS*/*
|
||||
.DS_Store
|
||||
build/linux/appimage/out
|
||||
build/linux/appimage/pkg2appimage.AppDir
|
||||
build/linux/appimage/pkg2appimage-*.AppImage
|
||||
build/linux/appimage/VSCodium
|
||||
build/windows/msi/releasedir
|
||||
build/windows/rtf/Readme (Abridged).txt
|
||||
build/windows/rtf/TXT to RTF Converter.exe
|
||||
|
||||
24
DOCS.md
24
DOCS.md
@@ -11,6 +11,7 @@
|
||||
- [Migrating from Visual Studio Code to VSCodium](#migrating)
|
||||
- [Sign in with GitHub](#signin-github)
|
||||
- [How do I run VSCodium in portable mode?](#portable)
|
||||
- [How do I fix the default file manager?](#file-manager)
|
||||
- [How do I press and hold a key and have it repeat in VSCodium?](#press-and-hold)
|
||||
- [How do I open VSCodium from the terminal?](#terminal-support)
|
||||
- [From Linux .tar.gz](#from-linux-targz)
|
||||
@@ -82,13 +83,13 @@ with the content:
|
||||
|
||||
### <a id="proprietary-debugging-tools"></a>Proprietary Debugging Tools
|
||||
|
||||
The debugger provided with Microsoft's [C# extension](https://github.com/OmniSharp/omnisharp-vscode) as well as the (Windows) debugger provided with their [C++ extension](https://github.com/Microsoft/vscode-cpptools) are very restrictively licensed to only work with the offical Visual Studio Code build. See [this comment in the C# extension repo](https://github.com/OmniSharp/omnisharp-vscode/issues/2491#issuecomment-418811364) and [this comment in the C++ extension repo](https://github.com/Microsoft/vscode-cpptools/issues/21#issuecomment-248349017).
|
||||
The debugger provided with Microsoft's [C# extension](https://github.com/OmniSharp/omnisharp-vscode) as well as the (Windows) debugger provided with their [C++ extension](https://github.com/Microsoft/vscode-cpptools) are very restrictively licensed to only work with the official Visual Studio Code build. See [this comment in the C# extension repo](https://github.com/OmniSharp/omnisharp-vscode/issues/2491#issuecomment-418811364) and [this comment in the C++ extension repo](https://github.com/Microsoft/vscode-cpptools/issues/21#issuecomment-248349017).
|
||||
|
||||
A workaround exists to get debugging working in C# projects, by using Samsung's opensource [netcoredbg](https://github.com/Samsung/netcoredbg) package. See [this comment](https://github.com/VSCodium/vscodium/issues/82#issue-409806641) for instructions on how to set that up.
|
||||
|
||||
### <a id="proprietary-extensions"></a>Proprietary Extensions
|
||||
|
||||
Like the debuggers mentioned above, some extensions you may find in the marketplace (like the [Remote Development Extensions](https://code.visualstudio.com/docs/remote/remote-overview)) only function with the offical Visual Studio Code build. You can work around this by adding the extension's internal ID (found on the extension's page) to the `extensionAllowedProposedApi` property of the product.json in your VSCodium installation. For example:
|
||||
Like the debuggers mentioned above, some extensions you may find in the marketplace (like the [Remote Development Extensions](https://code.visualstudio.com/docs/remote/remote-overview)) only function with the official Visual Studio Code build. You can work around this by adding the extension's internal ID (found on the extension's page) to the `extensionAllowedProposedApi` property of the product.json in your VSCodium installation. For example:
|
||||
|
||||
```json
|
||||
"extensionAllowedProposedApi": [
|
||||
@@ -134,10 +135,27 @@ Select the scopes dependending of the extension which need access to GitHub. (Gi
|
||||
If you are getting the error `Writing login information to the keychain failed with error 'The name org.freedesktop.secrets was not provided by any .service files'.`, you need to install the package `gnome-keyring`.
|
||||
|
||||
## <a id="portable"></a>How do I run VSCodium in portable mode?
|
||||
You can follow the [Portable Mode instructions](https://code.visualstudio.com/docs/editor/portable) from the Visual Studio Code website.
|
||||
You can follow the [Portable Mode instructions](https://code.visualstudio.com/docs/editor/portable) from the Visual Studio Code website.
|
||||
- **Windows** / **Linux** : the instructions can be followed as written.
|
||||
- **macOS** : portable mode is enabled by the existence of a specially named folder. For Visual Studio Code that folder name is `code-portable-data`. For VSCodium, that folder name is `codium-portable-data`. So to enable portable mode for VSCodium on Mac OS, follow the instructions outlined in the [link above](https://code.visualstudio.com/docs/editor/portable), but create a folder named `codium-portable-data` instead of `code-portable-data`.
|
||||
|
||||
## <a id="file-manager"></a>How do I fix the default file manager (Linux)?
|
||||
|
||||
In some case, VSCodium becomes the file manager used to open directories (instead of apps like Dolphin or Nautilus).<br />
|
||||
It's due to that no application was defined as the default file manager and so the system is using the latest capable application.
|
||||
|
||||
To set the default app, create the file `~/.config/mimeapps.list` with the content like:
|
||||
```
|
||||
[Default Applications]
|
||||
inode/directory=org.gnome.Nautilus.desktop;
|
||||
```
|
||||
|
||||
You can find your regular file manager with the command:
|
||||
```
|
||||
> grep directory /usr/share/applications/mimeinfo.cache
|
||||
inode/directory=codium.desktop;org.gnome.Nautilus.desktop;
|
||||
```
|
||||
|
||||
## <a id="press-and-hold"></a>How do I press and hold a key and have it repeat in VSCodium (Mac)?
|
||||
|
||||
This is a common question for Visual Studio Code and the procedure is slightly different in VSCodium because the `defaults` path is different.
|
||||
|
||||
28
README.md
28
README.md
@@ -7,7 +7,7 @@
|
||||
|
||||
<div id="badges" align="center">
|
||||
|
||||
[](https://github.com/vscodium/vscodium/releases)
|
||||
[](https://github.com/vscodium/vscodium/releases)
|
||||
[](https://dev.azure.com/vscodium/VSCodium/_build?definitionId=1)
|
||||
[](https://github.com/VSCodium/vscodium/blob/master/LICENSE)
|
||||
[](https://gitter.im/VSCodium/Lobby)
|
||||
@@ -28,6 +28,7 @@
|
||||
- [Install with Package Manager](#install-with-package-manager)
|
||||
- [Install on Arch Linux](#install-on-arch-linux)
|
||||
- [Flatpak Option](#flatpak)
|
||||
- [Build](#build)
|
||||
- [Why Does This Exist](#why)
|
||||
- [More Info](#more-info)
|
||||
- [Supported Platforms](#supported-platforms)
|
||||
@@ -65,14 +66,14 @@ scoop install vscodium
|
||||
```
|
||||
|
||||
#### <a id="install-with-snap"></a>Install with snap (GNU/Linux)
|
||||
VSCodium is available in the [Snap Store](https://snapcraft.io/) as [Codium](https://snapcraft.io/codium), published by the [Snapcrafters](https://github.com/snapcrafters/codium) community.
|
||||
VSCodium is available in the [Snap Store](https://snapcraft.io/) as [Codium](https://snapcraft.io/codium), thanks to the help of the [Snapcrafters](https://github.com/snapcrafters/codium) community.
|
||||
If your GNU/Linux distribution has support for [snaps](https://snapcraft.io/docs/installing-snapd):
|
||||
```bash
|
||||
snap install codium --classic
|
||||
```
|
||||
|
||||
#### <a id="install-with-package-manager"></a>Install with Package Manager (GNU/Linux)
|
||||
You can always install using the downloads (deb, rpm, tar) on the [releases page](https://github.com/VSCodium/vscodium/releases), but you can also install using your favorite package manager and get automatic updates. [@paulcarroty](https://github.com/paulcarroty) has set up a repository with instructions [here](https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo). Any issues installing VSCodium using your package manager should be directed to that repository's issue tracker.
|
||||
You can always install using the downloads (deb, rpm, tar) on the [releases page](https://github.com/VSCodium/vscodium/releases), but you can also install using your favorite package manager and get automatic updates. [@paulcarroty](https://github.com/paulcarroty) has set up a repository with instructions [here](https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo). Any issues installing VSCodium using your package manager should be directed to that repository's issue tracker.
|
||||
|
||||
#### <a id="install-on-arch-linux"></a>Install on Arch Linux
|
||||
VSCodium is available in [AUR](https://wiki.archlinux.org/index.php/Arch_User_Repository) as package [vscodium-bin](https://aur.archlinux.org/packages/vscodium-bin/), maintained by [@binex-dsk](https://github.com/binex-dsk). An alternative package [vscodium-git](https://aur.archlinux.org/packages/vscodium-git/), maintained by [@cedricroijakkers](https://github.com/cedricroijakkers), is also available should you wish to compile from source yourself.
|
||||
@@ -85,24 +86,29 @@ flatpak install flathub com.vscodium.codium
|
||||
flatpak run com.vscodium.codium
|
||||
```
|
||||
|
||||
## <a id="build"></a>Build
|
||||
Build instructions can be found [here](https://github.com/VSCodium/vscodium/blob/master/docs/build.md)
|
||||
|
||||
## <a id="why"></a>Why Does This Exist
|
||||
This repository contains build files to generate free release binaries of Microsoft's VS Code. When we speak of "free software", we're talking about freedom, not price.
|
||||
|
||||
Microsoft's releases of Visual Studio Code are licensed under [this not-FLOSS license](https://code.visualstudio.com/license) and contain telemetry/tracking. According to [this comment](https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005) from a Visual Studio Code maintainer:
|
||||
Microsoft's releases of Visual Studio Code are licensed under [this not-FLOSS license](https://code.visualstudio.com/license) and contain telemetry/tracking. According to [this comment](https://github.com/Microsoft/vscode/issues/60#issuecomment-161792005) from a Visual Studio Code maintainer:
|
||||
|
||||
> When we [Microsoft] build Visual Studio Code, we do exactly this. We clone the vscode repository, we lay down a customized product.json that has Microsoft specific functionality (telemetry, gallery, logo, etc.), and then produce a build that we release under our license.
|
||||
>
|
||||
>
|
||||
> When you clone and build from the vscode repo, none of these endpoints are configured in the default product.json. Therefore, you generate a "clean" build, without the Microsoft customizations, which is by default licensed under the MIT license
|
||||
|
||||
This repo exists so that you don't have to download+build from source. The build scripts in this repo clone Microsoft's vscode repo, run the build commands, and upload the resulting binaries to [GitHub releases](https://github.com/VSCodium/vscodium/releases). __These binaries are licensed under the MIT license. Telemetry is disabled.__
|
||||
|
||||
If you want to build from source yourself, head over to [Microsoft's vscode repo](https://github.com/Microsoft/vscode) and follow their [instructions](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run). This repo exists to make it easier to get the latest version of MIT-licensed VS Code.
|
||||
|
||||
Microsoft's build process (which we are running to build the binaries) does download additional files. This was brought up in [Microsoft/vscode#49159](https://github.com/Microsoft/vscode/issues/49159) and [Microsoft/vscode#45978](https://github.com/Microsoft/vscode/issues/45978). These are the packages downloaded during build:
|
||||
Microsoft's build process (which we are running to build the binaries) does download additional files. This was brought up in [Microsoft/vscode#141340](https://github.com/Microsoft/vscode/issues/141340) and [Microsoft/vscode#45978](https://github.com/Microsoft/vscode/issues/45978). These are the packages downloaded during build:
|
||||
|
||||
- Extensions from the Microsoft Marketplace:
|
||||
- [ms-vscode.node-debug2](https://marketplace.visualstudio.com/items?itemName=ms-vscode.node-debug2)
|
||||
- [ms-vscode.node-debug](https://marketplace.visualstudio.com/items?itemName=ms-vscode.node-debug)
|
||||
- [ms-vscode.references-view](https://marketplace.visualstudio.com/items?itemName=ms-vscode.references-view)
|
||||
- [ms-vscode.js-debug-companion](https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-debug-companion)
|
||||
- [ms-vscode.js-debug](https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-debug)
|
||||
- [ms-vscode.vscode-js-profile-table](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-js-profile-table)
|
||||
- From [Electron releases](https://github.com/electron/electron/releases) (using [gulp-atom-electron](https://github.com/joaomoreno/gulp-atom-electron))
|
||||
- electron
|
||||
- ffmpeg
|
||||
@@ -120,10 +126,10 @@ Please note that some Visual Studio Code extensions have licenses that restrict
|
||||
### How are the VSCodium binaries built?
|
||||
If you would like to see the commands we run to build `vscode` into VSCodium binaries, have a look at the workflow files in `.github/workflows` for Windows, GNU/Linux and macOS. These build files call all the other scripts in the repo. If you find something that doesn't make sense, feel free to ask about it [on Gitter](https://gitter.im/VSCodium/Lobby).
|
||||
|
||||
The builds are run every day, but exit early if there isn't a new release from Microsoft.
|
||||
The builds are run every day, but exit early if there isn't a new release from Microsoft.
|
||||
|
||||
## <a id="supported-platforms"></a>Supported Platforms
|
||||
The minimal version is limitted by the core component Electron, you may want to check its [supported platform list](https://www.electronjs.org/docs/tutorial/support#supported-platforms).
|
||||
The minimal version is limited by the core component Electron, you may want to check its [supported platform list](https://www.electronjs.org/docs/tutorial/support#supported-platforms).
|
||||
- [x] macOS (`zip`, `dmg`) OS X 10.10 or newer x64
|
||||
- [x] macOS (`zip`, `dmg`) macOS 11.0 or newer arm64 via x64 emulation, see [status issue](https://github.com/VSCodium/vscodium/issues/597)
|
||||
- [x] GNU/Linux x64 (`deb`, `rpm`, `AppImage`, `tar.gz`)
|
||||
@@ -133,7 +139,7 @@ The minimal version is limitted by the core component Electron, you may want to
|
||||
- [x] Windows 7 or newer x64
|
||||
- [x] Windows 7 or newer x86
|
||||
- [x] Windows 10 arm64
|
||||
|
||||
|
||||
## <a id="donate"></a>Donate
|
||||
If you would like to support the development of VSCodium, feel free to send BTC to `3PgjE95yzBDTrSPxPiqoxSgZFuKPPAix1N`.
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@ if [[ "$VSCODE_ARCH" == "x64" ]]; then
|
||||
sed -i 's/grep docker/# grep docker/' pkg2appimage.AppDir/usr/share/pkg2appimage/functions.sh
|
||||
|
||||
bash -ex pkg2appimage.AppDir/AppRun recipe.yml
|
||||
|
||||
|
||||
rm -f pkg2appimage-*.AppImage
|
||||
rm -rf pkg2appimage.AppDir
|
||||
rm -rf VSCodium
|
||||
fi
|
||||
|
||||
cd "${CALLER_DIR}"
|
||||
cd "${CALLER_DIR}"
|
||||
|
||||
@@ -30,11 +30,13 @@ script:
|
||||
- /usr/bin/convert vscodium.png -resize 48x48 usr/share/icons/hicolor/48x48/apps/vscodium.png
|
||||
- /usr/bin/convert vscodium.png -resize 32x32 usr/share/icons/hicolor/32x32/apps/vscodium.png
|
||||
- ( cd usr/bin/ ; ln -s ../share/codium/codium . )
|
||||
- rm -rf usr/lib/x86_64-linux-gnu
|
||||
- rm -f lib/x86_64-linux-gnu/libglib*
|
||||
- cat > AppRun <<\EOF
|
||||
- #!/bin/sh
|
||||
- HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
- export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
|
||||
- export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
|
||||
- export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
|
||||
- export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
|
||||
- export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}"
|
||||
- export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}"
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
|
||||
### <a id="dependencies-linux"></a>Linux
|
||||
|
||||
- GCC
|
||||
- make
|
||||
- pkg-config
|
||||
- libx11-dev
|
||||
- libxkbfile-dev
|
||||
- libsecret-1-dev
|
||||
@@ -25,6 +28,9 @@
|
||||
- rpm
|
||||
- rpmbuild
|
||||
- dpkg
|
||||
- python3
|
||||
- libsecret-1-dev
|
||||
- imagemagick (for AppImage)
|
||||
|
||||
### <a id="dependencies-macos"></a>MacOS
|
||||
|
||||
@@ -34,6 +40,8 @@
|
||||
- sed
|
||||
- 7z
|
||||
- [WiX Toolset](http://wixtoolset.org/releases/)
|
||||
- python2
|
||||
- 'Tools for Native Modules' from official Node.js installer
|
||||
|
||||
## <a id="build-scripts"></a>Build Scripts
|
||||
|
||||
@@ -70,4 +78,4 @@ export OS_NAME=linux
|
||||
export VSCODE_ARCH=x64
|
||||
|
||||
./build.sh
|
||||
```
|
||||
```
|
||||
|
||||
40
get_repo.sh
40
get_repo.sh
@@ -8,26 +8,26 @@ git remote add origin https://github.com/Microsoft/vscode.git
|
||||
|
||||
# figure out latest tag by calling MS update API
|
||||
if [ "$INSIDER" == "1" ]; then
|
||||
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/insider/lol)
|
||||
export MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
|
||||
export MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
|
||||
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/insider/lol)
|
||||
export MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
|
||||
export MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
|
||||
elif [[ -z "${MS_TAG}" ]]; then
|
||||
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol)
|
||||
export MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
|
||||
export MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
|
||||
UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol)
|
||||
export MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version')
|
||||
export MS_TAG=$(echo $UPDATE_INFO | jq -r '.name')
|
||||
else
|
||||
reference=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
|
||||
|
||||
if [[ -z "${reference}" ]]; then
|
||||
echo "The following tag can't be found: ${MS_TAG}"
|
||||
exit 1
|
||||
elif [[ "${reference}" =~ ^([[:alnum:]]+)[[:space:]]+refs\/tags\/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
|
||||
export MS_COMMIT="${BASH_REMATCH[1]}"
|
||||
export MS_TAG="${BASH_REMATCH[2]}"
|
||||
else
|
||||
echo "The following reference can't be parsed: ${reference}"
|
||||
exit 1
|
||||
fi
|
||||
reference=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
|
||||
|
||||
if [[ -z "${reference}" ]]; then
|
||||
echo "The following tag can't be found: ${MS_TAG}"
|
||||
exit 1
|
||||
elif [[ "${reference}" =~ ^([[:alnum:]]+)[[:space:]]+refs\/tags\/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
|
||||
export MS_COMMIT="${BASH_REMATCH[1]}"
|
||||
export MS_TAG="${BASH_REMATCH[2]}"
|
||||
else
|
||||
echo "The following reference can't be parsed: ${reference}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Got the MS tag: ${MS_TAG} version: ${MS_COMMIT}"
|
||||
@@ -39,6 +39,6 @@ cd ..
|
||||
|
||||
# for GH actions
|
||||
if [[ $GITHUB_ENV ]]; then
|
||||
echo "MS_TAG=$MS_TAG" >> $GITHUB_ENV
|
||||
echo "MS_COMMIT=$MS_COMMIT" >> $GITHUB_ENV
|
||||
echo "MS_TAG=$MS_TAG" >> $GITHUB_ENV
|
||||
echo "MS_COMMIT=$MS_COMMIT" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js
|
||||
index 6d3a369..57009d4 100644
|
||||
index 2f5a931..ac3d7e6 100644
|
||||
--- a/build/gulpfile.vscode.js
|
||||
+++ b/build/gulpfile.vscode.js
|
||||
@@ -276,7 +276,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
@@ -290,7 +290,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' }));
|
||||
} else if (platform === 'darwin') {
|
||||
const shortcut = gulp.src('resources/darwin/bin/code.sh')
|
||||
@@ -11,29 +11,20 @@ index 6d3a369..57009d4 100644
|
||||
|
||||
all = es.merge(all, shortcut);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ const generateVSCodeConfigurationTask = task.define('generate-vscode-configurati
|
||||
const arch = process.env['VSCODE_ARCH'];
|
||||
const appRoot = path.join(buildDir, `VSCode-darwin-${arch}`);
|
||||
const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app';
|
||||
- const appPath = path.join(appRoot, appName, 'Contents', 'Resources', 'app', 'bin', 'code');
|
||||
+ const appPath = path.join(appRoot, appName, 'Contents', 'Resources', 'app', 'bin', product.applicationName);
|
||||
const codeProc = cp.exec(
|
||||
`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`,
|
||||
(err, stdout, stderr) => {
|
||||
diff --git a/src/vs/platform/native/electron-main/nativeHostMainService.ts b/src/vs/platform/native/electron-main/nativeHostMainService.ts
|
||||
index 692db1d..cd173bc 100644
|
||||
index 3bd0c57..d921c60 100644
|
||||
--- a/src/vs/platform/native/electron-main/nativeHostMainService.ts
|
||||
+++ b/src/vs/platform/native/electron-main/nativeHostMainService.ts
|
||||
@@ -341,7 +341,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
||||
@@ -353,7 +353,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
||||
}
|
||||
|
||||
private async getShellCommandLink(): Promise<{ readonly source: string, readonly target: string }> {
|
||||
private async getShellCommandLink(): Promise<{ readonly source: string; readonly target: string }> {
|
||||
- const target = resolve(this.environmentMainService.appRoot, 'bin', 'code');
|
||||
+ const target = resolve(this.environmentMainService.appRoot, 'bin', this.productService.applicationName);
|
||||
const source = `/usr/local/bin/${this.productService.applicationName}`;
|
||||
|
||||
// Ensure source exists
|
||||
@@ -551,7 +551,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
||||
@@ -563,7 +563,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
||||
|
||||
// macOS
|
||||
if (this.environmentMainService.isBuilt) {
|
||||
@@ -42,4 +33,3 @@ index 692db1d..cd173bc 100644
|
||||
}
|
||||
|
||||
return join(this.environmentMainService.appRoot, 'scripts', 'code-cli.sh');
|
||||
|
||||
|
||||
13
patches/cleanup-archive.patch
Normal file
13
patches/cleanup-archive.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js
|
||||
index 1a73ae9..1b87189 100644
|
||||
--- a/build/gulpfile.vscode.win32.js
|
||||
+++ b/build/gulpfile.vscode.win32.js
|
||||
@@ -126,7 +126,7 @@ defineWin32SetupTasks('arm64', 'user');
|
||||
|
||||
function archiveWin32Setup(arch) {
|
||||
return cb => {
|
||||
- const args = ['a', '-tzip', zipPath(arch), '-x!CodeSignSummary*.md', '.', '-r'];
|
||||
+ const args = ['a', '-tzip', zipPath(arch), '-x!CodeSignSummary*.md', '-x!tools', '.', '-r'];
|
||||
|
||||
cp.spawn(_7z, args, { stdio: 'inherit', cwd: buildPath(arch) })
|
||||
.on('error', cb)
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
|
||||
index 657b9c9..9b9b12e 100644
|
||||
index 1edc76f..4c0bf98 100644
|
||||
--- a/src/vs/base/common/product.ts
|
||||
+++ b/src/vs/base/common/product.ts
|
||||
@@ -70,6 +70,7 @@ export interface IProductConfiguration {
|
||||
@@ -69,6 +69,7 @@ export interface IProductConfiguration {
|
||||
|
||||
readonly extensionsGallery?: {
|
||||
readonly serviceUrl: string;
|
||||
@@ -11,7 +11,7 @@ index 657b9c9..9b9b12e 100644
|
||||
readonly resourceUrlTemplate: string;
|
||||
readonly controlUrl: string;
|
||||
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
|
||||
index 5e38d35..12bb161 100644
|
||||
index e22b33e..98cec93 100644
|
||||
--- a/src/vs/platform/product/common/product.ts
|
||||
+++ b/src/vs/platform/product/common/product.ts
|
||||
@@ -4,11 +4,12 @@
|
||||
@@ -30,7 +30,7 @@ index 5e38d35..12bb161 100644
|
||||
* @deprecated You MUST use `IProductService` if possible.
|
||||
@@ -34,6 +35,32 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||
product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
|
||||
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; };
|
||||
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string };
|
||||
|
||||
+ // Merge user-customized product.json
|
||||
+ try {
|
||||
@@ -61,7 +61,7 @@ index 5e38d35..12bb161 100644
|
||||
// Running out of sources
|
||||
if (env['VSCODE_DEV']) {
|
||||
Object.assign(product, {
|
||||
@@ -43,6 +70,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||
@@ -44,6 +71,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts
|
||||
index fe0fbfd..656d8bb 100644
|
||||
index 92313d0..a69da37 100644
|
||||
--- a/extensions/github-authentication/src/githubServer.ts
|
||||
+++ b/extensions/github-authentication/src/githubServer.ts
|
||||
@@ -6,8 +6,6 @@
|
||||
import * as nls from 'vscode-nls';
|
||||
@@ -3,41 +3,13 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
-import * as nls from 'vscode-nls';
|
||||
import * as vscode from 'vscode';
|
||||
import fetch, { Response } from 'node-fetch';
|
||||
-import { v4 as uuid } from 'uuid';
|
||||
@@ -11,19 +14,26 @@ index fe0fbfd..656d8bb 100644
|
||||
import { ExperimentationTelemetry } from './experimentationService';
|
||||
import { AuthProviderType } from './github';
|
||||
import { Log } from './common/logger';
|
||||
@@ -15,8 +13,6 @@ import { Log } from './common/logger';
|
||||
const localize = nls.loadMessageBundle();
|
||||
-import { isSupportedEnvironment } from './common/env';
|
||||
-
|
||||
-const localize = nls.loadMessageBundle();
|
||||
-const CLIENT_ID = '01ab8ac9400c4e429b23';
|
||||
|
||||
const NETWORK_ERROR = 'network error';
|
||||
-const AUTH_RELAY_SERVER = 'vscode-auth.github.com';
|
||||
-// const AUTH_RELAY_STAGING_SERVER = 'client-auth-staging-14a768b.herokuapp.com';
|
||||
|
||||
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
|
||||
constructor(private readonly Logger: Log) {
|
||||
@@ -29,14 +25,6 @@ class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
-class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
|
||||
- constructor(private readonly Logger: Log) {
|
||||
- super();
|
||||
- }
|
||||
-
|
||||
- public handleUri(uri: vscode.Uri) {
|
||||
- this.Logger.trace('Handling Uri...');
|
||||
- this.fire(uri);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-function parseQuery(uri: vscode.Uri) {
|
||||
- return uri.query.split('&').reduce((prev: any, current) => {
|
||||
- const queryString = current.split('=');
|
||||
@@ -31,44 +41,64 @@ index fe0fbfd..656d8bb 100644
|
||||
- return prev;
|
||||
- }, {});
|
||||
-}
|
||||
-
|
||||
|
||||
export interface IGitHubServer extends vscode.Disposable {
|
||||
login(scopes: string): Promise<string>;
|
||||
getUserInfo(token: string): Promise<{ id: string, accountName: string }>;
|
||||
@@ -96,11 +84,7 @@ async function getUserInfo(token: string, serverUri: vscode.Uri, logger: Log): P
|
||||
@@ -47,13 +19,6 @@ export interface IGitHubServer extends vscode.Disposable {
|
||||
type: AuthProviderType;
|
||||
}
|
||||
|
||||
-interface IGitHubDeviceCodeResponse {
|
||||
- device_code: string;
|
||||
- user_code: string;
|
||||
- verification_uri: string;
|
||||
- interval: number;
|
||||
-}
|
||||
-
|
||||
async function getScopes(token: string, serverUri: vscode.Uri, logger: Log): Promise<string[]> {
|
||||
try {
|
||||
logger.info('Getting token scopes...');
|
||||
@@ -115,315 +80,49 @@ async function getUserInfo(token: string, serverUri: vscode.Uri, logger: Log): P
|
||||
export class GitHubServer implements IGitHubServer {
|
||||
friendlyName = 'GitHub';
|
||||
type = AuthProviderType.github;
|
||||
- private _statusBarItem: vscode.StatusBarItem | undefined;
|
||||
- private _onDidManuallyProvideToken = new vscode.EventEmitter<string | undefined>();
|
||||
|
||||
-
|
||||
- private _pendingStates = new Map<string, string[]>();
|
||||
- private _codeExchangePromises = new Map<string, { promise: Promise<string>, cancel: vscode.EventEmitter<void> }>();
|
||||
private _statusBarCommandId = `${this.type}.provide-manually`;
|
||||
private _disposable: vscode.Disposable;
|
||||
private _uriHandler = new UriEventHandler(this._logger);
|
||||
@@ -115,137 +99,35 @@ export class GitHubServer implements IGitHubServer {
|
||||
this._disposable.dispose();
|
||||
- private _codeExchangePromises = new Map<string, { promise: Promise<string>; cancel: vscode.EventEmitter<void> }>();
|
||||
- private _statusBarCommandId = `${this.type}.provide-manually`;
|
||||
- private _disposable: vscode.Disposable;
|
||||
- private _uriHandler = new UriEventHandler(this._logger);
|
||||
|
||||
constructor(private readonly _supportDeviceCodeFlow: boolean, private readonly _logger: Log, private readonly _telemetryReporter: ExperimentationTelemetry) {
|
||||
- this._disposable = vscode.Disposable.from(
|
||||
- vscode.commands.registerCommand(this._statusBarCommandId, () => this.manuallyProvideUri()),
|
||||
- vscode.window.registerUriHandler(this._uriHandler));
|
||||
+ this._supportDeviceCodeFlow;
|
||||
}
|
||||
|
||||
- private isTestEnvironment(url: vscode.Uri): boolean {
|
||||
- return /\.azurewebsites\.net$/.test(url.authority) || url.authority.startsWith('localhost:');
|
||||
dispose() {
|
||||
- this._disposable.dispose();
|
||||
- }
|
||||
-
|
||||
- // TODO@joaomoreno TODO@TylerLeonhardt
|
||||
- private async isNoCorsEnvironment(): Promise<boolean> {
|
||||
- const uri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/dummy`));
|
||||
- return (uri.scheme === 'https' && /^((insiders\.)?vscode|github)\./.test(uri.authority)) || (uri.scheme === 'http' && /^localhost/.test(uri.authority));
|
||||
- }
|
||||
-
|
||||
}
|
||||
|
||||
public async login(scopes: string): Promise<string> {
|
||||
this._logger.info(`Logging in for the following scopes: ${scopes}`);
|
||||
|
||||
- const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate`));
|
||||
-
|
||||
- if (this.isTestEnvironment(callbackUri)) {
|
||||
- const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
|
||||
- if (!token) { throw new Error('Sign in failed: No token provided'); }
|
||||
- if (!isSupportedEnvironment(callbackUri)) {
|
||||
- const token = this._supportDeviceCodeFlow
|
||||
- ? await this.doDeviceCodeFlow(scopes)
|
||||
- : await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
|
||||
-
|
||||
- if (!token) { throw new Error('No token provided'); }
|
||||
-
|
||||
- const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
|
||||
- const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
||||
@@ -77,22 +107,14 @@ index fe0fbfd..656d8bb 100644
|
||||
- if (included || !scope.includes(':')) {
|
||||
- return included;
|
||||
- }
|
||||
+ const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
|
||||
+ if (!token) { throw new Error('Sign in failed: No token provided'); }
|
||||
|
||||
-
|
||||
- return scope.split(':').some(splitScopes => {
|
||||
- return tokenScopes.includes(splitScopes);
|
||||
- });
|
||||
- })) {
|
||||
- throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||
+ const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
|
||||
+ const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
||||
+ if (!scopesList.every(scope => {
|
||||
+ const included = tokenScopes.includes(scope);
|
||||
+ if (included || !scope.includes(':')) {
|
||||
+ return included;
|
||||
}
|
||||
|
||||
- }
|
||||
-
|
||||
- return token;
|
||||
- }
|
||||
-
|
||||
@@ -111,13 +133,8 @@ index fe0fbfd..656d8bb 100644
|
||||
- if (!codeExchangePromise) {
|
||||
- codeExchangePromise = promiseFromEvent(this._uriHandler.event, this.exchangeCodeForToken(scopes));
|
||||
- this._codeExchangePromises.set(scopes, codeExchangePromise);
|
||||
+ return scope.split(':').some(splitScopes => {
|
||||
+ return tokenScopes.includes(splitScopes);
|
||||
+ });
|
||||
+ })) {
|
||||
+ throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||
}
|
||||
|
||||
- }
|
||||
-
|
||||
- return Promise.race([
|
||||
- codeExchangePromise.promise,
|
||||
- promiseFromEvent<string | undefined, string>(this._onDidManuallyProvideToken.event, (token: string | undefined, resolve, reject): void => {
|
||||
@@ -134,6 +151,110 @@ index fe0fbfd..656d8bb 100644
|
||||
- this._codeExchangePromises.delete(scopes);
|
||||
- this.updateStatusBarItem(false);
|
||||
- });
|
||||
- }
|
||||
-
|
||||
- private async doDeviceCodeFlow(scopes: string): Promise<string> {
|
||||
- // Get initial device code
|
||||
- const uri = `https://github.com/login/device/code?client_id=${CLIENT_ID}&scope=${scopes}`;
|
||||
- const result = await fetch(uri, {
|
||||
- method: 'POST',
|
||||
- headers: {
|
||||
- Accept: 'application/json'
|
||||
- }
|
||||
- });
|
||||
- if (!result.ok) {
|
||||
- throw new Error(`Failed to get one-time code: ${await result.text()}`);
|
||||
- }
|
||||
-
|
||||
- const json = await result.json() as IGitHubDeviceCodeResponse;
|
||||
-
|
||||
-
|
||||
- const modalResult = await vscode.window.showInformationMessage(
|
||||
- localize('code.title', "Your Code: {0}", json.user_code),
|
||||
- {
|
||||
- modal: true,
|
||||
- detail: localize('code.detail', "To finish authenticating, navigate to GitHub and paste in the above one-time code.")
|
||||
- }, 'Copy & Continue to GitHub');
|
||||
-
|
||||
- if (modalResult !== 'Copy & Continue to GitHub') {
|
||||
- throw new Error('Cancelled');
|
||||
- }
|
||||
-
|
||||
- await vscode.env.clipboard.writeText(json.user_code);
|
||||
-
|
||||
- const uriToOpen = await vscode.env.asExternalUri(vscode.Uri.parse(json.verification_uri));
|
||||
- await vscode.env.openExternal(uriToOpen);
|
||||
-
|
||||
- return await vscode.window.withProgress<string>({
|
||||
- location: vscode.ProgressLocation.Notification,
|
||||
- cancellable: true,
|
||||
- title: localize(
|
||||
- 'progress',
|
||||
- "Open [{0}]({0}) in a new tab and paste your one-time code: {1}",
|
||||
- json.verification_uri,
|
||||
- json.user_code)
|
||||
- }, async (_, token) => {
|
||||
- return await this.waitForDeviceCodeAccessToken(json, token);
|
||||
- });
|
||||
- }
|
||||
-
|
||||
- private async waitForDeviceCodeAccessToken(
|
||||
- json: IGitHubDeviceCodeResponse,
|
||||
- token: vscode.CancellationToken
|
||||
- ): Promise<string> {
|
||||
-
|
||||
- const refreshTokenUri = `https://github.com/login/oauth/access_token?client_id=${CLIENT_ID}&device_code=${json.device_code}&grant_type=urn:ietf:params:oauth:grant-type:device_code`;
|
||||
-
|
||||
- // Try for 2 minutes
|
||||
- const attempts = 120 / json.interval;
|
||||
- for (let i = 0; i < attempts; i++) {
|
||||
- await new Promise(resolve => setTimeout(resolve, json.interval * 1000));
|
||||
- if (token.isCancellationRequested) {
|
||||
- throw new Error('Cancelled');
|
||||
- }
|
||||
- let accessTokenResult;
|
||||
- try {
|
||||
- accessTokenResult = await fetch(refreshTokenUri, {
|
||||
- method: 'POST',
|
||||
- headers: {
|
||||
- Accept: 'application/json'
|
||||
- }
|
||||
- });
|
||||
- } catch {
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- if (!accessTokenResult.ok) {
|
||||
- continue;
|
||||
- }
|
||||
+ const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
|
||||
|
||||
- const accessTokenJson = await accessTokenResult.json();
|
||||
+ if (!token) { throw new Error('No token provided'); }
|
||||
|
||||
- if (accessTokenJson.error === 'authorization_pending') {
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- if (accessTokenJson.error) {
|
||||
- throw new Error(accessTokenJson.error_description);
|
||||
+ const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
|
||||
+ const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
|
||||
+ if (!scopesList.every(scope => {
|
||||
+ const included = tokenScopes.includes(scope);
|
||||
+ if (included || !scope.includes(':')) {
|
||||
+ return included;
|
||||
}
|
||||
|
||||
- return accessTokenJson.access_token;
|
||||
+ return scope.split(':').some(splitScopes => {
|
||||
+ return tokenScopes.includes(splitScopes);
|
||||
+ });
|
||||
+ })) {
|
||||
+ throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
|
||||
}
|
||||
|
||||
- throw new Error('Cancelled');
|
||||
+ return token;
|
||||
}
|
||||
|
||||
@@ -196,10 +317,34 @@ index fe0fbfd..656d8bb 100644
|
||||
- }
|
||||
- }
|
||||
-
|
||||
private async manuallyProvideUri() {
|
||||
const uri = await vscode.window.showInputBox({
|
||||
prompt: 'Uri',
|
||||
@@ -277,44 +159,7 @@ export class GitHubServer implements IGitHubServer {
|
||||
- private async manuallyProvideUri() {
|
||||
- const uri = await vscode.window.showInputBox({
|
||||
- prompt: 'Uri',
|
||||
- ignoreFocusOut: true,
|
||||
- validateInput(value) {
|
||||
- if (!value) {
|
||||
- return undefined;
|
||||
- }
|
||||
- const error = localize('validUri', "Please enter a valid Uri from the GitHub login page.");
|
||||
- try {
|
||||
- const uri = vscode.Uri.parse(value.trim());
|
||||
- if (!uri.scheme || uri.scheme === 'file') {
|
||||
- return error;
|
||||
- }
|
||||
- } catch (e) {
|
||||
- return error;
|
||||
- }
|
||||
- return undefined;
|
||||
- }
|
||||
- });
|
||||
- if (!uri) {
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- this._uriHandler.handleUri(vscode.Uri.parse(uri.trim()));
|
||||
- }
|
||||
-
|
||||
public getUserInfo(token: string): Promise<{ id: string; accountName: string }> {
|
||||
return getUserInfo(token, this.getServerUri('/user'), this._logger);
|
||||
}
|
||||
|
||||
@@ -223,7 +368,7 @@ index fe0fbfd..656d8bb 100644
|
||||
- });
|
||||
-
|
||||
- if (result.ok) {
|
||||
- const json: { student: boolean, faculty: boolean } = await result.json();
|
||||
- const json: { student: boolean; faculty: boolean } = await result.json();
|
||||
-
|
||||
- /* __GDPR__
|
||||
- "session" : {
|
||||
@@ -241,7 +386,7 @@ index fe0fbfd..656d8bb 100644
|
||||
- } catch (e) {
|
||||
- // No-op
|
||||
- }
|
||||
+ public async sendAdditionalTelemetryInfo(_token: string): Promise<void> {
|
||||
+ public async sendAdditionalTelemetryInfo(_: string): Promise<void> {
|
||||
}
|
||||
|
||||
public async checkEnterpriseVersion(token: string): Promise<void> {
|
||||
|
||||
36
release.sh
36
release.sh
@@ -2,12 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "${GH_CLI_TOKEN}" ]]; then
|
||||
echo "Will not release because no GH_CLI_TOKEN defined"
|
||||
if [[ -z "${GITHUB_TOKEN}" ]]; then
|
||||
echo "Will not release because no GITHUB_TOKEN defined"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "${GH_CLI_TOKEN}" | gh auth login --with-token
|
||||
npm install -g github-release-cli
|
||||
|
||||
if [[ $( gh release view "${MS_TAG}" 2>&1 ) =~ "release not found" ]]; then
|
||||
echo "Creating release '${MS_TAG}'"
|
||||
@@ -18,30 +18,48 @@ cd artifacts
|
||||
|
||||
set +e
|
||||
|
||||
OWNER="${GITHUB_REPOSITORY_OWNER:-"VSCodium"}"
|
||||
REPO_NAME="${GITHUB_REPOSITORY:(${#OWNER}+1)}"
|
||||
REPOSITORY="${REPO_NAME:-"vscodium"}"
|
||||
|
||||
for FILE in *
|
||||
do
|
||||
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
|
||||
echo "Uploading '${FILE}'"
|
||||
echo "::group::Uploading '${FILE}' at $( date "+%T" )"
|
||||
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
EXIT_STATUS=$?
|
||||
echo "exit: $EXIT_STATUS"
|
||||
|
||||
if (( $EXIT_STATUS )); then
|
||||
for (( i=0; i<10; i++ ))
|
||||
do
|
||||
github-release delete --owner "${OWNER}" --repo "${REPOSITORY}" --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
|
||||
sleep $(( 15 * (i + 1)))
|
||||
|
||||
echo "RE-Uploading '${FILE}'"
|
||||
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256" --clobber
|
||||
echo "RE-Uploading '${FILE}' at $( date "+%T" )"
|
||||
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
EXIT_STATUS=$?
|
||||
echo "exit: $EXIT_STATUS"
|
||||
|
||||
if ! (( $EXIT_STATUS )); then
|
||||
break
|
||||
fi
|
||||
done
|
||||
echo "exit: $EXIT_STATUS"
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
if (( $EXIT_STATUS )); then
|
||||
echo "'${FILE}' hasn't been uploaded!"
|
||||
|
||||
github-release delete --owner "${OWNER}" --repo "${REPOSITORY}" --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "::endgroup::"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="1024px" height="1024px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="40" height="40" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 55 (78076) - https://sketchapp.com -->
|
||||
<title>codium_grey_dark_letterpress</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="1024px" height="1024px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="40" height="40" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 55 (78076) - https://sketchapp.com -->
|
||||
<title>codium_grey_hc_letterpress</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="1024px" height="1024px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="40" height="40" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 55 (78076) - https://sketchapp.com -->
|
||||
<title>codium_grey_letterpress</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
43
stores/snapcraft/check_version.sh
Executable file
43
stores/snapcraft/check_version.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
|
||||
echo "It's a PR"
|
||||
|
||||
export SHOULD_DEPLOY="no"
|
||||
elif [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
|
||||
echo "It's a Push"
|
||||
|
||||
export SHOULD_DEPLOY="no"
|
||||
else
|
||||
echo "It's a cron"
|
||||
|
||||
sudo snap install --channel stable --classic snapcraft
|
||||
|
||||
echo "$SNAP_STORE_LOGIN" | snapcraft login --with -
|
||||
|
||||
echo "Architecture: ${ARCHITECTURE}"
|
||||
|
||||
SNAP_VERSION=$(snapcraft list-revisions codium | grep -F stable* | grep ${ARCHITECTURE} | tr -s ' ' | cut -d ' ' -f 4)
|
||||
echo "Snap version: ${SNAP_VERSION}"
|
||||
|
||||
wget --quiet https://api.github.com/repos/VSCodium/vscodium/releases -O gh_latest.json
|
||||
GH_VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' gh_latest.json)
|
||||
echo "GH version: ${GH_VERSION}"
|
||||
|
||||
rm -f gh_latest.json
|
||||
|
||||
if [[ "${SNAP_VERSION}" == "${GH_VERSION}" ]]; then
|
||||
export SHOULD_DEPLOY="no"
|
||||
else
|
||||
export SHOULD_DEPLOY="yes"
|
||||
|
||||
snap version
|
||||
snap info codium
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $GITHUB_ENV ]]; then
|
||||
echo "SHOULD_DEPLOY=$SHOULD_DEPLOY" >> $GITHUB_ENV
|
||||
fi
|
||||
34
stores/snapcraft/snap/local/bin/electron-launch
Executable file
34
stores/snapcraft/snap/local/bin/electron-launch
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# On Fedora $SNAP is under /var and there is some magic to map it to /snap.
|
||||
# We need to handle that case and reset $SNAP
|
||||
SNAP=$(echo "$SNAP" | sed -e "s|/var/lib/snapd||g")
|
||||
|
||||
if [ "$SNAP_ARCH" == "amd64" ]; then
|
||||
ARCH="x86_64-linux-gnu"
|
||||
elif [ "$SNAP_ARCH" == "armhf" ]; then
|
||||
ARCH="arm-linux-gnueabihf"
|
||||
elif [ "$SNAP_ARCH" == "arm64" ]; then
|
||||
ARCH="aarch64-linux-gnu"
|
||||
else
|
||||
ARCH="$SNAP_ARCH-linux-gnu"
|
||||
fi
|
||||
|
||||
GDK_CACHE_DIR="$SNAP_USER_COMMON/.cache"
|
||||
if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$GDK_CACHE_DIR" ]]; then
|
||||
# the .cache directory used to be stored under $SNAP_USER_DATA, migrate it
|
||||
mv "$SNAP_USER_DATA/.cache" "$SNAP_USER_COMMON/"
|
||||
fi
|
||||
[ ! -d "$GDK_CACHE_DIR" ] && mkdir -p "$GDK_CACHE_DIR"
|
||||
|
||||
# Gdk-pixbuf loaders
|
||||
export GDK_PIXBUF_MODULE_FILE="$GDK_CACHE_DIR/gdk-pixbuf-loaders.cache"
|
||||
export GDK_PIXBUF_MODULEDIR="$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders"
|
||||
if [ -f "$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then
|
||||
"$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" > "$GDK_PIXBUF_MODULE_FILE"
|
||||
fi
|
||||
|
||||
# Create $XDG_RUNTIME_DIR if not exists (to be removed when https://pad.lv/1656340 is fixed)
|
||||
[ -n "$XDG_RUNTIME_DIR" ] && mkdir -p "$XDG_RUNTIME_DIR" -m 700
|
||||
|
||||
exec "$@"
|
||||
91
stores/snapcraft/snap/snapcraft.yaml
Normal file
91
stores/snapcraft/snap/snapcraft.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
name: codium
|
||||
adopt-info: codium
|
||||
summary: Code editing. Redefined.
|
||||
description: |
|
||||
Binary releases of Code without branding/telemetry/licensing
|
||||
|
||||
base: core18
|
||||
grade: stable
|
||||
confinement: classic
|
||||
compression: lzo
|
||||
architectures:
|
||||
- build-on: amd64
|
||||
- build-on: arm64
|
||||
|
||||
parts:
|
||||
codium:
|
||||
plugin: nil
|
||||
override-build: |
|
||||
set -eu
|
||||
ARCHITECTURE=$(dpkg --print-architecture)
|
||||
# Get GitHub releases
|
||||
wget --quiet https://api.github.com/repos/VSCodium/vscodium/releases -O latest.json
|
||||
VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' latest.json)
|
||||
DEB_URL=$(jq -r 'map(select(.tag_name == "'"$VERSION"'"))|first.assets[].browser_download_url|select(endswith("'"_$ARCHITECTURE.deb"'"))' latest.json)
|
||||
DEB=$(basename "${DEB_URL}")
|
||||
# Downloading .deb"
|
||||
wget "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}"
|
||||
# Unpacking .deb"
|
||||
dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL}
|
||||
rm -f latest.json
|
||||
rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}"
|
||||
# Set version
|
||||
snapcraftctl set-version "$VERSION"
|
||||
# Correct path to icon.
|
||||
sed -i 's|Icon=vscodium|Icon=${SNAP}/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop
|
||||
sed -i 's|Exec=/usr/share/codium/codium|Exec=codium|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop
|
||||
sed -i 's|Icon=vscodium|Icon=/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium-url-handler.desktop
|
||||
build-packages:
|
||||
- wget
|
||||
- jq
|
||||
stage-packages:
|
||||
- fcitx-frontend-gtk3
|
||||
- gvfs-libs
|
||||
- libasound2
|
||||
- libgconf-2-4
|
||||
- libglib2.0-bin
|
||||
- libgnome-keyring0
|
||||
- libgtk-3-0
|
||||
- libnotify4
|
||||
- libnspr4
|
||||
- libnss3
|
||||
- libpcre3
|
||||
- libpulse0
|
||||
- libsecret-1-0
|
||||
- libxshmfence1
|
||||
- libxss1
|
||||
- libxtst6
|
||||
- zlib1g
|
||||
- libx11-xcb1
|
||||
- libxkbfile1
|
||||
- libdrm2
|
||||
- libgbm1
|
||||
- libxcb-dri3-0
|
||||
prime:
|
||||
- -usr/share/doc
|
||||
- -usr/share/fonts
|
||||
- -usr/share/icons
|
||||
- -usr/share/lintian
|
||||
- -usr/share/man
|
||||
- -usr/share/codium/chrome-sandbox
|
||||
|
||||
electron-launch:
|
||||
after:
|
||||
- codium
|
||||
plugin: dump
|
||||
source: snap/local
|
||||
|
||||
apps:
|
||||
codium:
|
||||
command: electron-launch $SNAP/usr/share/codium/bin/codium --no-sandbox
|
||||
desktop: usr/share/applications/codium.desktop
|
||||
environment:
|
||||
DISABLE_WAYLAND: 1
|
||||
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
|
||||
|
||||
url-handler:
|
||||
command: electron-launch $SNAP/usr/share/codium/bin/codium --open-url --no-sandbox
|
||||
desktop: usr/share/applications/codium-url-handler.desktop
|
||||
environment:
|
||||
DISABLE_WAYLAND: 1
|
||||
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
|
||||
Reference in New Issue
Block a user