Skip to content

Commit f428ce4

Browse files
aman-goelankushdesaimchadalavada
authored
[P 2.1] Upgrade to .NET 8 (#705)
* Removed the C backend completely in the P 2.1 * Upgraded P to use .Net 8.0 * Updated the actions to .Net 8.0 * [PSym] Upgrade to .NET 8.0 * Update build scripts and docs (#703) * Update .Net 8 SDK instructions for AL2 (#704) * Update .net version to 8.0 in build scripts * Update .net 8 installation in docs * Update dotnet sdk 8.0 installation instructions for AL2 * [P 2.1] Cleanup and correct docs Changes Java installation to Java 17 on AL2 in docs Removes P 2.0.x install steps in old install instructions Removes global.json file * [2.1] Adds option --list-tests to p check command to list all test cases and exit * Add installation details url for .net AL2 (#706) --------- Co-authored-by: Ankush Desai <[email protected]> Co-authored-by: Ankush Desai <[email protected]> Co-authored-by: mchadalavada <[email protected]>
1 parent 788a48e commit f428ce4

File tree

202 files changed

+1465
-3861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+1465
-3861
lines changed

.github/workflows/macosci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Setup .NET Core
1111
uses: actions/setup-dotnet@v1
1212
with:
13-
dotnet-version: 6.0.x
13+
dotnet-version: 8.0.x
1414
- name: Set up JDK
1515
uses: actions/setup-java@v1
1616
with:

.github/workflows/pcover.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET Core
2222
uses: actions/setup-dotnet@v1
2323
with:
24-
dotnet-version: 6.0.x
24+
dotnet-version: 8.0.x
2525
- name: Set up JDK
2626
uses: actions/setup-java@v1
2727
with:

.github/workflows/psym.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET Core
2222
uses: actions/setup-dotnet@v1
2323
with:
24-
dotnet-version: 6.0.x
24+
dotnet-version: 8.0.x
2525
- name: Set up JDK
2626
uses: actions/setup-java@v1
2727
with:

.github/workflows/psymb.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET Core
2222
uses: actions/setup-dotnet@v1
2323
with:
24-
dotnet-version: 6.0.x
24+
dotnet-version: 8.0.x
2525
- name: Set up JDK
2626
uses: actions/setup-java@v1
2727
with:

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup .NET Core @ Latest
2626
uses: actions/setup-dotnet@v1
2727
with:
28-
dotnet-version: 6.0.x
28+
dotnet-version: 8.0.x
2929

3030
- name: Set the package version
3131
run: |

.github/workflows/tutorials.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup .NET Core
1414
uses: actions/setup-dotnet@v1
1515
with:
16-
dotnet-version: 6.0.x
16+
dotnet-version: 8.0.x
1717
- name: Set up JDK
1818
uses: actions/setup-java@v1
1919
with:

.github/workflows/ubuntuci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Setup .NET Core
1111
uses: actions/setup-dotnet@v1
1212
with:
13-
dotnet-version: 6.0.x
13+
dotnet-version: 8.0.x
1414
- name: Set up JDK
1515
uses: actions/setup-java@v1
1616
with:

.github/workflows/windowsci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Setup .NET Core
1111
uses: actions/setup-dotnet@v1
1212
with:
13-
dotnet-version: 6.0.x
13+
dotnet-version: 8.0.x
1414
- name: Build
1515
run: dotnet build --configuration Release
1616
- name: Test

Bld/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ output=`dotnet build -c Release -v q 2>&1` || echo $output
2323

2424
if [ $? -eq 0 ]; then
2525
echo -e "${GREEN} ----------------------------------${NOCOLOR}"
26-
echo -e "${GREEN} P Compiler located in ${PWD}/Bld/Drops/Release/Binaries/net6.0/p.dll${NOCOLOR}"
26+
echo -e "${GREEN} P Compiler located in ${PWD}/Bld/Drops/Release/Binaries/net8.0/p.dll${NOCOLOR}"
2727
echo -e "${GREEN} ----------------------------------${NOCOLOR}"
2828
echo -e "${GREEN} ----------------------------------${NOCOLOR}"
2929
echo -e "${GREEN} Shortcuts:: (add the following lines (aliases) to your bash_profile) ${NOCOLOR}"
30-
echo -e "${ORANGE} alias pl='dotnet ${PWD}/Bld/Drops/Release/Binaries/net6.0/p.dll'${NOCOLOR}"
30+
echo -e "${ORANGE} alias pl='dotnet ${PWD}/Bld/Drops/Release/Binaries/net8.0/p.dll'${NOCOLOR}"
3131
echo -e "${GREEN} ----------------------------------${NOCOLOR}"
3232
fi
3333

Docs/docs/getstarted/install.md

+20-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ P is built to be cross-platform and can be used on MacOS, Linux, and Windows. We
77

88
### [Step 1] Install .Net Core SDK
99
The P compiler is implemented in C# and hence the tool chain requires `dotnet`.
10-
P currently uses the specific version of [.Net SDK 6.0](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).
10+
P currently uses the specific version of [.Net SDK 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0).
1111

1212

1313
=== "MacOS"
@@ -16,10 +16,10 @@ P currently uses the specific version of [.Net SDK 6.0](https://dotnet.microsoft
1616

1717
```shell
1818
brew tap isen-ng/dotnet-sdk-versions
19-
brew install --cask dotnet-sdk6-0-400
19+
brew install --cask dotnet-sdk8-0-200
2020
```
2121

22-
Dont have Homebrew? :upside_down_face: Install manually using the installer for [x64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.405-macos-x64-installer) or [Arm64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.405-macos-arm64-installer).
22+
Dont have Homebrew? :upside_down_face: Install manually using the installer for [x64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.201-macos-x64-installer) or [Arm64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.201-macos-arm64-installer).
2323

2424
=== "Ubuntu"
2525

@@ -32,32 +32,38 @@ P currently uses the specific version of [.Net SDK 6.0](https://dotnet.microsoft
3232
```
3333

3434
```shell
35-
sudo apt update && sudo apt install -y dotnet-sdk-6.0
35+
sudo apt update && sudo apt install -y dotnet-sdk-8.0
3636
```
3737

3838

3939
=== "Amazon Linux"
40-
41-
Installing .Net SDK on Amazon Linux ([details](https://docs.servicestack.net/deploy-netcore-to-amazon-linux-2-ami))
4240

41+
Installing .Net SDK on Amazon Linux 2 ([details](https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install))
42+
4343
```shell
44-
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
45-
```
44+
wget https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
45+
chmod +x dotnet-install.sh
46+
./dotnet-install.sh -c 8.0 -i ~/.dotnet
47+
48+
# If using a bash shell, replace .zshrc with .bashrc in the below commands
49+
echo 'PATH=$HOME/.dotnet:$HOME/.dotnet/tools:$PATH' >> ~/.zshrc
50+
echo 'export PATH' >> ~/.zshrc
51+
source ~/.zshrc
4652

47-
```shell
48-
sudo yum install -y dotnet-sdk-6.0
53+
sudo mkdir /usr/share/dotnet/
54+
sudo cp -r ~/.dotnet/* /usr/share/dotnet/
4955
```
5056

5157
=== "Windows"
5258

53-
Installing .Net SDK on Windows using the installer for [x64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.405-windows-x64-installer) or [Arm64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-6.0.405-windows-arm64-installer)
59+
Installing .Net SDK on Windows using the installer for [x64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.201-windows-x64-installer) or [Arm64](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-8.0.201-windows-arm64-installer)
5460

5561
??? hint "Troubleshoot: Confirm that dotnet is correctly installed on your machine."
5662
```shell
5763
dotnet --list-sdks
5864
```
5965

60-
You must see an SDK with `6.0.*` dotnet version installed.
66+
You must see an SDK with `8.0.*` dotnet version installed.
6167
If you get `dotnet` command not found error, mostly likely, you need to add the path to dotnet in your `PATH`.
6268

6369
Useful resources:
@@ -88,10 +94,10 @@ The P compiler also requires Java (`java` version 11 or higher).
8894

8995
=== "Amazon Linux"
9096

91-
Installing Java 11 on Amazon Linux (you can use any version of java >= 11)
97+
Installing Java 17 on Amazon Linux (you can use any version of java >= 11)
9298

9399
```shell
94-
sudo yum install -y java-11-amazon-corretto
100+
sudo yum install -y java-17-amazon-corretto
95101
```
96102

97103
=== "Windows"

Docs/docs/old/getstarted/install.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
P is built to be cross-platform and can be used on MacOS, Linux, and Windows. We provide a step-by-step guide for installing P along with its required dependencies.
44

55
!!! info ""
6-
After each step, please use the troubleshooting check to ensure that each installation step succeeded.
6+
After each step, please use the troubleshooting check to ensure that each installation step succeeded.
77

88
### [Step 1] Install .Net Core SDK
9-
The P compiler and checker are implemented in C# and hence the tool chain requires `dotnet`.
9+
The P compiler and checker are implemented in C# and hence the tool chain requires `dotnet`.
1010
P currently uses the specific version of [.Net SDK 3.1](https://dotnet.microsoft.com/download/dotnet/3.1).
1111
To install .Net Core 3.1 SDK use:
1212

@@ -37,7 +37,7 @@ To install .Net Core 3.1 SDK use:
3737
```
3838

3939
=== "Amazon Linux"
40-
Installing .Net SDK on Amazon Linux ([details](https://docs.servicestack.net/deploy-netcore-to-amazon-linux-2-ami))
40+
Installing .Net SDK on Amazon Linux ([details](https://docs.servicestack.net/deploy-netcore-to-amazon-linux-2-ami))
4141

4242
```
4343
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
@@ -52,7 +52,7 @@ To install .Net Core 3.1 SDK use:
5252
Installing .Net SDK on Windows using the installer ([details](https://dotnet.microsoft.com/download/dotnet/thank-you/sdk-3.1.412-windows-x64-installer))
5353

5454
??? hint "Troubleshoot: Confirm that dotnet is correctly installed on your machine."
55-
`dotnet --list-sdks`
55+
`dotnet --list-sdks`
5656

5757
You must see an SDK with `3.1.*` dotnet version installed.
5858
If you get `dotnet` command not found error, mostly likely, you need to add the path to dotnet in your `PATH`.
@@ -92,7 +92,7 @@ To install Java use:
9292
Installing Java on Windows ([details](https://www.java.com/en/download/help/windows_manual_download.html))
9393

9494
??? hint "Troubleshoot: Confirm that java is correctly installed on your machine."
95-
`java -version`
95+
`java -version`
9696

9797
If you get `java` command not found error, mostly likely, you need to add the path to `java` in your `PATH`.
9898

@@ -115,7 +115,7 @@ dotnet tool install --global P
115115
If you are getting the error that the `pc` command is not found, it is most likely that `$HOME/.dotnet/tools` is not in your `PATH`.
116116

117117
??? help "Updating P Compiler"
118-
You can update the version of `P` compiler by running the following command:
118+
You can update the version of `P` compiler by running the following command:
119119

120120
`dotnet tool update --global P`
121121

@@ -164,4 +164,4 @@ We highly recommend that you create the following alias as we use it in the rest
164164

165165
## Using P
166166

167-
Great :smile:! You are all set to compile and test your first P program :mortar_board:!
167+
Great :smile:! You are all set to compile and test your first P program :mortar_board:!

Src/PChecker/CheckerCore/Actors/Actor.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
using PChecker.Actors.Events;
1515
using PChecker.Actors.Exceptions;
1616
using PChecker.Actors.Handlers;
17-
using PChecker.Actors.Managers;
1817
using PChecker.Actors.Logging;
18+
using PChecker.Actors.Managers;
1919
using PChecker.Exceptions;
2020
using PChecker.IO.Debugging;
2121
using EventInfo = PChecker.Actors.Events.EventInfo;
@@ -789,7 +789,7 @@ private void AssertActionValidity(MethodInfo action)
789789
var actionType = action.DeclaringType;
790790
var parameters = action.GetParameters();
791791
Assert(parameters.Length is 0 ||
792-
(parameters.Length is 1 && parameters[0].ParameterType == typeof(Event)),
792+
(parameters.Length is 1 && parameters[0].ParameterType == typeof(Event)),
793793
"Action '{0}' in '{1}' must either accept no parameters or a single parameter of type 'Event'.",
794794
action.Name, actionType.Name);
795795

@@ -1003,4 +1003,4 @@ public OnEventDoActionAttribute(Type eventType, string actionName)
10031003
}
10041004
}
10051005
}
1006-
}
1006+
}

Src/PChecker/CheckerCore/Actors/ActorFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ public static Actor Create(Type type)
4545
return constructor();
4646
}
4747
}
48-
}
48+
}

Src/PChecker/CheckerCore/Actors/ActorId.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,4 @@ public override int GetHashCode()
155155

156156
int IComparable<ActorId>.CompareTo(ActorId other) => string.Compare(Name, other?.Name);
157157
}
158-
}
158+
}

Src/PChecker/CheckerCore/Actors/ActorRuntime.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,4 +726,4 @@ protected override void Dispose(bool disposing)
726726
base.Dispose(disposing);
727727
}
728728
}
729-
}
729+
}

Src/PChecker/CheckerCore/Actors/EventQueues/DequeueStatus.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ internal enum DequeueStatus
2828
/// </summary>
2929
NotAvailable
3030
}
31-
}
31+
}

Src/PChecker/CheckerCore/Actors/EventQueues/EnqueueStatus.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ internal enum EnqueueStatus
3333
/// </summary>
3434
Dropped
3535
}
36-
}
36+
}

Src/PChecker/CheckerCore/Actors/EventQueues/EventQueue.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,4 @@ public void Dispose()
292292
GC.SuppressFinalize(this);
293293
}
294294
}
295-
}
295+
}

Src/PChecker/CheckerCore/Actors/EventQueues/IEventQueue.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ internal interface IEventQueue : IDisposable
6262
/// </summary>
6363
void Close();
6464
}
65-
}
65+
}

Src/PChecker/CheckerCore/Actors/EventQueues/Mocks/MockEventQueue.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,4 @@ public void Dispose()
346346
GC.SuppressFinalize(this);
347347
}
348348
}
349-
}
349+
}

Src/PChecker/CheckerCore/Actors/Events/DefaultEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ private DefaultEvent()
2525
{
2626
}
2727
}
28-
}
28+
}

Src/PChecker/CheckerCore/Actors/Events/Event.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ namespace PChecker.Actors.Events
1212
public abstract class Event
1313
{
1414
}
15-
}
15+
}

Src/PChecker/CheckerCore/Actors/Events/EventInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ internal EventInfo(Event e, EventOriginInfo originInfo)
6060
OriginInfo = originInfo;
6161
}
6262
}
63-
}
63+
}

Src/PChecker/CheckerCore/Actors/Events/EventOriginInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ internal EventOriginInfo(ActorId senderActorId, string senderMachineName, string
3939
SenderStateName = senderStateName;
4040
}
4141
}
42-
}
42+
}

Src/PChecker/CheckerCore/Actors/Events/GotoStateEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public GotoStateEvent(Type s)
2727
State = s;
2828
}
2929
}
30-
}
30+
}

Src/PChecker/CheckerCore/Actors/Events/HaltEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ private HaltEvent()
2424
{
2525
}
2626
}
27-
}
27+
}

Src/PChecker/CheckerCore/Actors/Events/QuiescentEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ public QuiescentEvent(ActorId id)
2525
ActorId = id;
2626
}
2727
}
28-
}
28+
}

Src/PChecker/CheckerCore/Actors/Events/WildcardEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ public WildCardEvent()
1919
{
2020
}
2121
}
22-
}
22+
}

Src/PChecker/CheckerCore/Actors/Exceptions/ActionExceptionFilterException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ internal ActionExceptionFilterException(string message, Exception innerException
3030
{
3131
}
3232
}
33-
}
33+
}

Src/PChecker/CheckerCore/Actors/Exceptions/OnEventDroppedHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ namespace PChecker.Actors.Exceptions
99
/// Handles the <see cref="IActorRuntime.OnEventDropped"/> event.
1010
/// </summary>
1111
public delegate void OnEventDroppedHandler(Event e, ActorId target);
12-
}
12+
}

Src/PChecker/CheckerCore/Actors/Exceptions/OnExceptionOutcome.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ public enum OnExceptionOutcome
2323
/// </summary>
2424
Halt = 2
2525
}
26-
}
26+
}

Src/PChecker/CheckerCore/Actors/Exceptions/UnhandledEventException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ internal UnhandledEventException(Event unhandledEvent, string currentStateName,
3636
UnhandledEvent = unhandledEvent;
3737
}
3838
}
39-
}
39+
}

Src/PChecker/CheckerCore/Actors/Handlers/ActionEventHandlerDeclaration.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ public ActionEventHandlerDeclaration(string actionName)
2323

2424
internal override bool Inheritable => true;
2525
}
26-
}
26+
}

0 commit comments

Comments
 (0)