File tree Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Expand file tree Collapse file tree 2 files changed +47
-2
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,39 @@ jobs:
135135name : iOS Simulator Runner 
136136        timeout-minutes : 45 
137137        run : /opt/homebrew/bin/bash tests/ci/run_ios_sim_tests.sh 
138+   netbsd :
139+     runs-on : ${{ matrix.os }} 
140+     name : Test NetBSD 
141+     strategy :
142+       fail-fast : false 
143+       matrix :
144+         include :
145+           - os : " ubuntu-latest" 
146+             arch : " x86_64" 
147+           - os : " ubuntu-24.04-arm" 
148+             arch : " aarch64" 
149+     steps :
150+     - uses : actions/checkout@v4 
151+     - name : Test in NetBSD 
152+       id : test 
153+       uses : vmactions/netbsd-vm@v1 
154+       with :
155+         release : " 10.1" 
156+         arch : ${{ matrix.arch }} 
157+         envs : ' MYTOKEN MYTOKEN2' 
158+         usesh : true 
159+         run : | 
160+           /usr/sbin/pkg_add cmake 
161+           /usr/sbin/pkg_add gmake 
162+           /usr/sbin/pkg_add go 
163+           /usr/sbin/pkg_add ninja 
164+           /usr/sbin/pkg_add perl 
165+           export PATH="/usr/pkg/bin:/usr/pkg/sbin:/usr/sbin:/usr/bin:/sbin:/bin" 
166+           curl -O https://dl.google.com/go/go1.25.2.netbsd-amd64.tar.gz 
167+           mkdir -p /usr/local 
168+           tar -C /usr/local -xzf go1.25.2.netbsd-amd64.tar.gz 
169+           export GOROOT=/usr/local/go 
170+           export PATH="$PATH:$GOROOT/bin" 
171+           cmake . -B ./build -DCMAKE_BUILD_TYPE=Release -DDISABLE_GO=1 -GNinja 
172+           cmake --build ./build -v --target all 
173+           cmake --build ./build -v --target run_tests 
Original file line number Diff line number Diff line change @@ -24,8 +24,17 @@ PLATFORM=$(uname -m)
2424NUM_CPU_THREADS=' ' 
2525KERNEL_NAME=$( uname -s) 
2626if  [[ " ${KERNEL_NAME} " ==  " Darwin" ||  " ${KERNEL_NAME} " =~  .* BSD ]];  then 
27-   #  On MacOS, /proc/cpuinfo does not exist.
28-   NUM_CPU_THREADS=$( sysctl -n hw.ncpu) 
27+   #  sysctl is typically in /sbin or /usr/sbin on BSD systems
28+   if  command  -v sysctl & >  /dev/null;  then 
29+     NUM_CPU_THREADS=$( sysctl -n hw.ncpu) 
30+   elif  [[ -x  /sbin/sysctl ]];  then 
31+     NUM_CPU_THREADS=$( /sbin/sysctl -n hw.ncpu) 
32+   elif  [[ -x  /usr/sbin/sysctl ]];  then 
33+     NUM_CPU_THREADS=$( /usr/sbin/sysctl -n hw.ncpu) 
34+   else 
35+     echo  " Warning: Could not find sysctl, defaulting to 2 CPU threads" 
36+     NUM
37+   fi 
2938else 
3039  #  Assume KERNEL_NAME is Linux.
3140  NUM_CPU_THREADS=$( grep -c ^processor /proc/cpuinfo) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments