Skip to content

Commit cc24e71

Browse files
committed
Attempted compile fix
1 parent e55d30f commit cc24e71

File tree

3 files changed

+83
-8
lines changed

3 files changed

+83
-8
lines changed

.github/debug_ssh_start.ps1

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Set-StrictMode -version latest;
2+
$ErrorActionPreference = "Stop";
3+
$VerbosePreference="Continue";
4+
5+
6+
$publicKey=(curl https://github.com/$($env:GITHUB_REPOSITORY_OWNER).keys) + " gh"
7+
Function InstallSshServer(){
8+
[CmdletBinding()]
9+
param(
10+
[Parameter(Mandatory=$true)]
11+
[String] $publicKey
12+
)
13+
Add-WindowsCapability -Online -Name OpenSSH.Server
14+
echo "PubkeyAuthentication yes`nPasswordAuthentication no`nSubsystem sftp sftp-server.exe`nMatch Group administrators`n`tAuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys`n" | out-file -Encoding ASCII $env:programData/ssh/sshd_config
15+
ssh-keygen -A
16+
echo "$publicKey`n" | out-file -Encoding ASCII $env:programData/ssh/administrators_authorized_keys
17+
icacls.exe "$env:programData\ssh\administrators_authorized_keys" /inheritance:r /grant "Administrators:F" /grant "SYSTEM:F"
18+
cat $env:programData/ssh/administrators_authorized_keys
19+
}
20+
Function DownloadStartCloudflareServer(){
21+
[CmdletBinding()]
22+
param(
23+
[Parameter(Mandatory=$true)]
24+
[String] $LocalHostnameAndPort, #ie 127.0.0.1:22
25+
[Parameter(Mandatory=$false)]
26+
[String] $SaveToFilename="cloudflared.exe" #can include path
27+
)
28+
if (([System.IO.File]::Exists($SaveToFilename)) -eq $false) {
29+
Invoke-WebRequest -URI https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -OutFile $SaveToFilename
30+
}
31+
$myargs = "tunnel --no-autoupdate --url tcp://$LocalHostnameAndPort --logfile cfd.log"
32+
#$scriptBlock = [Scriptblock]::Create("Start-Process -NoNewWindow -Wait `"$SaveToFilename`" $myargs ")
33+
$myjob = Start-Process -PassThru -NoNewWindow `"$SaveToFilename`" -ArgumentList $myargs
34+
35+
#Start-Job -Name CFD -ScriptBlock $scriptBlock
36+
#$myjob= Receive-Job -Name CFD
37+
return $myjob
38+
}
39+
Function InstallSSHStartCF(){
40+
[CmdletBinding()]
41+
param(
42+
[Parameter(Mandatory=$true)]
43+
[String] $publicKey,
44+
[Parameter(Mandatory=$false)]
45+
[String] $SaveToFilename="cloudflared.exe" #can include path
46+
)
47+
InstallSshServer $publicKey
48+
$server = DownloadStartCloudflareServer("127.0.0.1:22")
49+
$scriptBlock = [Scriptblock]::Create("Start-Process -NoNewWindow -Wait `"sshd.exe`" ")
50+
51+
Start-Job -Name SSHD -ScriptBlock $scriptBlock
52+
return $server
53+
}
54+
InstallSSHStartCF $publicKey
55+
while ($true) {
56+
Start-Sleep -Seconds 30
57+
cat cfd.log
58+
}
59+
#Wait-Job SSHD

.github/workflows/main.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-22.04, windows-2022]
16+
# os: [ubuntu-22.04, windows-2022]
17+
os: [windows-2022]
1718
platform: [x64]
18-
build-cfg: [Debug, DebugOpt, Release]
19+
# build-cfg: [Debug, DebugOpt, Release]
20+
build-cfg: [Release]
1921
include:
2022
- os: windows-2022
2123
platform: x64
22-
build-cfg: Debug
24+
# build-cfg: Debug
2325

2426
runs-on: ${{ matrix.os }}
2527

@@ -37,7 +39,7 @@ jobs:
3739
- uses: actions/checkout@v4
3840

3941
- name: Setup emsdk
40-
uses: mymindstorm/setup-emsdk@v14
42+
uses: pyodide/setup-emsdk@v15
4143
with:
4244
version: ${{ env.EMSCRIPTEN_VERSION }}
4345
actions-cache-folder: emsdk-cache-${{ runner.os }}
@@ -70,10 +72,24 @@ jobs:
7072
shell: bash
7173
run: build/build.sh restore -platform $PLATFORM -configuration $BUILD_CONFIGURATION
7274

75+
- name: ENV Set
76+
shell: pwsh
77+
run: |
78+
$dir=$env:GITHUB_WORKSPACE
79+
$dir=$dir.replace("\","/")
80+
echo "SCRIPT_FOLDER=$dir" >> $env:GITHUB_ENV
81+
82+
7383
- name: Build
7484
shell: bash
7585
run: build/build.sh -platform $PLATFORM -build_only -configuration $BUILD_CONFIGURATION
7686

87+
- name: Debug Session
88+
shell: pwsh
89+
if: ${{ failure() && vars.DEBUG_FAIL == '1' }}
90+
run: ${{env.SCRIPT_FOLDER}}/.github/debug_ssh_start.ps1
91+
92+
7793
- name: Test (.NET)
7894
# Disable test for debug configs, since they take over 6 hours to complete
7995
if: matrix.build-cfg != 'Debug'

build/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ build()
3838
fi
3939

4040
find_msbuild
41-
$msbuild "$slnpath" -p:Configuration=$configuration -p:Platform=$platform -v:$verbosity -nologo
41+
$msbuild "$slnpath" -p:Configuration=$configuration -p:Platform=$platform -v:$verbosity -nologo -p:DefineConstants="_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH"
4242

4343
if [ $ci = true ]; then
4444
test
@@ -103,7 +103,7 @@ test()
103103
}
104104

105105
clean()
106-
{
106+
{
107107
rm -rf "$objdir"
108108
rm -rf "$gendir"
109109
rm -rf "$bindir"
@@ -202,7 +202,7 @@ while [[ $# > 0 ]]; do
202202
-configuration)
203203
configuration=$2
204204
shift
205-
;;
205+
;;
206206
-platform)
207207
platform=$2
208208
shift
@@ -240,7 +240,7 @@ case "$cmd" in
240240
;;
241241
generate_config)
242242
generate_config
243-
;;
243+
;;
244244
prepack)
245245
prepack
246246
;;

0 commit comments

Comments
 (0)