Skip to content

Commit 837a4a6

Browse files
committed
Attempted compile fix
1 parent e55d30f commit 837a4a6

File tree

3 files changed

+84
-8
lines changed

3 files changed

+84
-8
lines changed

.github/debug_ssh_start.ps1

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
Write-Host "SSH Installed"
20+
}
21+
Function DownloadStartCloudflareServer(){
22+
[CmdletBinding()]
23+
param(
24+
[Parameter(Mandatory=$true)]
25+
[String] $LocalHostnameAndPort, #ie 127.0.0.1:22
26+
[Parameter(Mandatory=$false)]
27+
[String] $SaveToFilename="cloudflared.exe" #can include path
28+
)
29+
if (([System.IO.File]::Exists($SaveToFilename)) -eq $false) {
30+
Invoke-WebRequest -URI https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe -OutFile $SaveToFilename
31+
}
32+
$myargs = "tunnel --no-autoupdate --url tcp://$LocalHostnameAndPort --logfile cfd.log"
33+
#$scriptBlock = [Scriptblock]::Create("Start-Process -NoNewWindow -Wait `"$SaveToFilename`" $myargs ")
34+
$myjob = Start-Process -PassThru -NoNewWindow `"$SaveToFilename`" -ArgumentList $myargs
35+
36+
#Start-Job -Name CFD -ScriptBlock $scriptBlock
37+
#$myjob= Receive-Job -Name CFD
38+
Write-Host "Cloudflared Installed"
39+
return $myjob
40+
}
41+
Function InstallSSHStartCF(){
42+
[CmdletBinding()]
43+
param(
44+
[Parameter(Mandatory=$true)]
45+
[String] $publicKey,
46+
[Parameter(Mandatory=$false)]
47+
[String] $SaveToFilename="cloudflared.exe" #can include path
48+
)
49+
InstallSshServer $publicKey
50+
$server = DownloadStartCloudflareServer("127.0.0.1:22")
51+
$scriptBlock = [Scriptblock]::Create("Start-Process -NoNewWindow -Wait `"sshd.exe`" ")
52+
53+
Start-Job -Name SSHD -ScriptBlock $scriptBlock
54+
return $server
55+
}
56+
InstallSSHStartCF $publicKey
57+
while ($true) {
58+
Start-Sleep -Seconds 30
59+
cat cfd.log
60+
}
61+
#Wait-Job SSHD

.github/workflows/main.yml

Lines changed: 20 additions & 7 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'
@@ -115,9 +131,6 @@ jobs:
115131
create_package:
116132
runs-on: windows-2019
117133
needs: build
118-
if: |
119-
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || contains(github.ref, 'nuget') || startsWith(github.ref, 'refs/tags/v'))) ||
120-
(github.event.pull_request.head.repo.full_name != github.repository && (contains(github.event.pull_request.head.ref, 'nuget') || startsWith(github.event.pull_request.head.ref, 'refs/tags/v')))
121134

122135
env:
123136
DOTNET_NOLOGO: true

src/Parser/ParserOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,12 @@ public void SetupMSVC(VisualStudioVersion vsVersion)
156156

157157
var clVersion = MSVCToolchain.GetCLVersion(vsVersion);
158158
ToolSetToUse = clVersion.Major * 10000000 + clVersion.Minor * 100000;
159-
159+
160160
AddArguments("-fms-extensions");
161161
AddArguments("-fms-compatibility");
162162
AddArguments("-fdelayed-template-parsing");
163+
AddArguments("-fdelayed-template-parsing");
164+
AddArguments("-D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH");
163165
}
164166

165167
/// <summary>

0 commit comments

Comments
 (0)