Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDP11: RF11: Fix DAE computation in service routine; log WC naturally #241

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 128 additions & 46 deletions .github/workflows/cmake-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: Upload DEB
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-x86_64-${{matrix.os}}.deb
path: cmake/build-ninja/simh-4.0.0-x86_64-${{matrix.os}}.deb
name: simh-4.1.0-x86_64-${{matrix.os}}.deb
path: cmake/build-ninja/simh-4.1.0-x86_64-${{matrix.os}}.deb


cmake-macOS:
Expand Down Expand Up @@ -68,13 +68,13 @@ jobs:
- name: Upload ZIP
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-x86_64.${{matrix.os}}.zip
path: cmake/build-xcode/simh-4.0.0-x86_64.${{matrix.os}}.zip
name: simh-4.1.0-x86_64.${{matrix.os}}.zip
path: cmake/build-xcode/simh-4.1.0-x86_64.${{matrix.os}}.zip
- name: Upload DMG
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-x86_64.${{matrix.os}}.dmg
path: cmake/build-xcode/simh-4.0.0-x86_64.${{matrix.os}}.dmg
name: simh-4.1.0-x86_64.${{matrix.os}}.dmg
path: cmake/build-xcode/simh-4.1.0-x86_64.${{matrix.os}}.dmg


## This looks like it's doing the right thing on the Github CI/CD pipeline because
Expand Down Expand Up @@ -108,46 +108,128 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
##+
## NOTE: This will have to change when Github updates the windows-latest
## image AND when Microsoft bumps the Visual Studio year.
##
## Things that need updating:
## - Product ID (maybe: MS seems to be very consistent with the component
## name, hasn't changed since VS 2019.)
## - Channel ID
##-
- name: Install v141_xp (XP toolkit)
- name: Install v141_xp (XP toolkit) and build SIMH
shell: pwsh
run: |
$ErrorActionPreference="Stop"
$WarningPreference="Continue"
$packageParams = @( "--productId", "Microsoft.VisualStudio.Product.Enterprise",
"--channelId", "VisualStudio.17.Release",
"--add", "Microsoft.VisualStudio.Component.VC.v141.x86.x64",
"--add", "Microsoft.VisualStudio.Component.WinXP",
"--no-includeRecommended",
"--includeOptional",
"--quiet",
"--locale en-US" ) -join " "
choco install visualstudio2022-workload-nativedesktop --package-parameters $packageParams

- name: vs2022-xp build
shell: pwsh
run: |
$ErrorActionPreference="Stop"
$WarningPreference="Continue"
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
Update-SessionEnvironment
$ErrorActionPreference = "Stop"
$WarningPreference = "Continue"
$DebugPreference = "Continue"

# Fix PATH so that "C:\Strawberry" (Strawberry Perl) doesn't mess with the build
# CMake WILL find incompatible libraries within Strawberry.
$fixPATH = (${env:PATH}.Split(';') | `
Where-Object { $_ -notlike "*\Strawberry\*" -and $_ -notlike "*/Strawberry/*" }) -join ';'
$env:Path = $fixPATH

#+
# Update the existing Github Visual Studio installation in-place. `vswhere` may find multiple
# VS installations, so iterate through them all.
#
# This is Grey Magic. `vs_installer` exits almost immediately if you run it from the command
# line. However, `vs_installer`'s subprocesses are well known and we look for them and wait
# for them to terminate.
#
# GH Actions does something strange with stdout and stderr, so you won't get any
# indication of failure or output that shows you that something is happening.
#
# The waiting code was adapted from the Chocolatey VS installer scripts.
#-
$vswhere = "${env:ProgramFiles} (x86)\Microsoft Visual Studio\Installer\vswhere"
$vsinstaller = "${env:ProgramFiles} (x86)\Microsoft Visual Studio\Installer\vs_installer.exe"
$vsInstallOut = "$env:TEMP\vsinstall-out.txt"
$vsInstallErr = "$env:TEMP\vsinstall-err.txt"

& ${vswhere} -property installationPath | `
Foreach-Object -process {
## --quiet: Don't open/show UI
## --force: Terminate any VS instances forcibly
## --norestart: Delay reboot after install, if needed
## --installWhileDownloading: Self-explanitory.
$Params = @(
"modify",
"--installPath", "$_",
"--add", "Microsoft.VisualStudio.Component.VC.v141.x86.x64",
"--add", "Microsoft.VisualStudio.Component.WinXP",
"--quiet", "--force", "--norestart", "--installWhileDownloading"
)

& $vsInstaller $Params 2> $vsInstallErr > $vsInstallOut

$vsinstallerProcesses = @('vs_installer', 'vs_installershell', 'vs_installerservice')
$vsInstallerStartup = $true
$vsInstallerStartCount = 10

do
{
Write-Debug ('Looking for running VS installer processes')
$vsInstallerRemaining = Get-Process -Name $vsinstallerProcesses -ErrorAction SilentlyContinue | Where-Object { $null -ne $_ -and -not $_.HasExited }
$vsInstallerProcessCount = ($vsInstallerRemaining | Measure-Object).Count
if ($vsInstallerProcessCount -gt 0)
{
## Installer processes are present, so obviously not starting up.
$vsInstallerStartup = $false
try
{
Write-Debug "Found $vsInstallerProcessCount running Visual Studio installer processes which are known to exit asynchronously:"
$vsInstallerRemaining | Sort-Object -Property Name, Id | ForEach-Object { '[{0}] {1}' -f $_.Id, $_.Name } | Write-Debug
Write-Debug ('Giving the processes some time to exit')
$vsInstallerRemaining | Wait-Process -Timeout 45 -ErrorAction SilentlyContinue
}
finally
{
$vsInstallerRemaining | ForEach-Object { $_.Dispose() }
$vsInstallerRemaining = $null
}
} else {
if ($vsInstallerStartup) {
if ($vsInstallerStartCount -gt 0) {
Write-Debug "No VS installer processes detected; sleeping with $vsInstallerStartCount tries remaining."
Start-Sleep -Seconds 10.0
$vsInstallerStartCount -= 1
} else {
$vsInstallerStartup = $false
Write-Debug "VS installer never started? Exiting."
Exit 99
}
}
}
}
while (($vsInstallerStartup -and $vsInstallerStartCount -gt 0) -or $vsInstallerProcessCount -gt 0)
}

if ((Test-Path $vsInstallOut -PathType Leaf) -and (Get-Item $vsInstallOut).length -gt 0kb)
{
Write-Output "-- vsinstaller output:"
Get-Content $vsInstallOut
}
else
{
Write-Debug "-- No vsinstaller output."
}

if ((Test-Path $vsInstallErr -PathType Leaf) -and (Get-Item $vsInstallErr).length -gt 0kb)
{
Write-Output "-- vsinstaller error output:"
Get-Content $vsInstallErr
}
else
{
Write-Debug "-- No vsinstaller error/diag output."
}

#+
# The GH Windows runner image documentation says that the VSSetup module is installed, from
# whence Get-VSSetupInstance and Select-VSSetupInstance are imported. This step is pure
# paranoia, ensuring that we really, truly and honestly have WinXP support.
#-
Write-Debug "Get-VSSetupInstance/Select-VSSetupInstance"
Get-VSSetupInstance -All | Select-VSSetupInstance -Require 'Microsoft.VisualStudio.Component.WinXP' -Latest

## Don't use LTO for XP. XP compatibility comes from VS2017 -- MS is
## at VS2022. There are likely legacy bugs that have been fixed.
./cmake/cmake-builder.ps1 -flavor vs2022-xp -config Release -clean -verbose -notest -cpack_suffix win32-xp


- name: SIMH simulator suite test
shell: pwsh
run: |
Expand All @@ -166,13 +248,13 @@ jobs:
- name: Upload ZIP
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-win32-vs2022xp.zip
path: cmake/build-vs2022-xp/simh-4.0.0-win32-xp.zip
name: simh-4.1.0-win32-vs2022xp.zip
path: cmake/build-vs2022-xp/simh-4.1.0-win32-xp.zip
- name: Upload MSI
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-win32-vs2022xp.zip
path: cmake/build-vs2022-xp/simh-4.0.0-win32-xp.msi
name: simh-4.1.0-win32-vs2022xp.zip
path: cmake/build-vs2022-xp/simh-4.1.0-win32-xp.msi

cmake-vs2022:
name: VS 2022 Win10 native VCPKG
Expand Down Expand Up @@ -213,15 +295,15 @@ jobs:
- name: Upload ZIP
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-win32-vs2022.zip
path: cmake/build-vs2022/simh-4.0.0-win32-native.zip
name: simh-4.1.0-win32-vs2022.zip
path: cmake/build-vs2022/simh-4.1.0-win32-native.zip
- name: Upload EXE installer
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-win32-vs2022.exe
path: cmake/build-vs2022/simh-4.0.0-win32-native.exe
name: simh-4.1.0-win32-vs2022.exe
path: cmake/build-vs2022/simh-4.1.0-win32-native.exe
- name: Upload MSI installer
uses: actions/upload-artifact@v3
with:
name: simh-4.0.0-win32-vs2022.msi
path: cmake/build-vs2022/simh-4.0.0-win32-native.msi
name: simh-4.1.0-win32-vs2022.msi
path: cmake/build-vs2022/simh-4.1.0-win32-native.msi
59 changes: 59 additions & 0 deletions .github/workflows/coverity-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Coverity Scan
on:
schedule:
- cron: '0 18 * * 2,4' # Bi-weekly at 18:00 UTC on Tuesday and Thursday

# Automatically cancel any previous workflow on new push.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
latest:
runs-on: ubuntu-22.04
steps:
- name: Determine current repository
id: "determine-repo"
run: echo "repo=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT

- uses: actions/checkout@v3
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=open-simh%2Fsimh" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
if: steps.determine-repo.outputs.repo == 'open-simh/simh'

- name: Fixed world writable dirs
run: |
chmod go-w $HOME
sudo chmod -R go-w /usr/share
if: steps.determine-repo.outputs.repo == 'open-simh/simh'

- name: Installing build dependencies
run: |
sh -ex .travis/deps.sh linux
sudo apt --assume-yes install -ym ninja-build
if: steps.determine-repo.outputs.repo == 'open-simh/simh'

- name: Build with cov-build
run: |
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int cmake/cmake-builder.sh --config Release --flavor ninja --lto --notest --parallel --verbose --cpack_suffix x86_64-${{matrix.os}}
if: steps.determine-repo.outputs.repo == 'open-simh/simh'

- name: Submit the result to Coverity Scan
run: |
tar czvf simh.tgz cov-int
curl \
--form token=$TOKEN \
--form [email protected] \
--form [email protected] \
--form version=trunk \
--form description="opensimh" \
https://scan.coverity.com/builds?project=open-simh%2Fsimh
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
if: steps.determine-repo.outputs.repo == 'open-simh/simh'
Loading