Skip to content

Commit c813ab5

Browse files
authored
Bootstrap yarn to fix/enable CFSClean3. (#14284)
1 parent 20cfc2b commit c813ab5

File tree

7 files changed

+58
-13
lines changed

7 files changed

+58
-13
lines changed

Build/cg/cg.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extends:
6161
featureFlags:
6262
autoBaseline: false
6363
settings:
64-
networkIsolationPolicy: Permissive,CFSClean,CFSClean2
64+
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
6565

6666
stages:
6767
- stage: build
@@ -81,9 +81,6 @@ extends:
8181
steps:
8282
- checkout: self
8383

84-
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3
85-
displayName: Use Yarn 1.x
86-
8784
- task: UseNode@1
8885
displayName: Use Node 22.x
8986
inputs:
@@ -102,9 +99,9 @@ extends:
10299
script: |
103100
export SRC_DIR=$(echo $BUILD_SOURCESDIRECTORY | sed 's|\\|/|g')
104101
cd "$SRC_DIR/Extension"
105-
yarn run vsix-prepublish
102+
npm run vsix-prepublish
106103
if [ $? -ne 0 ]; then
107-
echo "yarn run vsix-prepublish failed, sleeping for 30s before retrying..."
104+
echo "npm run vsix-prepublish failed, sleeping for 30s before retrying..."
108105
sleep 30
109106
exit 1
110107
fi

Build/package/cpptools_extension_pack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extends:
3232
image: 1ESPT-Windows2022
3333
os: windows
3434
settings:
35-
networkIsolationPolicy: Permissive,CFSClean,CFSClean2
35+
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
3636

3737
stages:
3838
- stage: package

Build/package/cpptools_themes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extends:
3232
image: 1ESPT-Windows2022
3333
os: windows
3434
settings:
35-
networkIsolationPolicy: Permissive,CFSClean,CFSClean2
35+
networkIsolationPolicy: Permissive,CFSClean,CFSClean2,CFSClean3
3636

3737
stages:
3838
- stage: package

Extension/.yarn-bootstrap/package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "cpptools-yarn-bootstrap",
3+
"private": true,
4+
"version": "1.0.0",
5+
"description": "Install Yarn from internal npm feed for repository bootstrap.",
6+
"license": "SEE LICENSE IN LICENSE.txt",
7+
"devDependencies": {
8+
"yarn": "1.22.22"
9+
}
10+
}

Extension/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6781,6 +6781,8 @@
67816781
]
67826782
},
67836783
"scripts": {
6784+
"bootstrap": "npm run bootstrap:yarn && yarn install --frozen-lockfile",
6785+
"bootstrap:yarn": "npm install -g yarn@1.22.22 --registry=https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/",
67846786
"scripts": "ts-node -T .scripts/scripts.ts",
67856787
"show": "ts-node -T .scripts/clean.ts show",
67866788
"clean": "ts-node -T .scripts/clean.ts",
@@ -6792,7 +6794,7 @@
67926794
"compile": "yarn install && (yarn verify prep --quiet || yarn prep) && yarn build",
67936795
"watch": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build tsconfig.json --watch",
67946796
"rebuild": "yarn install && yarn clean && yarn prep && yarn build",
6795-
"vsix-prepublish": "yarn install && yarn clean && yarn webpack",
6797+
"vsix-prepublish": "npm run bootstrap && yarn clean && yarn webpack",
67966798
"webpack": "yarn install && (yarn verify prep --quiet || yarn prep) && tsc --build ui.tsconfig.json && webpack --mode production --env vscode_nls",
67976799
"generate-native-strings": "ts-node -T ./.scripts/generateNativeStrings.ts",
67986800
"generate-options-schema": "ts-node -T ./.scripts/generateOptionsSchema.ts",

Extension/readme.developer.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@
3535
### Required Tools
3636

3737
* [Node.js](https://nodejs.org/en/download/) v16.*
38-
* Yarn - use `npm install -g yarn` to install
38+
* npm (comes with Node.js)
3939

4040
### Setting up the repository
4141

4242
`git clone https://github.com/microsoft/vscode-cpptools.git`
4343

44-
`yarn install`
44+
`cd vscode-cpptools/Extension`
4545

46-
It's also good practice to run `yarn install` after merging from upstream or switching branches.
46+
`npm run bootstrap`
47+
48+
`npm run bootstrap` installs Yarn `1.22.22` globally from the internal npm feed and then runs `yarn install --frozen-lockfile`.
49+
On some systems, global npm install may require elevated permissions.
50+
51+
It's also good practice to run `npm run bootstrap` after merging from upstream or switching branches.
4752

4853
## Building the Extension
4954

@@ -336,4 +341,4 @@ This will use webpack to build the extension. This is only necessary when packag
336341
337342
Installs the VS Code `*.d.ts` files and then runs `yarn prep`
338343

339-
You should run `yarn install` after merging from upstream or switching branches.
344+
You should run `npm run bootstrap` after merging from upstream or switching branches.

0 commit comments

Comments
 (0)