Skip to content

Commit 2fe49ea

Browse files
authored
Ensure native locator is included in the VSIX when built (#23476)
This ensures that if we run cargo build to build the native code it gets included in the VSIX. For now this is only for the builds for VSIX generated on github, for testing. As this is not ready for published pre-releases.
1 parent 891c7a4 commit 2fe49ea

File tree

3 files changed

+49
-6
lines changed

3 files changed

+49
-6
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
run:
2929
shell: python
3030
outputs:
31+
vsix_basename: ${{ steps.vsix_names.outputs.vsix_basename }}
3132
vsix_name: ${{ steps.vsix_names.outputs.vsix_name }}
3233
vsix_artifact_name: ${{ steps.vsix_names.outputs.vsix_artifact_name }}
3334
steps:
@@ -40,23 +41,57 @@ jobs:
4041
else:
4142
vsix_type = "release"
4243
print(f"::set-output name=vsix_name::ms-python-{vsix_type}.vsix")
44+
print(f"::set-output name=vsix_basename::ms-python-{vsix_type}")
4345
print(f"::set-output name=vsix_artifact_name::ms-python-{vsix_type}-vsix")
4446
4547
build-vsix:
4648
name: Create VSIX
4749
if: github.repository == 'microsoft/vscode-python'
4850
needs: setup
49-
runs-on: ubuntu-latest
51+
runs-on: ${{ matrix.os }}
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
include:
56+
- os: windows-latest
57+
target: x86_64-pc-windows-msvc
58+
vsix-target: win32-x64
59+
- os: windows-latest
60+
target: aarch64-pc-windows-msvc
61+
vsix-target: win32-arm64
62+
- os: ubuntu-latest
63+
target: x86_64-unknown-linux-musl
64+
vsix-target: linux-x64
65+
# - os: ubuntu-latest
66+
# target: aarch64-unknown-linux-gnu
67+
# vsix-target: linux-arm64
68+
# - os: ubuntu-latest
69+
# target: arm-unknown-linux-gnueabihf
70+
# vsix-target: linux-armhf
71+
- os: macos-latest
72+
target: x86_64-apple-darwin
73+
vsix-target: darwin-x64
74+
- os: macos-14
75+
target: aarch64-apple-darwin
76+
vsix-target: darwin-arm64
77+
- os: ubuntu-latest
78+
target: x86_64-unknown-linux-musl
79+
vsix-target: alpine-x64
80+
# - os: ubuntu-latest
81+
# target: aarch64-unknown-linux-musl
82+
# vsix-target: alpine-arm64
5083
steps:
5184
- name: Checkout
5285
uses: actions/checkout@v4
5386

5487
- name: Build VSIX
5588
uses: ./.github/actions/build-vsix
5689
with:
57-
node_version: ${{ env.NODE_VERSION }}
58-
vsix_name: ${{ needs.setup.outputs.vsix_name }}
59-
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}
90+
node_version: ${{ env.NODE_VERSION}}
91+
vsix_name: ${{ needs.setup.outputs.vsix_basename }}-${{ matrix.vsix-target }}.vsix'
92+
artifact_name: '${{ needs.setup.outputs.vsix_artifact_name }}-${{ matrix.vsix-target }}'
93+
cargo_target: ${{ matrix.target }}
94+
vsix_target: ${{ matrix.vsix-target }}
6095

6196
lint:
6297
name: Lint

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
target: aarch64-pc-windows-msvc
3434
vsix-target: win32-arm64
3535
- os: ubuntu-latest
36-
target: x86_64-unknown-linux-gnu
36+
target: x86_64-unknown-linux-musl
3737
vsix-target: linux-x64
3838
# - os: ubuntu-latest
3939
# target: aarch64-unknown-linux-gnu

noxfile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
import pathlib
66
import nox
77
import shutil
8-
import sys
98
import sysconfig
109

10+
EXT_ROOT = pathlib.Path(__file__).parent
11+
1112

1213
@nox.session()
1314
def install_python_libs(session: nox.Session):
@@ -91,6 +92,13 @@ def native_build(session: nox.Session):
9192
dest = f"./bin/python-finder{ext}"
9293
shutil.copy(source, dest)
9394

95+
# Remove native_locator/bin exclusion from .vscodeignore
96+
vscode_ignore = EXT_ROOT / ".vscodeignore"
97+
remove_patterns = ("native_locator/bin/**",)
98+
lines = vscode_ignore.read_text(encoding="utf-8").splitlines()
99+
filtered_lines = [line for line in lines if not line.startswith(remove_patterns)]
100+
vscode_ignore.write_text("\n".join(filtered_lines) + "\n", encoding="utf-8")
101+
94102

95103
@nox.session()
96104
def setup_repo(session: nox.Session):

0 commit comments

Comments
 (0)