mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-20 10:44:31 +10:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85cbd0b0f2 | ||
|
|
b748657b09 | ||
|
|
db02ad1133 | ||
|
|
573c0230c5 | ||
|
|
bb483f44e2 |
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@@ -20,7 +20,6 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
vscode_arch: [x64, arm64, armhf]
|
|
||||||
include:
|
include:
|
||||||
- vscode_arch: x64
|
- vscode_arch: x64
|
||||||
npm_arch: x64
|
npm_arch: x64
|
||||||
@@ -87,6 +86,7 @@ jobs:
|
|||||||
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
|
||||||
|
|
||||||
- name: Move/rename build artifacts
|
- name: Move/rename build artifacts
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cp vscode/.build/linux/deb/*/deb/*.deb .
|
cp vscode/.build/linux/deb/*/deb/*.deb .
|
||||||
cp vscode/.build/linux/rpm/*/*.rpm .
|
cp vscode/.build/linux/rpm/*/*.rpm .
|
||||||
|
|||||||
15
.github/workflows/macos.yml
vendored
15
.github/workflows/macos.yml
vendored
@@ -10,10 +10,21 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: macOS-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- vscode_arch: x64
|
||||||
|
os: macOS-10.15
|
||||||
|
# - vscode_arch: arm64
|
||||||
|
# os: macOS-11
|
||||||
|
|
||||||
env:
|
env:
|
||||||
OS_NAME: "osx"
|
OS_NAME: "osx"
|
||||||
VSCODE_ARCH: "x64"
|
VSCODE_ARCH: ${{ matrix.vscode_arch }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,10 @@ if [ "$GITHUB_TOKEN" != "" ]; then
|
|||||||
echo "Building on Linux x64 because we have no TAR"
|
echo "Building on Linux x64 because we have no TAR"
|
||||||
export SHOULD_BUILD="yes"
|
export SHOULD_BUILD="yes"
|
||||||
fi
|
fi
|
||||||
|
if [[ -z $( contains "x86_64.AppImage" ) ]]; then
|
||||||
|
echo "Building on Linux x64 because we have no AppImage"
|
||||||
|
export SHOULD_BUILD="yes"
|
||||||
|
fi
|
||||||
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
if [[ "$SHOULD_BUILD" != "yes" ]]; then
|
||||||
echo "Already have all the Linux x64 builds"
|
echo "Already have all the Linux x64 builds"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,144 +0,0 @@
|
|||||||
diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js
|
|
||||||
index 0cc92ec..8ba8fb0 100644
|
|
||||||
--- a/src/bootstrap-window.js
|
|
||||||
+++ b/src/bootstrap-window.js
|
|
||||||
@@ -24,6 +24,7 @@
|
|
||||||
const bootstrapLib = bootstrap();
|
|
||||||
const preloadGlobals = sandboxGlobals();
|
|
||||||
const safeProcess = preloadGlobals.process;
|
|
||||||
+ const useCustomProtocol = safeProcess.sandboxed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {import('./vs/base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration} ISandboxConfiguration
|
|
||||||
@@ -107,9 +108,9 @@
|
|
||||||
window['MonacoEnvironment'] = {};
|
|
||||||
|
|
||||||
const loaderConfig = {
|
|
||||||
- baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
|
|
||||||
+ baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32' })}/out`,
|
|
||||||
'vs/nls': nlsConfig,
|
|
||||||
- preferScriptTags: true
|
|
||||||
+ preferScriptTags: useCustomProtocol
|
|
||||||
};
|
|
||||||
|
|
||||||
// use a trusted types policy when loading via script tags
|
|
||||||
@@ -143,6 +144,14 @@
|
|
||||||
loaderConfig.amdModulesPattern = /^vs\//;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Cached data config (node.js loading only)
|
|
||||||
+ if (!useCustomProtocol && configuration.codeCachePath) {
|
|
||||||
+ loaderConfig.nodeCachedData = {
|
|
||||||
+ path: configuration.codeCachePath,
|
|
||||||
+ seed: modulePaths.join('')
|
|
||||||
+ };
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
// Signal before require.config()
|
|
||||||
if (typeof options?.beforeLoaderConfig === 'function') {
|
|
||||||
options.beforeLoaderConfig(loaderConfig);
|
|
||||||
diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts
|
|
||||||
index 41a3fe9..bbb06e3 100644
|
|
||||||
--- a/src/vs/base/common/network.ts
|
|
||||||
+++ b/src/vs/base/common/network.ts
|
|
||||||
@@ -166,16 +166,7 @@ class FileAccessImpl {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert to `vscode-file` resource..
|
|
||||||
- if (
|
|
||||||
- // ...only ever for `file` resources
|
|
||||||
- uri.scheme === Schemas.file &&
|
|
||||||
- (
|
|
||||||
- // ...and we run in native environments
|
|
||||||
- platform.isNative ||
|
|
||||||
- // ...or web worker extensions on desktop
|
|
||||||
- (typeof platform.globals.importScripts === 'function' && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)
|
|
||||||
- )
|
|
||||||
- ) {
|
|
||||||
+ if (uri.scheme === Schemas.file && typeof platform.globals.importScripts === 'function' && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`) {
|
|
||||||
return uri.with({
|
|
||||||
scheme: Schemas.vscodeFileResource,
|
|
||||||
// We need to provide an authority here so that it can serve
|
|
||||||
diff --git a/src/vs/platform/protocol/electron-main/protocolMainService.ts b/src/vs/platform/protocol/electron-main/protocolMainService.ts
|
|
||||||
index bde08d8..3f09ad1 100644
|
|
||||||
--- a/src/vs/platform/protocol/electron-main/protocolMainService.ts
|
|
||||||
+++ b/src/vs/platform/protocol/electron-main/protocolMainService.ts
|
|
||||||
@@ -72,9 +72,24 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ
|
|
||||||
//#region file://
|
|
||||||
|
|
||||||
private handleFileRequest(request: Electron.ProtocolRequest, callback: ProtocolCallback) {
|
|
||||||
- const uri = URI.parse(request.url);
|
|
||||||
+ const fileUri = URI.parse(request.url);
|
|
||||||
+
|
|
||||||
+ // first check by validRoots
|
|
||||||
+ if (this.validRoots.findSubstr(fileUri)) {
|
|
||||||
+ return callback({
|
|
||||||
+ path: fileUri.fsPath
|
|
||||||
+ });
|
|
||||||
+ }
|
|
||||||
|
|
||||||
- this.logService.error(`Refused to load resource ${uri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`);
|
|
||||||
+ // then check by validExtensions
|
|
||||||
+ if (this.validExtensions.has(extname(fileUri))) {
|
|
||||||
+ return callback({
|
|
||||||
+ path: fileUri.fsPath
|
|
||||||
+ });
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // finally block to load the resource
|
|
||||||
+ this.logService.error(`${Schemas.file}: Refused to load resource ${fileUri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`);
|
|
||||||
|
|
||||||
return callback({ error: -3 /* ABORTED */ });
|
|
||||||
}
|
|
||||||
diff --git a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
|
|
||||||
index 7cae207..1c54ac9 100644
|
|
||||||
--- a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
|
|
||||||
+++ b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
|
|
||||||
@@ -19,7 +19,7 @@ import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
|
|
||||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
|
||||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
|
||||||
import { IProductService } from 'vs/platform/product/common/productService';
|
|
||||||
-import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
|
||||||
+import { IStorageService } from 'vs/platform/storage/common/storage';
|
|
||||||
|
|
||||||
export class TimerService extends AbstractTimerService {
|
|
||||||
|
|
||||||
@@ -91,24 +91,23 @@ registerSingleton(ITimerService, TimerService);
|
|
||||||
|
|
||||||
//#region cached data logic
|
|
||||||
|
|
||||||
-const lastRunningCommitStorageKey = 'perf/lastRunningCommit';
|
|
||||||
-let _didUseCachedData: boolean | undefined = undefined;
|
|
||||||
-
|
|
||||||
export function didUseCachedData(productService: IProductService, storageService: IStorageService, environmentService: INativeWorkbenchEnvironmentService): boolean {
|
|
||||||
- // browser code loading: only a guess based on
|
|
||||||
- // this being the first start with the commit
|
|
||||||
- // or subsequent
|
|
||||||
- if (typeof _didUseCachedData !== 'boolean') {
|
|
||||||
- if (!environmentService.configuration.codeCachePath || !productService.commit) {
|
|
||||||
- _didUseCachedData = false; // we only produce cached data whith commit and code cache path
|
|
||||||
- } else if (storageService.get(lastRunningCommitStorageKey, StorageScope.GLOBAL) === productService.commit) {
|
|
||||||
- _didUseCachedData = true; // subsequent start on same commit, assume cached data is there
|
|
||||||
- } else {
|
|
||||||
- storageService.store(lastRunningCommitStorageKey, productService.commit, StorageScope.GLOBAL, StorageTarget.MACHINE);
|
|
||||||
- _didUseCachedData = false; // first time start on commit, assume cached data is not yet there
|
|
||||||
+ if (!Boolean((<any>window).require.getConfig().nodeCachedData)) {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ // There are loader events that signal if cached data was missing, rejected,
|
|
||||||
+ // or used. The former two mean no cached data.
|
|
||||||
+ let cachedDataFound = 0;
|
|
||||||
+ for (const event of require.getStats()) {
|
|
||||||
+ switch (event.type) {
|
|
||||||
+ case LoaderEventType.CachedDataRejected:
|
|
||||||
+ return false;
|
|
||||||
+ case LoaderEventType.CachedDataFound:
|
|
||||||
+ cachedDataFound += 1;
|
|
||||||
+ break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- return _didUseCachedData;
|
|
||||||
+ return cachedDataFound > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//#endregion
|
|
||||||
Reference in New Issue
Block a user