Skip to content

Commit

Permalink
Ensure native locator is included in the VSIX when built (#23476)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
karthiknadig committed May 24, 2024
1 parent 891c7a4 commit 2fe49ea
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
43 changes: 39 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
run:
shell: python
outputs:
vsix_basename: ${{ steps.vsix_names.outputs.vsix_basename }}
vsix_name: ${{ steps.vsix_names.outputs.vsix_name }}
vsix_artifact_name: ${{ steps.vsix_names.outputs.vsix_artifact_name }}
steps:
Expand All @@ -40,23 +41,57 @@ jobs:
else:
vsix_type = "release"
print(f"::set-output name=vsix_name::ms-python-{vsix_type}.vsix")
print(f"::set-output name=vsix_basename::ms-python-{vsix_type}")
print(f"::set-output name=vsix_artifact_name::ms-python-{vsix_type}-vsix")
build-vsix:
name: Create VSIX
if: github.repository == 'microsoft/vscode-python'
needs: setup
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
vsix-target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
vsix-target: win32-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
vsix-target: linux-x64
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# vsix-target: linux-arm64
# - os: ubuntu-latest
# target: arm-unknown-linux-gnueabihf
# vsix-target: linux-armhf
- os: macos-latest
target: x86_64-apple-darwin
vsix-target: darwin-x64
- os: macos-14
target: aarch64-apple-darwin
vsix-target: darwin-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
vsix-target: alpine-x64
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
# vsix-target: alpine-arm64
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build VSIX
uses: ./.github/actions/build-vsix
with:
node_version: ${{ env.NODE_VERSION }}
vsix_name: ${{ needs.setup.outputs.vsix_name }}
artifact_name: ${{ needs.setup.outputs.vsix_artifact_name }}
node_version: ${{ env.NODE_VERSION}}
vsix_name: ${{ needs.setup.outputs.vsix_basename }}-${{ matrix.vsix-target }}.vsix'
artifact_name: '${{ needs.setup.outputs.vsix_artifact_name }}-${{ matrix.vsix-target }}'
cargo_target: ${{ matrix.target }}
vsix_target: ${{ matrix.vsix-target }}

lint:
name: Lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
target: aarch64-pc-windows-msvc
vsix-target: win32-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
target: x86_64-unknown-linux-musl
vsix-target: linux-x64
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
Expand Down
10 changes: 9 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
import pathlib
import nox
import shutil
import sys
import sysconfig

EXT_ROOT = pathlib.Path(__file__).parent


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

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


@nox.session()
def setup_repo(session: nox.Session):
Expand Down

1 comment on commit 2fe49ea

@shigekobeasley
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how long is the withdrawal process

Please sign in to comment.