linghengqian commented on issue #33848:
URL: 
https://github.com/apache/shardingsphere/issues/33848#issuecomment-2508917313

   - Are you talking about 
https://github.com/apache/shardingsphere/tree/master/test/native ? Well, there 
is actually contributor documentation for this module at 
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/graalvm-native-image/
 .
   - I have written most of the unit tests for this module so far, so I will 
say that I have not tested it in a native Windows environment. My testing 
environment follows 
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/graalvm-native-image/#contribute-graalvm-reachability-metadata
 .
   - I first wrote the tests in **WSL** under Windows... Of course you can 
completely ignore WSL, this is actually a standard Linux environment. This is 
actually a bunch of integration tests that intentionally avoid using the 
**Mockito** library. There is also a core issue mentioned in the documentation 
that users can only debug GraalVM Native Image through GDB on Linux. I 
personally have never tested these things directly on Windows.
   
   ## Ubuntu 22.04.4 / Ubuntu 22.04.5
   
   - The system needs a container runtime that complies with the requirements 
of https://java.testcontainers.org/supported_docker_environment/. I take Docker 
CE in rootful mode as an example. Podman should also work, but I haven't tested 
it.
   
   ```shell
   sudo apt update && sudo apt upgrade -y
   sudo apt-get remove docker.io docker-doc docker-compose docker-compose-v2 
podman-docker containerd runc
   cd /tmp/
   sudo apt-get install ca-certificates curl
   sudo install -m 0755 -d /etc/apt/keyrings
   sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o 
/etc/apt/keyrings/docker.asc
   sudo chmod a+r /etc/apt/keyrings/docker.asc
   
   echo \
     "deb [arch=$(dpkg --print-architecture) 
signed-by=/etc/apt/keyrings/docker.asc] 
https://download.docker.com/linux/ubuntu \
     $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
     sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   
   sudo apt-get update
   sudo apt-get install docker-ce docker-ce-cli containerd.io 
docker-buildx-plugin docker-compose-plugin -y
   sudo groupadd docker
   sudo usermod -aG docker $USER
   newgrp docker
   ```
   
   - Since almost all JVMs are distributed through SDKMAN!, Oracle Labs 
encourages people using Linux to use SDKMAN! to install GraalVM. Oracle is the 
copyright holder of GraalVM. Any GraalVM CE For JDK22+ and its downstream 
distributions can be used. I take GraalVM CE For JDK 22.0.2 as an example.
   
   ```shell
   sudo apt install unzip zip -y
   curl -s "https://get.sdkman.io"; | bash
   source "$HOME/.sdkman/bin/sdkman-init.sh"
   sdk install java 22.0.2-graalce
   sdk use java 22.0.2-graalce
   sudo apt-get install build-essential zlib1g-dev -y
   
   git clone [email protected]:apache/shardingsphere.git
   cd ./shardingsphere/
   ./mvnw -PnativeTestInShardingSphere -e -T 1C clean test
   ```
   
   - The process of semi-automatic collection of GRM is in `./mvnw 
-PgenerateMetadata -DskipNativeTests -e -T 1C clean test native:metadata-copy`. 
An explanation of this is at 
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/graalvm-native-image/
 and 
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/startup/graalvm-native-image/
 .
   
   ## Windows 11 Native?
   
   - I've never tested it to be honest, but I'm guessing you could do it.🫠🫠🫠🫠
   
   - You definitely need to turn on long path support, see 
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
 .
   ```shell
   New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
   -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
   ```
   
   - Install Docker Desktop. This is not OSS software, but I really don’t know 
what other software on Windows can start Docker Image except Docker Desktop. 
See https://www.docker.com/products/docker-desktop/ .
   - You don't need to install any JDK, you just need to put the JDK in a 
folder and `setx /M JAVA_HOME` in the IDE terminal. See 
https://www.graalvm.org/latest/getting-started/windows/. There is really no 
SDKMAN! equivalent on Windows, and no one in the SDKMAN! community knows 
PowerShell7, and I don't know PowerShell7 very well.
   - `Install Visual Studio Build Tools and Windows SDK`... Visual Studio is 
certainly not OSS software, and I will say that I certainly haven't 
specifically tested it. See 
https://www.graalvm.org/latest/getting-started/windows/#install-visual-studio-build-tools-and-windows-sdk
 . You do need to install Git for Windows specifically, as it is not included 
with the software.
   ```shell
   winget install --id Microsoft.VisualStudio.2022.Community
   winget install --id Git.Git -e --source winget
   ```
   - Then it should be possible?
   ```shell
   git clone [email protected]:apache/shardingsphere.git
   cd ./shardingsphere/
   ./mvnw -PnativeTestInShardingSphere -e -T 1C clean test
   ```
   
   - I would say you can test it in a VM or Dev Container first. I use Windows 
but I have never used GraalVM under Windows.


-- 
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]

Reply via email to