From 3dda7b83c1252f3a11a711077e1abd6815e162eb Mon Sep 17 00:00:00 2001 From: skcd Date: Sat, 2 Dec 2023 19:07:45 +0530 Subject: [PATCH] [sidecar][windows] try and build windows --- .github/workflows/sidecar-windows.yaml | 28 +++++++++++++------------- difftastic/build.rs | 4 +++- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/sidecar-windows.yaml b/.github/workflows/sidecar-windows.yaml index 91da7071a..9c1109ed1 100644 --- a/.github/workflows/sidecar-windows.yaml +++ b/.github/workflows/sidecar-windows.yaml @@ -34,6 +34,20 @@ jobs: with: python-version: '3.9' + - name: Install Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Build + run: | + cargo build --release + + # Now run the .sh script which does the building and packaging + - name: Build and package + run: | + ./package_windows_bin.sh + # This updates the environment variable - name: Set CLOUDSDK_PYTHON environment variable run: echo "CLOUDSDK_PYTHON=$(which python)" >> $GITHUB_ENV @@ -60,20 +74,6 @@ jobs: gcloud config set project ${{ env.GCP_PROJECT_ID }} # Copy the built binary to the GCP bucket gsutil cp sidecar_test.7z "gs://sidecar-bin/windows/sidecar_test.zip" - - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - - name: Build - run: | - cargo build --release - - # Now run the .sh script which does the building and packaging - - name: Build and package - run: | - ./package_windows_bin.sh # Github action parser for sure, something to test it out too quickly - name: Compile the 7z diff --git a/difftastic/build.rs b/difftastic/build.rs index b2b82cf2f..9ca5f68de 100644 --- a/difftastic/build.rs +++ b/difftastic/build.rs @@ -24,7 +24,9 @@ impl TreeSitterParser { // and https://github.com/Wilfred/difftastic/issues/339. let rustc_supports_whole_archive = !rustc::is_max_version("1.60.0").unwrap_or(false); - let dir = PathBuf::from(&self.src_dir); + let owned_src_dir = self.src_dir.to_owned(); + let dir_parts = owned_src_dir.split('/').into_iter().collect::>(); + let dir = PathBuf::from_iter(dir_parts.into_iter()); let mut c_files = vec!["parser.c"]; let mut cpp_files = vec![];