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

Msvc modular stdlib #108

Merged
merged 15 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
56 changes: 18 additions & 38 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Code quality and sanity

on:
push:
branches: '*'
branches: 'main'
pull_request:
branches: '*'

Expand All @@ -22,12 +22,12 @@ jobs:
- uses: hecrj/setup-rust-action@v1
with:
components: clippy

- name: Verifiying the code quality with Clippy

- name: Verifiying the code quality with Clippy
working-directory: zork++
run: |
cd zork++
cargo clippy --all-targets --all-features
rustfmt:
name: Verify code formatting
runs-on: ubuntu-latest
Expand All @@ -36,51 +36,31 @@ jobs:
- name: Caching project dependencies
id: project-cache
uses: Swatinem/rust-cache@v2
- uses: hecrj/setup-rust-action@v1

- uses: hecrj/setup-rust-action@v2
with:
components: rustfmt

- name: Checking the format sanity of the project
working-directory: zork++
run: |
cd zork++
cargo fmt --all -- --check
tests:
name: Run the tests - Clang
unit-and-doc-tests:
name: Verify code formatting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
clang_version: [15, 16, 17]
steps:
- uses: actions/checkout@v3
- name: Caching project dependencies
id: project-cache
uses: Swatinem/rust-cache@v2
- name: Install Clang ${{ matrix.clang_version }}
run: |
# Exit on error
set -e
# Download and execute the LLVM installation script for the specified Clang version
echo "-----> Downloading and executing the LLVM installation script for Clang ${{ matrix.clang_version }}"
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.clang_version }}
echo "-----> Installing libc++"
sudo apt-get install -y libc++-${{ matrix.clang_version }}-dev libc++abi-${{ matrix.clang_version }}-dev libunwind-${{ matrix.clang_version }} libunwind-${{ matrix.clang_version }}-dev libc6 libzstd1

# Update the symbolic link to point to the newly installed Clang version
echo "-----> Updating the symbolic link to point to Clang ${{ matrix.clang_version }}"
sudo rm -f /usr/bin/clang++
sudo ln -s /usr/bin/clang++-${{ matrix.clang_version }} /usr/bin/clang++
- uses: hecrj/setup-rust-action@v2
with:
components: rustfmt

# Display the installation directory and version of the installed Clang
echo "-----> Clang-${{ matrix.clang_version }} was installed on:"
which clang-${{ matrix.clang_version }}
echo "-----> Clang++ was installed on:"
which clang++-${{ matrix.clang_version }}
- name: Running the tests for the project
- name: Run Unit and Doc tests
working-directory: zork++
run: |
cd zork++
RUST_LOG=trace cargo test 2>&1 --all --color=always --no-fail-fast -- --nocapture --show-output --test-threads=1
cargo test --workspace --lib --color=always --no-fail-fast
cargo test --workspace --doc --color=always --no-fail-fast
52 changes: 52 additions & 0 deletions .github/workflows/tests-clang-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Clang Tests For Linux builds

on:
push:
branches: 'main'
pull_request:
branches: '*'

jobs:
tests:
name: Run the tests - Clang
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
clang_version: [15, 16, 17, 18]
steps:
- uses: actions/checkout@v3
- name: Caching project dependencies
id: project-cache
uses: Swatinem/rust-cache@v2

- if: ${{ matrix.clang_version < 18 }}
name: Install Clang ${{ matrix.clang_version }}
run: |
# Exit on error
set -e
# Download and execute the LLVM installation script for the specified Clang version
echo "-----> Downloading and executing the LLVM installation script for Clang ${{ matrix.clang_version }}"
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.clang_version }}
echo "-----> Installing libc++"
sudo apt-get install -y libc++-${{ matrix.clang_version }}-dev libc++abi-${{ matrix.clang_version }}-dev libunwind-${{ matrix.clang_version }} libunwind-${{ matrix.clang_version }}-dev libc6 libzstd1
# Update the symbolic link to point to the newly installed Clang version
echo "-----> Updating the symbolic link to point to Clang ${{ matrix.clang_version }}"
sudo rm -f /usr/bin/clang++
sudo ln -s /usr/bin/clang++-${{ matrix.clang_version }} /usr/bin/clang++
# Display the installation directory and version of the installed Clang
echo "-----> Clang-${{ matrix.clang_version }} was installed on:"
which clang-${{ matrix.clang_version }}
echo "-----> Clang++ was installed on:"
which clang++-${{ matrix.clang_version }}
- if: ${{ matrix.clang_version < 18 }}
name: Running the tests for the project
run: |
cd zork++
RUST_LOG=trace cargo test 2>&1 clang --color=always --no-fail-fast -- --nocapture --show-output --test-threads=1
25 changes: 25 additions & 0 deletions .github/workflows/tests-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: GCC Tests For Linux builds

on:
push:
branches: 'main'
pull_request:
branches: '*'

jobs:
tests:
name: Run the tests - GCC
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3

- name: Caching project dependencies
id: project-cache
uses: Swatinem/rust-cache@v2

- name: Running the tests for the project
run: |
cd zork++
RUST_LOG=trace cargo test 2>&1 gcc --color=always --no-fail-fast -- --nocapture --show-output --test-threads=1
30 changes: 30 additions & 0 deletions .github/workflows/tests-msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: MSVC Tests For Windows builds

on:
push:
branches: 'main'
pull_request:
branches: '*'

jobs:
tests:
name: Run the tests - MSVC
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3

- name: Caching project dependencies
id: project-cache
uses: Swatinem/rust-cache@v2

- name: Setting up Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable

- name: Running the tests for the project
run: |
cd zork++
cargo test 2>&1 msvc --color=always --no-fail-fast -- --nocapture --show-output --test-threads=1
150 changes: 75 additions & 75 deletions release-config/windows-installer-zork.iss
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Zork++"
#define MyAppVersion "0.8.8"
#define MyAppPublisher "Zero Day Code"
#define MyAppURL "https://github.com/zerodaycode/Zork"
#define MyAppExeName "zork++.exe"
#define MyAppAssocName MyAppName + " File"
#define MyAppAssocExt ".myp"
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{428903B8-CFCC-4E80-AD1D-6BAE9EAEC38C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
ChangesAssociations=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=..\
OutputBaseFilename=zork-installer
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ChangesEnvironment=true
SetupIconFile=..\assets\installer_logo.ico


[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Files]
Source: "..\LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\zork++\target\release\zork++.exe"; DestDir: "{app}"; Flags: ignoreversion

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}";Check: NeedsAddPath('{app}')
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
{ look for the path with leading and trailing semicolon }
{ Pos() returns 0 if not found }
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Zork++"
#define MyAppVersion "0.9.0"
#define MyAppPublisher "Zero Day Code"
#define MyAppURL "https://github.com/zerodaycode/Zork"
#define MyAppExeName "zork++.exe"
#define MyAppAssocName MyAppName + " File"
#define MyAppAssocExt ".myp"
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{428903B8-CFCC-4E80-AD1D-6BAE9EAEC38C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
ChangesAssociations=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputDir=..\
OutputBaseFilename=zork-installer
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ChangesEnvironment=true
SetupIconFile=..\assets\installer_logo.ico


[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Files]
Source: "..\LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\zork++\target\release\zork++.exe"; DestDir: "{app}"; Flags: ignoreversion

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: ""
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}";Check: NeedsAddPath('{app}')
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
function NeedsAddPath(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
'Path', OrigPath)
then begin
Result := True;
exit;
end;
{ look for the path with leading and trailing semicolon }
{ Pos() returns 0 if not found }
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;
6 changes: 6 additions & 0 deletions rust-analyzer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{

"procMacro": {
"enable": true
}
}
Loading
Loading