yutannihilation commented on code in PR #271: URL: https://github.com/apache/sedona-db/pull/271#discussion_r2485104080
########## docs/contributors-guide.md: ########## @@ -116,25 +125,73 @@ On Linux and Windows, it is recommended to use [vcpkg](https://github.com/micros to provide external dependencies. This can be done by setting the `CMAKE_TOOLCHAIN_FILE` environment variable: -```shell -export CMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -``` - -#### Visual Studio Code (VSCode) Configuration +#### Windows + +1. Install Rust + +Install the latest Rust toolchain from [rustup.rs](https://rustup.rs): + +**powershell** +`` +Invoke-WebRequest https://sh.rustup.rs -UseBasicParsing -OutFile rustup-init.exe +.\rustup-init.exe `` +Restart PowerShell, then verify installation: + +`` +rustc --version +cargo --version +`` + +2. Download and install Visual Studio Build Tools. + During installation, select the workload "Desktop development with C++". + link: https://visualstudio.microsoft.com/downloads/ + +3. Install CMake: + Download and install CMake, ensuring "Add CMake to system PATH" is selected. + link: https://cmake.org/download/ + `` cmake --version`` +4. Install and Bootstrap vcpkg: + Clone the vcpkg repository and build the vcpkg executable. + `` + git clone https://github.com/microsoft/vcpkg.git C:\dev\vcpkg + cd C:\dev\vcpkg + .\bootstrap-vcpkg.bat + `` Review Comment: I think the document should note - `C:\dev\vcpkg` is just an example and you can choose whatever path - Yet, you need to choose a short path. Otherwise, you are more likely to hit the infamous 260 character path length limit. ########## docs/contributors-guide.md: ########## @@ -116,25 +125,73 @@ On Linux and Windows, it is recommended to use [vcpkg](https://github.com/micros to provide external dependencies. This can be done by setting the `CMAKE_TOOLCHAIN_FILE` environment variable: -```shell -export CMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -``` - -#### Visual Studio Code (VSCode) Configuration +#### Windows + +1. Install Rust + +Install the latest Rust toolchain from [rustup.rs](https://rustup.rs): + +**powershell** +`` +Invoke-WebRequest https://sh.rustup.rs -UseBasicParsing -OutFile rustup-init.exe +.\rustup-init.exe `` +Restart PowerShell, then verify installation: + +`` +rustc --version +cargo --version +`` + +2. Download and install Visual Studio Build Tools. + During installation, select the workload "Desktop development with C++". + link: https://visualstudio.microsoft.com/downloads/ + +3. Install CMake: + Download and install CMake, ensuring "Add CMake to system PATH" is selected. + link: https://cmake.org/download/ + `` cmake --version`` +4. Install and Bootstrap vcpkg: + Clone the vcpkg repository and build the vcpkg executable. + `` + git clone https://github.com/microsoft/vcpkg.git C:\dev\vcpkg + cd C:\dev\vcpkg + .\bootstrap-vcpkg.bat + `` + +5. Install Required Libraries: + Install necessary dependencies for SedonaDB using vcpkg. + ``C:\dev\vcpkg\vcpkg.exe" install geos proj abseil openssl`` + +6. Configure Environment Variables: + Set environment variables so Cargo and CMake can find the installed dependencies. + The MSYS2 hash folder inside downloads/tools/msys2 may vary—update it as needed. + ```bash + # vcpkg root and toolchain + $env:VCPKG_ROOT = 'C:\dev\vcpkg' + $env:CMAKE_TOOLCHAIN_FILE = "${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + + # pkg-config setup (path hash may vary) + $env:PATH = "${env:VCPKG_ROOT}/downloads/tools/msys2/21caed2f81ec917b/mingw64/bin/;$env:PATH" + $env:PKG_CONFIG_SYSROOT_DIR = "${env:VCPKG_ROOT}/downloads/tools/msys2/21caed2f81ec917b/mingw64/" + $env:PKG_CONFIG_PATH = "${env:VCPKG_ROOT}/installed/x64-windows-dynamic-release/lib/pkgconfig/" + ``` + note: > + The hash (21caed2f81ec917b) inside downloads/tools/msys2/ may differ on your system. + +7. Visual Studio Code Configuration: + When using VSCode, set the CMAKE_TOOLCHAIN_FILE variable in settings.json so rust-analyzer can detect it. + ```bash + settings.json: | + { + "rust-analyzer.runnables.extraEnv": { + "CMAKE_TOOLCHAIN_FILE": "C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake" + }, + "rust-analyzer.cargo.extraEnv": { + "CMAKE_TOOLCHAIN_FILE": "C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake" + } + } Review Comment: Does this `settings.json` work for you? I guess rust-analyzer also needs the other variables as well; `PKG_CONFIG_SYSROOT_DIR`, `PKG_CONFIG_PATH`, and `PATH`. I couldn't figure out how to set up `PATH` correctly... (so I had to modify my system `PATH`). Also note that `settings.json` is not only for Windows developers, so path should be `/path/to/...` instead of `C:/...` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
