Skip to content

Commit

Permalink
windows fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstevens19 committed Aug 6, 2024
1 parent f88e113 commit f380ee2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,37 @@ jobs:
echo "NASM_PATH=$nasmPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
refreshenv
nasm -v
- name: Install vcpkg on Windows
if: matrix.target == 'x86_64-pc-windows-msvc'
shell: pwsh
run: |
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg integrate install
echo "VCPKG_ROOT=C:\vcpkg" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "C:\vcpkg" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install CMake on Windows
if: matrix.target == 'x86_64-pc-windows-msvc'
shell: pwsh
run: |
choco install cmake
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
refreshenv
cmake --version
echo "CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install dependencies with vcpkg
if: matrix.target == 'x86_64-pc-windows-msvc'
shell: pwsh
run: |
C:\vcpkg\vcpkg install openssl:x64-windows-static-md zlib:x64-windows-static-md
- name: Build binaries
working-directory: cli
env:
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake
shell: bash
run: |
set -eo pipefail
Expand All @@ -139,17 +157,18 @@ jobs:
[[ "$target" == *windows* ]] && exe=".exe"
if [[ "$target" == *windows* ]]; then
export CMAKE_TOOLCHAIN_FILE="C:/Program Files/vcpkg/scripts/buildsystems/vcpkg.cmake"
export PATH="$PATH:/c/Program Files/NASM"
export PATH="$PATH:/c/Program Files/NASM:/c/vcpkg"
export NASM="$NASM_PATH/nasm.exe"
echo "NASM location: $NASM"
"$NASM" -v
echo "CMAKE_TOOLCHAIN_FILE: $CMAKE_TOOLCHAIN_FILE"
ls -l "$CMAKE_TOOLCHAIN_FILE" || echo "Toolchain file not found!"
fi
if [[ "${{ env.BUILD_TYPE }}" == "release" ]]; then
RUST_BACKTRACE=1 cargo build --release --target "$target" "${flags[@]}" -vv
RUST_BACKTRACE=1 CMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" cargo build --release --target "$target" "${flags[@]}" -vv
else
RUST_BACKTRACE=1 cargo build --target "$target" "${flags[@]}" -vv
RUST_BACKTRACE=1 CMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" cargo build --target "$target" "${flags[@]}" -vv
fi
- name: Archive binaries
Expand Down
6 changes: 2 additions & 4 deletions core/src/streams/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ impl Kafka {

#[cfg(windows)]
{
println!("Initializing mock Kafka producer for Windows");
Ok(Self {})
panic!("Kafka is not supported on Windows")
}
}

Expand Down Expand Up @@ -93,8 +92,7 @@ impl Kafka {

#[cfg(windows)]
{
println!("Mock Kafka publish on Windows: topic={}, id={}", topic, id);
Ok(())
panic!("Kafka is not supported on Windows")
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Kafka

:::warn
Kafka streams do not work with windows from the CLI installation, it will panic if you try to use it with windows.
If you are on windows and want to use kafka streams you should use the docker image.
:::

:::info
rindexer streams can be used without any other storage providers. It can also be used with storage providers.
:::
Expand Down

0 comments on commit f380ee2

Please sign in to comment.