From 32eb9179c860ec0a27a4dc9ae4b932f741eafb86 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Tue, 27 Sep 2022 17:40:31 +0900 Subject: [PATCH 01/54] Added HMAC authentication between RTI and federates, using federation ID as MAC key --- org.lflang/src/lib/c/reactor-c | 2 +- .../src/org/lflang/generator/c/CCmakeGenerator.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 948efef6eb..ae31ef0caf 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 948efef6eb484a74ad6a776e8d89f4919440505a +Subproject commit ae31ef0cafb8182cdfe5585e359fcfd52fa86652 diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index e1eb841fb4..7b836501fe 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -151,6 +151,14 @@ CodeBuilder generateCMakeCode( cMakeCode.pr(")"); cMakeCode.newLine(); + if(true) { + // OpenSSL + cMakeCode.pr("# Find OpenSSL and link to it"); + cMakeCode.pr("find_package(OpenSSL REQUIRED)"); + cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} OpenSSL::SSL)"); + cMakeCode.newLine(); + } + if (targetConfig.threading || targetConfig.tracing != null) { // If threaded computation is requested, add the threads option. cMakeCode.pr("# Find threads and link to it"); From 68085e904b9084559f752283b260addd6be3191e Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 5 Oct 2022 15:54:03 +0900 Subject: [PATCH 02/54] Target Config for auth is set false. auth option is useable for target C. --- org.lflang/src/org/lflang/TargetConfig.java | 5 +++++ org.lflang/src/org/lflang/TargetProperty.java | 9 +++++++++ .../src/org/lflang/generator/c/CCmakeGenerator.java | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/TargetConfig.java b/org.lflang/src/org/lflang/TargetConfig.java index 9af1593a22..9e16754fe6 100644 --- a/org.lflang/src/org/lflang/TargetConfig.java +++ b/org.lflang/src/org/lflang/TargetConfig.java @@ -235,6 +235,11 @@ public class TargetConfig { */ public int workers = 0; + /** + * Indicate whether HMAC authentication is used. + */ + public boolean auth = false; + /** * Indicate whether the runtime should use multithreaded execution. */ diff --git a/org.lflang/src/org/lflang/TargetProperty.java b/org.lflang/src/org/lflang/TargetProperty.java index 05a1801900..0af8988b82 100644 --- a/org.lflang/src/org/lflang/TargetProperty.java +++ b/org.lflang/src/org/lflang/TargetProperty.java @@ -57,6 +57,15 @@ */ public enum TargetProperty { + /** + * Directive to specify the execution timeout. + */ + AUTH("auth", PrimitiveType.BOOLEAN, + List.of(Target.C), + (config, value, err) -> { + config.auth = ASTUtils.toBoolean(value); + }), + /** * Directive to specify the baud-rate used by the runtime for embedded systems (Arduino). */ diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 7b836501fe..7a14efe5be 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -151,7 +151,7 @@ CodeBuilder generateCMakeCode( cMakeCode.pr(")"); cMakeCode.newLine(); - if(true) { + if(targetConfig.auth) { // OpenSSL cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); From 750ea8b5d2f5c6d72b38003003b1a3b34906cd03 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 5 Oct 2022 15:54:30 +0900 Subject: [PATCH 03/54] Added SimpleFederatedAuth.lf for test of auth option --- test/C/src/federated/SimpleFederatedAuth.lf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/C/src/federated/SimpleFederatedAuth.lf diff --git a/test/C/src/federated/SimpleFederatedAuth.lf b/test/C/src/federated/SimpleFederatedAuth.lf new file mode 100644 index 0000000000..c54d68e096 --- /dev/null +++ b/test/C/src/federated/SimpleFederatedAuth.lf @@ -0,0 +1,18 @@ +target C { + timeout: 2 secs, + build-type: RelWithDebInfo, + auth: true +} + +reactor Fed { + input in: int + output out: int +} + +federated reactor { + fed1 = new Fed() + fed2 = new Fed() + + fed1.out -> fed2.in + fed2.out -> fed1.in +} From 573ad15241d030b48afab30c18534b65bacf045d Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 5 Oct 2022 17:34:26 +0900 Subject: [PATCH 04/54] Added generating -a option to RTI --- org.lflang/src/lib/c/reactor-c | 2 +- org.lflang/src/org/lflang/federated/launcher/FedLauncher.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index ae31ef0caf..9cdc725716 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit ae31ef0cafb8182cdfe5585e359fcfd52fa86652 +Subproject commit 9cdc72571600a56d119c4e78630bc63f0665ab45 diff --git a/org.lflang/src/org/lflang/federated/launcher/FedLauncher.java b/org.lflang/src/org/lflang/federated/launcher/FedLauncher.java index 779520e1ec..09d205191e 100644 --- a/org.lflang/src/org/lflang/federated/launcher/FedLauncher.java +++ b/org.lflang/src/org/lflang/federated/launcher/FedLauncher.java @@ -322,6 +322,9 @@ private String getRtiCommand(List federates, boolean isRemote) } else { commands.add("RTI -i ${FEDERATION_ID} \\"); } + if (targetConfig.auth) { + commands.add(" -a \\"); + } commands.addAll(List.of( " -n "+federates.size()+" \\", " -c "+targetConfig.clockSync.toString()+" \\" From e46d858b78b61531a6b0e093cad20a7998acab5b Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 6 Oct 2022 17:26:49 +0900 Subject: [PATCH 05/54] Added FEDERATED_AUTH when targetConfig.auth is true --- org.lflang/src/org/lflang/generator/c/CGenerator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.lflang/src/org/lflang/generator/c/CGenerator.java b/org.lflang/src/org/lflang/generator/c/CGenerator.java index 22f39bf0e4..f4c80cbbe9 100644 --- a/org.lflang/src/org/lflang/generator/c/CGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CGenerator.java @@ -417,6 +417,9 @@ public void setCSpecificDefaults() { if (isFederated) { // Add compile definitions for federated execution targetConfig.compileDefinitions.put("FEDERATED", ""); + if(targetConfig.auth) { + targetConfig.compileDefinitions.put("FEDERATED_AUTH", ""); + } if (targetConfig.coordination == CoordinationType.CENTRALIZED) { // The coordination is centralized. targetConfig.compileDefinitions.put("FEDERATED_CENTRALIZED", ""); From cb958c004ed1ba2aa10b8cdc4740e7b0336b7679 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 6 Oct 2022 20:29:27 +0900 Subject: [PATCH 06/54] updated submodule --- org.lflang/src/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 9cdc725716..8f9792aa4a 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 9cdc72571600a56d119c4e78630bc63f0665ab45 +Subproject commit 8f9792aa4a4ffee8f8c3b6daaf7b89719d5c8397 From bd058c508b3c8482b0c8ba9406688696174ea353 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 6 Oct 2022 20:44:43 +0900 Subject: [PATCH 07/54] Fixed comments for target property AUTH --- org.lflang/src/org/lflang/TargetProperty.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/TargetProperty.java b/org.lflang/src/org/lflang/TargetProperty.java index 0af8988b82..585f9757aa 100644 --- a/org.lflang/src/org/lflang/TargetProperty.java +++ b/org.lflang/src/org/lflang/TargetProperty.java @@ -58,7 +58,7 @@ public enum TargetProperty { /** - * Directive to specify the execution timeout. + * Directive to allow including OpenSSL libraries and process HMAC authentication. */ AUTH("auth", PrimitiveType.BOOLEAN, List.of(Target.C), From 152b9d2c80c6d5150b33260b87b851f133d697a3 Mon Sep 17 00:00:00 2001 From: Hokeun Kim Date: Fri, 7 Oct 2022 12:31:11 -0700 Subject: [PATCH 08/54] Make definition for federate authentication more readable. --- org.lflang/src/org/lflang/generator/c/CGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/generator/c/CGenerator.java b/org.lflang/src/org/lflang/generator/c/CGenerator.java index f4c80cbbe9..0a48fcdf05 100644 --- a/org.lflang/src/org/lflang/generator/c/CGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CGenerator.java @@ -418,7 +418,8 @@ public void setCSpecificDefaults() { // Add compile definitions for federated execution targetConfig.compileDefinitions.put("FEDERATED", ""); if(targetConfig.auth) { - targetConfig.compileDefinitions.put("FEDERATED_AUTH", ""); + // The federates are authenticated before joining federation. + targetConfig.compileDefinitions.put("FEDERATED_AUTHENTICATED", ""); } if (targetConfig.coordination == CoordinationType.CENTRALIZED) { // The coordination is centralized. From feaa943eee515ac6016f4b8975fe02f372cb6f08 Mon Sep 17 00:00:00 2001 From: Hokeun Kim Date: Fri, 7 Oct 2022 17:24:16 -0700 Subject: [PATCH 09/54] Rename the authentication test to make it more descriptive. Add DEBUG logging. --- .../{SimpleFederatedAuth.lf => SimpleFederatedAuthenticated.lf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/C/src/federated/{SimpleFederatedAuth.lf => SimpleFederatedAuthenticated.lf} (100%) diff --git a/test/C/src/federated/SimpleFederatedAuth.lf b/test/C/src/federated/SimpleFederatedAuthenticated.lf similarity index 100% rename from test/C/src/federated/SimpleFederatedAuth.lf rename to test/C/src/federated/SimpleFederatedAuthenticated.lf From d9d1aec6ab1894895fde3def513c6d7ae0204504 Mon Sep 17 00:00:00 2001 From: Hokeun Kim Date: Fri, 7 Oct 2022 17:24:35 -0700 Subject: [PATCH 10/54] Update reactor-c submodule. --- org.lflang/src/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 8f9792aa4a..e4853d7cc1 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 8f9792aa4a4ffee8f8c3b6daaf7b89719d5c8397 +Subproject commit e4853d7cc1e9a5fbe35968daaf8d5e12aa134032 From 8433132055a614d2ad7df92fff2f41caabc80c8f Mon Sep 17 00:00:00 2001 From: Hokeun Kim Date: Thu, 20 Oct 2022 06:52:36 +0900 Subject: [PATCH 11/54] Add comments and DEBUG logging to SimpleFederatedAuthenticated.lf. --- test/C/src/federated/SimpleFederatedAuthenticated.lf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/C/src/federated/SimpleFederatedAuthenticated.lf b/test/C/src/federated/SimpleFederatedAuthenticated.lf index c54d68e096..b4580a7f84 100644 --- a/test/C/src/federated/SimpleFederatedAuthenticated.lf +++ b/test/C/src/federated/SimpleFederatedAuthenticated.lf @@ -1,7 +1,12 @@ +/** + * This simple test checks if federate authentication works + * by adding `auth` target property. + */ target C { timeout: 2 secs, build-type: RelWithDebInfo, - auth: true + auth: true, + logging: DEBUG } reactor Fed { From fce688431b5ea8111bd672d67216eccca888a8f1 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sun, 30 Oct 2022 14:45:11 +0900 Subject: [PATCH 12/54] Added comments --- org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 8421a0809f..1ee1b9fc1c 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -173,7 +173,7 @@ CodeBuilder generateCMakeCode( cMakeCode.pr("target_include_directories(${LF_MAIN_TARGET} PUBLIC include/core/utils)"); if(targetConfig.auth) { - // OpenSSL + // If security is requested, add the auth option. cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} OpenSSL::SSL)"); From f99e61c5c61d55c890ef883202b482da2e4a5ea5 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 31 Oct 2022 18:11:13 +0900 Subject: [PATCH 13/54] Add fixmes to update auth option type from boolean to string. --- org.lflang/src/lib/c/reactor-c | 2 +- org.lflang/src/org/lflang/TargetProperty.java | 1 + test/C/src/federated/SimpleFederatedAuthenticated.lf | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 2a3e39f56a..4f17f2020c 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 2a3e39f56a3ac949b416f009a0a65ffdbe2f74c6 +Subproject commit 4f17f2020cdb1ee7ba9f8ee52371a6b9eeb9bf2b diff --git a/org.lflang/src/org/lflang/TargetProperty.java b/org.lflang/src/org/lflang/TargetProperty.java index fb4943b8b0..63993966f9 100644 --- a/org.lflang/src/org/lflang/TargetProperty.java +++ b/org.lflang/src/org/lflang/TargetProperty.java @@ -60,6 +60,7 @@ public enum TargetProperty { /** * Directive to allow including OpenSSL libraries and process HMAC authentication. + * FIXME: The option will be updated from boolean to string for support of various options. */ AUTH("auth", PrimitiveType.BOOLEAN, List.of(Target.C), diff --git a/test/C/src/federated/SimpleFederatedAuthenticated.lf b/test/C/src/federated/SimpleFederatedAuthenticated.lf index b4580a7f84..c086933b2d 100644 --- a/test/C/src/federated/SimpleFederatedAuthenticated.lf +++ b/test/C/src/federated/SimpleFederatedAuthenticated.lf @@ -5,7 +5,7 @@ target C { timeout: 2 secs, build-type: RelWithDebInfo, - auth: true, + auth: true, //FIXME: This will be updated to string such as HMAC. logging: DEBUG } From 494812cb13225379baca6b1740c7c9ff8e752d43 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sun, 13 Nov 2022 16:10:29 +0900 Subject: [PATCH 14/54] Add PRIVATE keyword to openssl code generator. --- org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index efd3f91b28..ba84aa0c6b 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -193,7 +193,7 @@ CodeBuilder generateCMakeCode( // If security is requested, add the auth option. cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); - cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} OpenSSL::SSL)"); + cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); cMakeCode.newLine(); } From c7511b961921f4535dd736906fedda49b4af25c8 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 14 Nov 2022 15:17:10 +0900 Subject: [PATCH 15/54] Updated reactor-c version --- org.lflang/src/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 4f17f2020c..ea507c2b01 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 4f17f2020cdb1ee7ba9f8ee52371a6b9eeb9bf2b +Subproject commit ea507c2b012a48fef327965ac6f2fc0b0843acac From 536308940a9794deae41f3e9797bbca65afed125 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 18:42:59 +0900 Subject: [PATCH 16/54] Add -DAUTH=ON for tests --- .github/actions/install-rti/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index 6b522c3453..fb467aa6a5 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -2,6 +2,6 @@ cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build cd build -cmake ../ +cmake -DAUTH=ON ../ make sudo make install From 8c1f4033b3575eb190f36518fd6c8faeafc9f460 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 18:52:25 +0900 Subject: [PATCH 17/54] Update reactor-c version --- org.lflang/src/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index ea507c2b01..4cea1357e5 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit ea507c2b012a48fef327965ac6f2fc0b0843acac +Subproject commit 4cea1357e581d871fd59fed11764a7ea922c6be5 From d50dc23d58da0189f4bfc2c0327dbb974ade4d94 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 19:06:05 +0900 Subject: [PATCH 18/54] Update reactor-c version --- org.lflang/src/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 4cea1357e5..8ed5649c10 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 4cea1357e581d871fd59fed11764a7ea922c6be5 +Subproject commit 8ed5649c10e234bccdba82a97e56be6ca1a241b6 From 308554e3f5c521a14d6bfc577d10ec180059aa6a Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 19:14:08 +0900 Subject: [PATCH 19/54] Add mac os dependency openssl --- .github/workflows/c-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index b4485fe459..9117b2ae2f 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -43,6 +43,7 @@ jobs: - name: Install dependencies OS X run: | brew install coreutils + brew install openssl if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From eb5da4be77d59bf08b8030a75b48bb9e3595a749 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 19:29:06 +0900 Subject: [PATCH 20/54] Formatting SimpleFederatedAuthenticated.lf --- test/C/src/federated/SimpleFederatedAuthenticated.lf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/C/src/federated/SimpleFederatedAuthenticated.lf b/test/C/src/federated/SimpleFederatedAuthenticated.lf index c086933b2d..145eea9bf5 100644 --- a/test/C/src/federated/SimpleFederatedAuthenticated.lf +++ b/test/C/src/federated/SimpleFederatedAuthenticated.lf @@ -1,6 +1,6 @@ /** - * This simple test checks if federate authentication works - * by adding `auth` target property. + * This simple test checks if federate authentication works by adding `auth` + * target property. */ target C { timeout: 2 secs, From 7177e4e7c406ccbac24a3ecfc5a5e51e3c703213 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 19:43:41 +0900 Subject: [PATCH 21/54] Added cmake mac options --- .github/actions/install-rti/install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index fb467aa6a5..eb7eb03c3e 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -2,6 +2,9 @@ cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build cd build -cmake -DAUTH=ON ../ +if [[ "$OSTYPE" == "darwin"* ]]; then + cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ +else + cmake -DAUTH=ON ../ make sudo make install From ae37da5aac6ce737ee9ca88d8c647ddc0be58f24 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 19:45:26 +0900 Subject: [PATCH 22/54] Minor revisions --- .github/actions/install-rti/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index eb7eb03c3e..cfa95da56b 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -6,5 +6,6 @@ if [[ "$OSTYPE" == "darwin"* ]]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ else cmake -DAUTH=ON ../ +fi make sudo make install From c95a2588d50c5e37c67455b788c75973a33cf665 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Wed, 16 Nov 2022 21:33:24 +0900 Subject: [PATCH 23/54] Test CI Tests --- .github/actions/install-rti/install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index cfa95da56b..a9a0b3ae1e 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -2,10 +2,13 @@ cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build cd build +echo "TEST1" if [[ "$OSTYPE" == "darwin"* ]]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ + echo "TEST2" else cmake -DAUTH=ON ../ + echo "TEST3" fi make sudo make install From d889a47672904a0e08085ca515678778ec63a0e9 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 17 Nov 2022 14:23:50 +0900 Subject: [PATCH 24/54] Add openssl mac links --- .github/actions/install-rti/install.sh | 5 ++++- .github/workflows/c-tests.yml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index a9a0b3ae1e..b8693c4648 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -4,7 +4,7 @@ mkdir build cd build echo "TEST1" if [[ "$OSTYPE" == "darwin"* ]]; then - cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ + cmake -DAUTH=ON ../ echo "TEST2" else cmake -DAUTH=ON ../ @@ -12,3 +12,6 @@ else fi make sudo make install + + +# -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \ No newline at end of file diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 9117b2ae2f..60bcf18b90 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -44,6 +44,7 @@ jobs: run: | brew install coreutils brew install openssl + brew link openssl --force if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From fefcc122f121ceaa15c60f0f745fcdb98eb18663 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 17 Nov 2022 14:36:56 +0900 Subject: [PATCH 25/54] changed test branch temporarily --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f339b9aa9e..f0b773a92e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,12 +54,12 @@ jobs: # Run the C integration tests. c-tests: - uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master + uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth needs: cancel # Run the CCpp integration tests. ccpp-tests: - uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master + uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth with: use-cpp: true needs: cancel From 085dd9e125d205a4848440278625a81eebc33594 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Thu, 17 Nov 2022 15:12:08 +0900 Subject: [PATCH 26/54] Formatted SimpleFederatedAuthenticated.lf --- test/C/src/federated/SimpleFederatedAuthenticated.lf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/C/src/federated/SimpleFederatedAuthenticated.lf b/test/C/src/federated/SimpleFederatedAuthenticated.lf index 145eea9bf5..e2dffcebe9 100644 --- a/test/C/src/federated/SimpleFederatedAuthenticated.lf +++ b/test/C/src/federated/SimpleFederatedAuthenticated.lf @@ -5,7 +5,7 @@ target C { timeout: 2 secs, build-type: RelWithDebInfo, - auth: true, //FIXME: This will be updated to string such as HMAC. + auth: true, // FIXME: This will be updated to string such as HMAC. logging: DEBUG } From cf127095465931d4f6ea1a2e89b52fb9c5bbd269 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Fri, 18 Nov 2022 16:27:26 +0900 Subject: [PATCH 27/54] add path to mac dependencies --- .github/workflows/c-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 60bcf18b90..b0ad326fcf 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -45,6 +45,8 @@ jobs: brew install coreutils brew install openssl brew link openssl --force + openssl version + export PATH="/usr/local/opt/openssl/bin:$PATH" if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From 2741cfd98faf92dc8b98e92cb36a8e3e1dd27512 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Fri, 18 Nov 2022 16:33:51 +0900 Subject: [PATCH 28/54] Addmore to mac dependencies --- .github/actions/install-rti/install.sh | 5 +---- .github/workflows/c-tests.yml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index b8693c4648..a9a0b3ae1e 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -4,7 +4,7 @@ mkdir build cd build echo "TEST1" if [[ "$OSTYPE" == "darwin"* ]]; then - cmake -DAUTH=ON ../ + cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ echo "TEST2" else cmake -DAUTH=ON ../ @@ -12,6 +12,3 @@ else fi make sudo make install - - -# -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \ No newline at end of file diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index b0ad326fcf..d379ac7f4c 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -47,6 +47,7 @@ jobs: brew link openssl --force openssl version export PATH="/usr/local/opt/openssl/bin:$PATH" + openssl version if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From 02388623675e164da724b58f166d00e1262feb52 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Fri, 18 Nov 2022 18:02:40 +0900 Subject: [PATCH 29/54] Added mac os options in cmake generator --- .github/actions/install-rti/install.sh | 3 --- .github/workflows/c-tests.yml | 2 -- .../src/org/lflang/generator/c/CCmakeGenerator.java | 8 ++++++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index a9a0b3ae1e..cfa95da56b 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -2,13 +2,10 @@ cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build cd build -echo "TEST1" if [[ "$OSTYPE" == "darwin"* ]]; then cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ - echo "TEST2" else cmake -DAUTH=ON ../ - echo "TEST3" fi make sudo make install diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index d379ac7f4c..e4ffcc3e31 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -45,9 +45,7 @@ jobs: brew install coreutils brew install openssl brew link openssl --force - openssl version export PATH="/usr/local/opt/openssl/bin:$PATH" - openssl version if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index ba84aa0c6b..634cc8634b 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -194,6 +194,14 @@ CodeBuilder generateCMakeCode( cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); + var osName = System.getProperty("os.name").toLowerCase(); + // if platform target was set, use given platform instead + if (targetConfig.platformOptions.platform != Platform.AUTO) { + osName = targetConfig.platformOptions.platform.toString(); + } + if (osName.contains("mac")) { + cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); + } cMakeCode.newLine(); } From f35c0c32ff9064e64dd1cb0eda0b73832a7b5963 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sat, 19 Nov 2022 16:22:55 +0900 Subject: [PATCH 30/54] Test Mac environment --- org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 634cc8634b..2e1ee1776a 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -192,15 +192,21 @@ CodeBuilder generateCMakeCode( if(targetConfig.auth) { // If security is requested, add the auth option. cMakeCode.pr("# Find OpenSSL and link to it"); + cMakeCode.pr("message ("111111111111111111111111111111111111111")";) cMakeCode.pr("find_package(OpenSSL REQUIRED)"); + cMakeCode.pr("message ("2222222222222222222222222222222222222222")";) cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); + cMakeCode.pr("message ("3333333333333333333333333333333333333333")";) var osName = System.getProperty("os.name").toLowerCase(); + cMakeCode.pr("message ("4444444444444444444444444444444444444444")";) // if platform target was set, use given platform instead if (targetConfig.platformOptions.platform != Platform.AUTO) { osName = targetConfig.platformOptions.platform.toString(); + cMakeCode.pr("message ("555555555555555555555555555555555555555")";) } if (osName.contains("mac")) { cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); + cMakeCode.pr("message ("6666666666666666666666666666666666666666666")";) } cMakeCode.newLine(); } From a998c899b09e2c593f658825fe153448f86be788 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sat, 19 Nov 2022 16:36:36 +0900 Subject: [PATCH 31/54] Fix bugs --- .../src/org/lflang/generator/c/CCmakeGenerator.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 2e1ee1776a..acda6f6767 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -192,21 +192,21 @@ CodeBuilder generateCMakeCode( if(targetConfig.auth) { // If security is requested, add the auth option. cMakeCode.pr("# Find OpenSSL and link to it"); - cMakeCode.pr("message ("111111111111111111111111111111111111111")";) + cMakeCode.pr("message ("111111111111111111111111111111111111111")"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); - cMakeCode.pr("message ("2222222222222222222222222222222222222222")";) + cMakeCode.pr("message ("2222222222222222222222222222222222222222")"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); - cMakeCode.pr("message ("3333333333333333333333333333333333333333")";) + cMakeCode.pr("message ("3333333333333333333333333333333333333333")"); var osName = System.getProperty("os.name").toLowerCase(); - cMakeCode.pr("message ("4444444444444444444444444444444444444444")";) + cMakeCode.pr("message ("4444444444444444444444444444444444444444")"); // if platform target was set, use given platform instead if (targetConfig.platformOptions.platform != Platform.AUTO) { osName = targetConfig.platformOptions.platform.toString(); - cMakeCode.pr("message ("555555555555555555555555555555555555555")";) + cMakeCode.pr("message ("555555555555555555555555555555555555555")"); } if (osName.contains("mac")) { cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); - cMakeCode.pr("message ("6666666666666666666666666666666666666666666")";) + cMakeCode.pr("message ("6666666666666666666666666666666666666666666")"); } cMakeCode.newLine(); } From 056818044881244994c2c6d8f158b1207e73c859 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sat, 19 Nov 2022 16:47:08 +0900 Subject: [PATCH 32/54] Buf fix --- .../src/org/lflang/generator/c/CCmakeGenerator.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index acda6f6767..0924ac192e 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -192,21 +192,21 @@ CodeBuilder generateCMakeCode( if(targetConfig.auth) { // If security is requested, add the auth option. cMakeCode.pr("# Find OpenSSL and link to it"); - cMakeCode.pr("message ("111111111111111111111111111111111111111")"); + cMakeCode.pr("message(\"111111111111111111111111111111111111111111\")"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); - cMakeCode.pr("message ("2222222222222222222222222222222222222222")"); + cMakeCode.pr("message(\"2222222222222222222222222222222222222222\")"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); - cMakeCode.pr("message ("3333333333333333333333333333333333333333")"); + cMakeCode.pr("message(\"3333333333333333333333333333333333333333\")"); var osName = System.getProperty("os.name").toLowerCase(); - cMakeCode.pr("message ("4444444444444444444444444444444444444444")"); + cMakeCode.pr("message(\"4444444444444444444444444444444444444444\")"); // if platform target was set, use given platform instead if (targetConfig.platformOptions.platform != Platform.AUTO) { osName = targetConfig.platformOptions.platform.toString(); - cMakeCode.pr("message ("555555555555555555555555555555555555555")"); + cMakeCode.pr("message(\"555555555555555555555555555555555555555\")"); } if (osName.contains("mac")) { cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); - cMakeCode.pr("message ("6666666666666666666666666666666666666666666")"); + cMakeCode.pr("message(\"6666666666666666666666666666666666666666666\")"); } cMakeCode.newLine(); } From 4e7c9728e7c226477dbf0fc077f8bfcdc4aece85 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sat, 19 Nov 2022 17:39:58 +0900 Subject: [PATCH 33/54] Add exports --- .github/workflows/c-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index e4ffcc3e31..a87cb21d36 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -46,6 +46,8 @@ jobs: brew install openssl brew link openssl --force export PATH="/usr/local/opt/openssl/bin:$PATH" + export LDFLAGS="-L/usr/local/opt/openssl@3/lib" + export CPPFLAGS="-I/usr/local/opt/openssl@3/include" if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From 26ac623393e801e0c627cd7356f05dab4ebecb3c Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Sun, 20 Nov 2022 17:50:48 +0900 Subject: [PATCH 34/54] Added CCPP target properties --- org.lflang/src/org/lflang/TargetProperty.java | 3 +-- org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/org.lflang/src/org/lflang/TargetProperty.java b/org.lflang/src/org/lflang/TargetProperty.java index d292a93e6b..0425d75a54 100644 --- a/org.lflang/src/org/lflang/TargetProperty.java +++ b/org.lflang/src/org/lflang/TargetProperty.java @@ -63,8 +63,7 @@ public enum TargetProperty { * FIXME: The option will be updated from boolean to string for support of various options. */ AUTH("auth", PrimitiveType.BOOLEAN, - List.of(Target.C), - (config, value, err) -> { + Arrays.asList(Target.C, Target.CCPP), (config, value, err) -> { config.auth = ASTUtils.toBoolean(value); }), diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 0924ac192e..0d37cf4d4c 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -198,14 +198,20 @@ CodeBuilder generateCMakeCode( cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); cMakeCode.pr("message(\"3333333333333333333333333333333333333333\")"); var osName = System.getProperty("os.name").toLowerCase(); + System.out.println(osName); + System.out.println("java1111"); cMakeCode.pr("message(\"4444444444444444444444444444444444444444\")"); // if platform target was set, use given platform instead if (targetConfig.platformOptions.platform != Platform.AUTO) { osName = targetConfig.platformOptions.platform.toString(); + System.out.println(osName); + System.out.println("java2222"); cMakeCode.pr("message(\"555555555555555555555555555555555555555\")"); } if (osName.contains("mac")) { + System.out.println("java3333"); cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); + cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib)"); cMakeCode.pr("message(\"6666666666666666666666666666666666666666666\")"); } cMakeCode.newLine(); From b5f76024b35577af9c1d2b002ebb2fb3c1338bb0 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 14:50:25 +0900 Subject: [PATCH 35/54] Test shorter tests --- .github/workflows/c-tests.yml | 3 +- .github/workflows/ci.yml | 138 +++++++++++++++++----------------- 2 files changed, 71 insertions(+), 70 deletions(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index a87cb21d36..9a39c742f5 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -22,6 +22,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] + platform: [macos-latest] runs-on: ${{ matrix.platform }} steps: - name: Check out lingua-franca repository @@ -75,7 +76,7 @@ jobs: echo "Specified scheduler: ${{ inputs.scheduler }}" ./gradlew test --tests org.lflang.tests.runtime.CSchedulerTest.* -Dscheduler=${{ inputs.scheduler }} if: ${{ !inputs.use-cpp && inputs.scheduler }} - - name: Perform tests for CCpp target with default scheduler + - name: Perform tests for CCpp target with default -scheduler run: | ./gradlew test --tests org.lflang.tests.runtime.CCppTest.* if: ${{ inputs.use-cpp && !inputs.scheduler }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0b773a92e..61503eb488 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,32 +25,32 @@ jobs: uses: lf-lang/lingua-franca/.github/workflows/build.yml@master needs: cancel - # Run the unit tests. - unit-tests: - uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master - needs: cancel - - # Run tests for the standalone compiler. - cli-tests: - uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master - needs: cancel - - # Run the C benchmark tests. - c-benchmark-tests: - uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - with: - target: 'C' - needs: cancel - - # Run tests for Eclipse. - eclipse-tests: - uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master - needs: cancel - - # Run language server tests. - lsp-tests: - uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master - needs: cancel + # # Run the unit tests. + # unit-tests: + # uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master + # needs: cancel + + # # Run tests for the standalone compiler. + # cli-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master + # needs: cancel + + # # Run the C benchmark tests. + # c-benchmark-tests: + # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + # with: + # target: 'C' + # needs: cancel + + # # Run tests for Eclipse. + # eclipse-tests: + # uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master + # needs: cancel + + # # Run language server tests. + # lsp-tests: + # uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master + # needs: cancel # Run the C integration tests. c-tests: @@ -64,46 +64,46 @@ jobs: use-cpp: true needs: cancel - # Run the C++ benchmark tests. - cpp-benchmark-tests: - uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - with: - target: 'Cpp' - needs: cancel - - # Run the C++ integration tests. - cpp-tests: - uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master - needs: cancel - - # Run the C++ integration tests on ROS2. - cpp-ros2-tests: - uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master - needs: cancel - - # Run the Python integration tests. - py-tests: - uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master - needs: cancel - - # Run the Rust integration tests. - rs-tests: - uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master - needs: cancel - - # Run the Rust benchmark tests. - rs-benchmark-tests: - uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - with: - target: 'Rust' - needs: cancel - - # Run the TypeScript integration tests. - ts-tests: - uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master - needs: cancel - - # Run the serialization tests - serialization-tests: - uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master - needs: cancel + # # Run the C++ benchmark tests. + # cpp-benchmark-tests: + # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + # with: + # target: 'Cpp' + # needs: cancel + + # # Run the C++ integration tests. + # cpp-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master + # needs: cancel + + # # Run the C++ integration tests on ROS2. + # cpp-ros2-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master + # needs: cancel + + # # Run the Python integration tests. + # py-tests: + # uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master + # needs: cancel + + # # Run the Rust integration tests. + # rs-tests: + # uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master + # needs: cancel + + # # Run the Rust benchmark tests. + # rs-benchmark-tests: + # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + # with: + # target: 'Rust' + # needs: cancel + + # # Run the TypeScript integration tests. + # ts-tests: + # uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master + # needs: cancel + + # # Run the serialization tests + # serialization-tests: + # uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master + # needs: cancel From dbb2970d7d3b155c5f364c44bd1bc0915945b3f3 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 14:52:14 +0900 Subject: [PATCH 36/54] Bug fix --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61503eb488..e86b0753ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,15 +25,15 @@ jobs: uses: lf-lang/lingua-franca/.github/workflows/build.yml@master needs: cancel - # # Run the unit tests. - # unit-tests: - # uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master - # needs: cancel + # Run the unit tests. + unit-tests: + uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master + needs: cancel - # # Run tests for the standalone compiler. - # cli-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master - # needs: cancel + # Run tests for the standalone compiler. + cli-tests: + uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master + needs: cancel # # Run the C benchmark tests. # c-benchmark-tests: From ef7f66f0c7e75ca68bf9170bc173387950e536c5 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 14:54:18 +0900 Subject: [PATCH 37/54] Bug fix --- .github/workflows/c-tests.yml | 2 +- .github/workflows/ci.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 9a39c742f5..470c2dcd54 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -21,7 +21,7 @@ jobs: run: strategy: matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] + # platform: [ubuntu-latest, macos-latest, windows-latest] platform: [macos-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e86b0753ba..61503eb488 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,15 +25,15 @@ jobs: uses: lf-lang/lingua-franca/.github/workflows/build.yml@master needs: cancel - # Run the unit tests. - unit-tests: - uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master - needs: cancel + # # Run the unit tests. + # unit-tests: + # uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master + # needs: cancel - # Run tests for the standalone compiler. - cli-tests: - uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master - needs: cancel + # # Run tests for the standalone compiler. + # cli-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master + # needs: cancel # # Run the C benchmark tests. # c-benchmark-tests: From c8674b1f1cb7c02df15fc798d16654c1460d33b2 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 15:02:34 +0900 Subject: [PATCH 38/54] Test added --- .github/workflows/c-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 470c2dcd54..26ce60d174 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -67,6 +67,10 @@ jobs: - name: Build RTI docker image uses: ./.github/actions/build-rti-docker if: ${{ runner.os == 'Linux' }} + - name: Temporary Test + run: | + ./gradlew runlfc --args test/C/src/federated/SimpleFederatedAuthenticated.lf + if: ${{ !inputs.use-cpp && !inputs.scheduler }} - name: Perform tests for C target with default scheduler run: | ./gradlew test --tests org.lflang.tests.runtime.CTest.* From 81edc547f7ce952fb7f48fb5b6ff3afbe14bb031 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 15:10:44 +0900 Subject: [PATCH 39/54] FIx bugs --- .github/workflows/c-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 26ce60d174..2c16459032 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -69,7 +69,7 @@ jobs: if: ${{ runner.os == 'Linux' }} - name: Temporary Test run: | - ./gradlew runlfc --args test/C/src/federated/SimpleFederatedAuthenticated.lf + ./gradlew runlfc -d --args test/C/src/federated/SimpleFederatedAuthenticated.lf if: ${{ !inputs.use-cpp && !inputs.scheduler }} - name: Perform tests for C target with default scheduler run: | From 8248a60887d6305fede7771ad1454cdf50f2a755 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 15:17:36 +0900 Subject: [PATCH 40/54] FIX bugs --- .github/workflows/c-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 2c16459032..e190d680f7 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -69,7 +69,8 @@ jobs: if: ${{ runner.os == 'Linux' }} - name: Temporary Test run: | - ./gradlew runlfc -d --args test/C/src/federated/SimpleFederatedAuthenticated.lf + brew install openssl + ./gradlew runlfc --args test/C/src/federated/SimpleFederatedAuthenticated.lf if: ${{ !inputs.use-cpp && !inputs.scheduler }} - name: Perform tests for C target with default scheduler run: | From a9b91c9ca8aa35bb1fca20851bbc6c929e782a68 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 15:26:48 +0900 Subject: [PATCH 41/54] Change orders of finding openssl --- .../src/org/lflang/generator/c/CCmakeGenerator.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 0d37cf4d4c..536896c21a 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -191,12 +191,6 @@ CodeBuilder generateCMakeCode( if(targetConfig.auth) { // If security is requested, add the auth option. - cMakeCode.pr("# Find OpenSSL and link to it"); - cMakeCode.pr("message(\"111111111111111111111111111111111111111111\")"); - cMakeCode.pr("find_package(OpenSSL REQUIRED)"); - cMakeCode.pr("message(\"2222222222222222222222222222222222222222\")"); - cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); - cMakeCode.pr("message(\"3333333333333333333333333333333333333333\")"); var osName = System.getProperty("os.name").toLowerCase(); System.out.println(osName); System.out.println("java1111"); @@ -211,9 +205,14 @@ CodeBuilder generateCMakeCode( if (osName.contains("mac")) { System.out.println("java3333"); cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); - cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_LIBRARIES=/usr/local/opt/openssl/lib)"); cMakeCode.pr("message(\"6666666666666666666666666666666666666666666\")"); } + cMakeCode.pr("# Find OpenSSL and link to it"); + cMakeCode.pr("message(\"111111111111111111111111111111111111111111\")"); + cMakeCode.pr("find_package(OpenSSL REQUIRED)"); + cMakeCode.pr("message(\"2222222222222222222222222222222222222222\")"); + cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); + cMakeCode.pr("message(\"3333333333333333333333333333333333333333\")"); cMakeCode.newLine(); } From 8f452c2e0b5ca4fc42bb5509b65285167bf4e465 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 15:38:10 +0900 Subject: [PATCH 42/54] Changed to SET path --- .github/workflows/c-tests.yml | 1 - .github/workflows/ci.yml | 18 +++++++++--------- .../lflang/generator/c/CCmakeGenerator.java | 10 +--------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index e190d680f7..26ce60d174 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -69,7 +69,6 @@ jobs: if: ${{ runner.os == 'Linux' }} - name: Temporary Test run: | - brew install openssl ./gradlew runlfc --args test/C/src/federated/SimpleFederatedAuthenticated.lf if: ${{ !inputs.use-cpp && !inputs.scheduler }} - name: Perform tests for C target with default scheduler diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61503eb488..a26867c6e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,10 @@ jobs: cancel: uses: lf-lang/lingua-franca/.github/workflows/cancel.yml@master - # Test the Gradle and Maven build. - build: - uses: lf-lang/lingua-franca/.github/workflows/build.yml@master - needs: cancel + # # Test the Gradle and Maven build. + # build: + # uses: lf-lang/lingua-franca/.github/workflows/build.yml@master + # needs: cancel # # Run the unit tests. # unit-tests: @@ -58,11 +58,11 @@ jobs: needs: cancel # Run the CCpp integration tests. - ccpp-tests: - uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth - with: - use-cpp: true - needs: cancel + # ccpp-tests: + # uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth + # with: + # use-cpp: true + # needs: cancel # # Run the C++ benchmark tests. # cpp-benchmark-tests: diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 536896c21a..c40016aab4 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -192,20 +192,12 @@ CodeBuilder generateCMakeCode( if(targetConfig.auth) { // If security is requested, add the auth option. var osName = System.getProperty("os.name").toLowerCase(); - System.out.println(osName); - System.out.println("java1111"); - cMakeCode.pr("message(\"4444444444444444444444444444444444444444\")"); // if platform target was set, use given platform instead if (targetConfig.platformOptions.platform != Platform.AUTO) { osName = targetConfig.platformOptions.platform.toString(); - System.out.println(osName); - System.out.println("java2222"); - cMakeCode.pr("message(\"555555555555555555555555555555555555555\")"); } if (osName.contains("mac")) { - System.out.println("java3333"); - cMakeCode.pr("target_compile_definitions(${LF_MAIN_TARGET} PUBLIC OPENSSL_ROOT_DIR=/usr/local/opt/openssl)"); - cMakeCode.pr("message(\"6666666666666666666666666666666666666666666\")"); + cMakeCode.pr("set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)"); } cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("message(\"111111111111111111111111111111111111111111\")"); From 2160e5831bd8aa7105049fcb607fda9da4729dcf Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 15:53:22 +0900 Subject: [PATCH 43/54] Remove unneeded lines --- .github/workflows/c-tests.yml | 3 --- org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java | 3 --- 2 files changed, 6 deletions(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 26ce60d174..d6b5a436e3 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -46,9 +46,6 @@ jobs: brew install coreutils brew install openssl brew link openssl --force - export PATH="/usr/local/opt/openssl/bin:$PATH" - export LDFLAGS="-L/usr/local/opt/openssl@3/lib" - export CPPFLAGS="-I/usr/local/opt/openssl@3/include" if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index c40016aab4..2461ec46d1 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -200,11 +200,8 @@ CodeBuilder generateCMakeCode( cMakeCode.pr("set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)"); } cMakeCode.pr("# Find OpenSSL and link to it"); - cMakeCode.pr("message(\"111111111111111111111111111111111111111111\")"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); - cMakeCode.pr("message(\"2222222222222222222222222222222222222222\")"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); - cMakeCode.pr("message(\"3333333333333333333333333333333333333333\")"); cMakeCode.newLine(); } From 2b272ac086e5248f774a4b7f0a9213c2bfcf3131 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 17:11:52 +0900 Subject: [PATCH 44/54] Restore ci tests --- .github/workflows/c-tests.yml | 3 +- .github/workflows/ci.yml | 160 +++++++++++++++++----------------- 2 files changed, 81 insertions(+), 82 deletions(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index d6b5a436e3..ee47b6353b 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -21,8 +21,7 @@ jobs: run: strategy: matrix: - # platform: [ubuntu-latest, macos-latest, windows-latest] - platform: [macos-latest] + platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - name: Check out lingua-franca repository diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a26867c6e8..f0b773a92e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,37 +20,37 @@ jobs: cancel: uses: lf-lang/lingua-franca/.github/workflows/cancel.yml@master - # # Test the Gradle and Maven build. - # build: - # uses: lf-lang/lingua-franca/.github/workflows/build.yml@master - # needs: cancel - - # # Run the unit tests. - # unit-tests: - # uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master - # needs: cancel - - # # Run tests for the standalone compiler. - # cli-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master - # needs: cancel - - # # Run the C benchmark tests. - # c-benchmark-tests: - # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - # with: - # target: 'C' - # needs: cancel - - # # Run tests for Eclipse. - # eclipse-tests: - # uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master - # needs: cancel - - # # Run language server tests. - # lsp-tests: - # uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master - # needs: cancel + # Test the Gradle and Maven build. + build: + uses: lf-lang/lingua-franca/.github/workflows/build.yml@master + needs: cancel + + # Run the unit tests. + unit-tests: + uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master + needs: cancel + + # Run tests for the standalone compiler. + cli-tests: + uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master + needs: cancel + + # Run the C benchmark tests. + c-benchmark-tests: + uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + with: + target: 'C' + needs: cancel + + # Run tests for Eclipse. + eclipse-tests: + uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master + needs: cancel + + # Run language server tests. + lsp-tests: + uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master + needs: cancel # Run the C integration tests. c-tests: @@ -58,52 +58,52 @@ jobs: needs: cancel # Run the CCpp integration tests. - # ccpp-tests: - # uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth - # with: - # use-cpp: true - # needs: cancel - - # # Run the C++ benchmark tests. - # cpp-benchmark-tests: - # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - # with: - # target: 'Cpp' - # needs: cancel - - # # Run the C++ integration tests. - # cpp-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master - # needs: cancel - - # # Run the C++ integration tests on ROS2. - # cpp-ros2-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master - # needs: cancel - - # # Run the Python integration tests. - # py-tests: - # uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master - # needs: cancel - - # # Run the Rust integration tests. - # rs-tests: - # uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master - # needs: cancel - - # # Run the Rust benchmark tests. - # rs-benchmark-tests: - # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - # with: - # target: 'Rust' - # needs: cancel - - # # Run the TypeScript integration tests. - # ts-tests: - # uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master - # needs: cancel - - # # Run the serialization tests - # serialization-tests: - # uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master - # needs: cancel + ccpp-tests: + uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth + with: + use-cpp: true + needs: cancel + + # Run the C++ benchmark tests. + cpp-benchmark-tests: + uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + with: + target: 'Cpp' + needs: cancel + + # Run the C++ integration tests. + cpp-tests: + uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master + needs: cancel + + # Run the C++ integration tests on ROS2. + cpp-ros2-tests: + uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master + needs: cancel + + # Run the Python integration tests. + py-tests: + uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master + needs: cancel + + # Run the Rust integration tests. + rs-tests: + uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master + needs: cancel + + # Run the Rust benchmark tests. + rs-benchmark-tests: + uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + with: + target: 'Rust' + needs: cancel + + # Run the TypeScript integration tests. + ts-tests: + uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master + needs: cancel + + # Run the serialization tests + serialization-tests: + uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master + needs: cancel From b41dbcaada64b3b5f836a15509566fcc8b41c140 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 17:13:53 +0900 Subject: [PATCH 45/54] Restore ci tests --- .github/workflows/c-tests.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index ee47b6353b..60bcf18b90 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -63,10 +63,6 @@ jobs: - name: Build RTI docker image uses: ./.github/actions/build-rti-docker if: ${{ runner.os == 'Linux' }} - - name: Temporary Test - run: | - ./gradlew runlfc --args test/C/src/federated/SimpleFederatedAuthenticated.lf - if: ${{ !inputs.use-cpp && !inputs.scheduler }} - name: Perform tests for C target with default scheduler run: | ./gradlew test --tests org.lflang.tests.runtime.CTest.* @@ -76,7 +72,7 @@ jobs: echo "Specified scheduler: ${{ inputs.scheduler }}" ./gradlew test --tests org.lflang.tests.runtime.CSchedulerTest.* -Dscheduler=${{ inputs.scheduler }} if: ${{ !inputs.use-cpp && inputs.scheduler }} - - name: Perform tests for CCpp target with default -scheduler + - name: Perform tests for CCpp target with default scheduler run: | ./gradlew test --tests org.lflang.tests.runtime.CCppTest.* if: ${{ inputs.use-cpp && !inputs.scheduler }} From 9251b9ce1f30b1f5dfb4f7532f2ff3cbbe2d9e24 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 17:58:02 +0900 Subject: [PATCH 46/54] Update reactor-c --- org.lflang/src/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/lib/c/reactor-c b/org.lflang/src/lib/c/reactor-c index 8ed5649c10..0cfbcd7e77 160000 --- a/org.lflang/src/lib/c/reactor-c +++ b/org.lflang/src/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 8ed5649c10e234bccdba82a97e56be6ca1a241b6 +Subproject commit 0cfbcd7e7716116ff5bdf2daaafa6a4d504130df From f12b27fd3cbff2afdcf49ef157f20f7fef04cd46 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 19:56:52 +0900 Subject: [PATCH 47/54] Test export --- .github/actions/install-rti/install.sh | 11 +- .github/workflows/c-tests.yml | 1 + .github/workflows/ci.yml | 162 +++++++++--------- .../lflang/generator/c/CCmakeGenerator.java | 16 +- 4 files changed, 96 insertions(+), 94 deletions(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index cfa95da56b..cd5ad43c56 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -2,10 +2,11 @@ cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build cd build -if [[ "$OSTYPE" == "darwin"* ]]; then - cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ -else - cmake -DAUTH=ON ../ -fi +# if [[ "$OSTYPE" == "darwin"* ]]; then +# cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ +# else +# cmake -DAUTH=ON ../ +# fi +cmake -DAUTH=ON ../ make sudo make install diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 60bcf18b90..1993f66aa6 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -45,6 +45,7 @@ jobs: brew install coreutils brew install openssl brew link openssl --force + export OPENSSL_ROOT_DIR=/usr/local/opt/openssl if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0b773a92e..24bef776be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,90 +20,90 @@ jobs: cancel: uses: lf-lang/lingua-franca/.github/workflows/cancel.yml@master - # Test the Gradle and Maven build. - build: - uses: lf-lang/lingua-franca/.github/workflows/build.yml@master - needs: cancel - - # Run the unit tests. - unit-tests: - uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master - needs: cancel - - # Run tests for the standalone compiler. - cli-tests: - uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master - needs: cancel - - # Run the C benchmark tests. - c-benchmark-tests: - uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - with: - target: 'C' - needs: cancel - - # Run tests for Eclipse. - eclipse-tests: - uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master - needs: cancel - - # Run language server tests. - lsp-tests: - uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master - needs: cancel + # # Test the Gradle and Maven build. + # build: + # uses: lf-lang/lingua-franca/.github/workflows/build.yml@master + # needs: cancel + + # # Run the unit tests. + # unit-tests: + # uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master + # needs: cancel + + # # Run tests for the standalone compiler. + # cli-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master + # needs: cancel + + # # Run the C benchmark tests. + # c-benchmark-tests: + # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + # with: + # target: 'C' + # needs: cancel + + # # Run tests for Eclipse. + # eclipse-tests: + # uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master + # needs: cancel + + # # Run language server tests. + # lsp-tests: + # uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master + # needs: cancel # Run the C integration tests. c-tests: uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth needs: cancel - # Run the CCpp integration tests. - ccpp-tests: - uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth - with: - use-cpp: true - needs: cancel - - # Run the C++ benchmark tests. - cpp-benchmark-tests: - uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - with: - target: 'Cpp' - needs: cancel - - # Run the C++ integration tests. - cpp-tests: - uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master - needs: cancel - - # Run the C++ integration tests on ROS2. - cpp-ros2-tests: - uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master - needs: cancel - - # Run the Python integration tests. - py-tests: - uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master - needs: cancel - - # Run the Rust integration tests. - rs-tests: - uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master - needs: cancel - - # Run the Rust benchmark tests. - rs-benchmark-tests: - uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - with: - target: 'Rust' - needs: cancel - - # Run the TypeScript integration tests. - ts-tests: - uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master - needs: cancel - - # Run the serialization tests - serialization-tests: - uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master - needs: cancel + # # Run the CCpp integration tests. + # ccpp-tests: + # uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth + # with: + # use-cpp: true + # needs: cancel + + # # Run the C++ benchmark tests. + # cpp-benchmark-tests: + # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + # with: + # target: 'Cpp' + # needs: cancel + + # # Run the C++ integration tests. + # cpp-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master + # needs: cancel + + # # Run the C++ integration tests on ROS2. + # cpp-ros2-tests: + # uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master + # needs: cancel + + # # Run the Python integration tests. + # py-tests: + # uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master + # needs: cancel + + # # Run the Rust integration tests. + # rs-tests: + # uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master + # needs: cancel + + # # Run the Rust benchmark tests. + # rs-benchmark-tests: + # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + # with: + # target: 'Rust' + # needs: cancel + + # # Run the TypeScript integration tests. + # ts-tests: + # uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master + # needs: cancel + + # # Run the serialization tests + # serialization-tests: + # uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master + # needs: cancel diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 2461ec46d1..cd0183944e 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -191,14 +191,14 @@ CodeBuilder generateCMakeCode( if(targetConfig.auth) { // If security is requested, add the auth option. - var osName = System.getProperty("os.name").toLowerCase(); - // if platform target was set, use given platform instead - if (targetConfig.platformOptions.platform != Platform.AUTO) { - osName = targetConfig.platformOptions.platform.toString(); - } - if (osName.contains("mac")) { - cMakeCode.pr("set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)"); - } + // var osName = System.getProperty("os.name").toLowerCase(); + // // if platform target was set, use given platform instead + // if (targetConfig.platformOptions.platform != Platform.AUTO) { + // osName = targetConfig.platformOptions.platform.toString(); + // } + // if (osName.contains("mac")) { + // cMakeCode.pr("set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)"); + // } cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); From 00d5164930f36f79a8f05988c5b3aabf62649d4d Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 20:05:01 +0900 Subject: [PATCH 48/54] Fix bugs --- .github/workflows/c-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 1993f66aa6..b2284b0044 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -45,7 +45,7 @@ jobs: brew install coreutils brew install openssl brew link openssl --force - export OPENSSL_ROOT_DIR=/usr/local/opt/openssl + export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From 88e1a466147942f4f482802ca940ce66005a00fb Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 20:13:38 +0900 Subject: [PATCH 49/54] FIX bugs --- .github/actions/install-rti/install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index cd5ad43c56..6052edaaff 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -7,6 +7,7 @@ cd build # else # cmake -DAUTH=ON ../ # fi +echo $OPENSSL_ROOT_DIR cmake -DAUTH=ON ../ make sudo make install From 7082ffcd1f11e3b27cc11b4c5285586ade6f63d6 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 20:18:37 +0900 Subject: [PATCH 50/54] FIX bugs --- .github/actions/install-rti/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index 6052edaaff..98df94e9b3 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -1,12 +1,14 @@ #!/bin/bash cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build +echo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cd build # if [[ "$OSTYPE" == "darwin"* ]]; then # cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ # else # cmake -DAUTH=ON ../ # fi +echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA echo $OPENSSL_ROOT_DIR cmake -DAUTH=ON ../ make From d3565d3e08e6cdf10baf0511db20e0824c33f8ae Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 20:24:35 +0900 Subject: [PATCH 51/54] Testing variables --- .github/actions/install-rti/install.sh | 1 + .github/workflows/c-tests.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index 98df94e9b3..0e1cc85b2f 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -9,6 +9,7 @@ cd build # cmake -DAUTH=ON ../ # fi echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" echo $OPENSSL_ROOT_DIR cmake -DAUTH=ON ../ make diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index b2284b0044..560f5c0871 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -46,6 +46,8 @@ jobs: brew install openssl brew link openssl --force export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" + echo AAAAAAAAAAAAAAAAAAAAAAAAAAA + echo $OPENSSL_ROOT_DIR if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti From a82a76f3e59c1061f7af4e6dd371b2c614770d11 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 20:57:52 +0900 Subject: [PATCH 52/54] Restore git CI tests --- .github/actions/install-rti/install.sh | 12 +- .github/workflows/c-tests.yml | 3 - .github/workflows/ci.yml | 162 +++++++++--------- .../lflang/generator/c/CCmakeGenerator.java | 18 +- 4 files changed, 93 insertions(+), 102 deletions(-) diff --git a/.github/actions/install-rti/install.sh b/.github/actions/install-rti/install.sh index 0e1cc85b2f..05ef9474b7 100755 --- a/.github/actions/install-rti/install.sh +++ b/.github/actions/install-rti/install.sh @@ -1,16 +1,10 @@ #!/bin/bash cd org.lflang/src/lib/c/reactor-c/core/federated/RTI mkdir build -echo bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb cd build -# if [[ "$OSTYPE" == "darwin"* ]]; then -# cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DAUTH=ON ../ -# else -# cmake -DAUTH=ON ../ -# fi -echo AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA -export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" -echo $OPENSSL_ROOT_DIR +if [[ "$OSTYPE" == "darwin"* ]]; then + export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" +fi cmake -DAUTH=ON ../ make sudo make install diff --git a/.github/workflows/c-tests.yml b/.github/workflows/c-tests.yml index 560f5c0871..60bcf18b90 100644 --- a/.github/workflows/c-tests.yml +++ b/.github/workflows/c-tests.yml @@ -45,9 +45,6 @@ jobs: brew install coreutils brew install openssl brew link openssl --force - export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" - echo AAAAAAAAAAAAAAAAAAAAAAAAAAA - echo $OPENSSL_ROOT_DIR if: ${{ runner.os == 'macOS' }} - name: Install RTI uses: ./.github/actions/install-rti diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24bef776be..f0b773a92e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,90 +20,90 @@ jobs: cancel: uses: lf-lang/lingua-franca/.github/workflows/cancel.yml@master - # # Test the Gradle and Maven build. - # build: - # uses: lf-lang/lingua-franca/.github/workflows/build.yml@master - # needs: cancel - - # # Run the unit tests. - # unit-tests: - # uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master - # needs: cancel - - # # Run tests for the standalone compiler. - # cli-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master - # needs: cancel - - # # Run the C benchmark tests. - # c-benchmark-tests: - # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - # with: - # target: 'C' - # needs: cancel - - # # Run tests for Eclipse. - # eclipse-tests: - # uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master - # needs: cancel - - # # Run language server tests. - # lsp-tests: - # uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master - # needs: cancel + # Test the Gradle and Maven build. + build: + uses: lf-lang/lingua-franca/.github/workflows/build.yml@master + needs: cancel + + # Run the unit tests. + unit-tests: + uses: lf-lang/lingua-franca/.github/workflows/unit-tests.yml@master + needs: cancel + + # Run tests for the standalone compiler. + cli-tests: + uses: lf-lang/lingua-franca/.github/workflows/cli-tests.yml@master + needs: cancel + + # Run the C benchmark tests. + c-benchmark-tests: + uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + with: + target: 'C' + needs: cancel + + # Run tests for Eclipse. + eclipse-tests: + uses: lf-lang/lingua-franca/.github/workflows/eclipse-tests.yml@master + needs: cancel + + # Run language server tests. + lsp-tests: + uses: lf-lang/lingua-franca/.github/workflows/lsp-tests.yml@master + needs: cancel # Run the C integration tests. c-tests: uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth needs: cancel - # # Run the CCpp integration tests. - # ccpp-tests: - # uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth - # with: - # use-cpp: true - # needs: cancel - - # # Run the C++ benchmark tests. - # cpp-benchmark-tests: - # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - # with: - # target: 'Cpp' - # needs: cancel - - # # Run the C++ integration tests. - # cpp-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master - # needs: cancel - - # # Run the C++ integration tests on ROS2. - # cpp-ros2-tests: - # uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master - # needs: cancel - - # # Run the Python integration tests. - # py-tests: - # uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master - # needs: cancel - - # # Run the Rust integration tests. - # rs-tests: - # uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master - # needs: cancel - - # # Run the Rust benchmark tests. - # rs-benchmark-tests: - # uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main - # with: - # target: 'Rust' - # needs: cancel - - # # Run the TypeScript integration tests. - # ts-tests: - # uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master - # needs: cancel - - # # Run the serialization tests - # serialization-tests: - # uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master - # needs: cancel + # Run the CCpp integration tests. + ccpp-tests: + uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@auth + with: + use-cpp: true + needs: cancel + + # Run the C++ benchmark tests. + cpp-benchmark-tests: + uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + with: + target: 'Cpp' + needs: cancel + + # Run the C++ integration tests. + cpp-tests: + uses: lf-lang/lingua-franca/.github/workflows/cpp-tests.yml@master + needs: cancel + + # Run the C++ integration tests on ROS2. + cpp-ros2-tests: + uses: lf-lang/lingua-franca/.github/workflows/cpp-ros2-tests.yml@master + needs: cancel + + # Run the Python integration tests. + py-tests: + uses: lf-lang/lingua-franca/.github/workflows/py-tests.yml@master + needs: cancel + + # Run the Rust integration tests. + rs-tests: + uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master + needs: cancel + + # Run the Rust benchmark tests. + rs-benchmark-tests: + uses: lf-lang/benchmarks-lingua-franca/.github/workflows/benchmark-tests.yml@main + with: + target: 'Rust' + needs: cancel + + # Run the TypeScript integration tests. + ts-tests: + uses: lf-lang/lingua-franca/.github/workflows/ts-tests.yml@master + needs: cancel + + # Run the serialization tests + serialization-tests: + uses: lf-lang/lingua-franca/.github/workflows/serialization-tests.yml@master + needs: cancel diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index cd0183944e..9476410424 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -190,15 +190,15 @@ CodeBuilder generateCMakeCode( cMakeCode.pr("target_include_directories(${LF_MAIN_TARGET} PUBLIC include/core/utils)"); if(targetConfig.auth) { - // If security is requested, add the auth option. - // var osName = System.getProperty("os.name").toLowerCase(); - // // if platform target was set, use given platform instead - // if (targetConfig.platformOptions.platform != Platform.AUTO) { - // osName = targetConfig.platformOptions.platform.toString(); - // } - // if (osName.contains("mac")) { - // cMakeCode.pr("set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)"); - // } + If security is requested, add the auth option. + var osName = System.getProperty("os.name").toLowerCase(); + // if platform target was set, use given platform instead + if (targetConfig.platformOptions.platform != Platform.AUTO) { + osName = targetConfig.platformOptions.platform.toString(); + } + if (osName.contains("mac")) { + cMakeCode.pr("set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)"); + } cMakeCode.pr("# Find OpenSSL and link to it"); cMakeCode.pr("find_package(OpenSSL REQUIRED)"); cMakeCode.pr("target_link_libraries( ${LF_MAIN_TARGET} PRIVATE OpenSSL::SSL)"); From 896ad594a08792e3cdb2accd747f83efbf2c18d7 Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Mon, 21 Nov 2022 21:09:54 +0900 Subject: [PATCH 53/54] Fix bugs --- org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java index 9476410424..2461ec46d1 100644 --- a/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java +++ b/org.lflang/src/org/lflang/generator/c/CCmakeGenerator.java @@ -190,7 +190,7 @@ CodeBuilder generateCMakeCode( cMakeCode.pr("target_include_directories(${LF_MAIN_TARGET} PUBLIC include/core/utils)"); if(targetConfig.auth) { - If security is requested, add the auth option. + // If security is requested, add the auth option. var osName = System.getProperty("os.name").toLowerCase(); // if platform target was set, use given platform instead if (targetConfig.platformOptions.platform != Platform.AUTO) { From 7ffc785f9d8ade74cf6b1d441ab3de53ccaaaf3e Mon Sep 17 00:00:00 2001 From: Jakio815 Date: Tue, 20 Dec 2022 17:41:18 +0900 Subject: [PATCH 54/54] Removed Fixmes --- org.lflang/src/org/lflang/TargetProperty.java | 1 - test/C/src/federated/SimpleFederatedAuthenticated.lf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/org.lflang/src/org/lflang/TargetProperty.java b/org.lflang/src/org/lflang/TargetProperty.java index 0425d75a54..6b8977d11d 100644 --- a/org.lflang/src/org/lflang/TargetProperty.java +++ b/org.lflang/src/org/lflang/TargetProperty.java @@ -60,7 +60,6 @@ public enum TargetProperty { /** * Directive to allow including OpenSSL libraries and process HMAC authentication. - * FIXME: The option will be updated from boolean to string for support of various options. */ AUTH("auth", PrimitiveType.BOOLEAN, Arrays.asList(Target.C, Target.CCPP), (config, value, err) -> { diff --git a/test/C/src/federated/SimpleFederatedAuthenticated.lf b/test/C/src/federated/SimpleFederatedAuthenticated.lf index e2dffcebe9..f6ce5edcc1 100644 --- a/test/C/src/federated/SimpleFederatedAuthenticated.lf +++ b/test/C/src/federated/SimpleFederatedAuthenticated.lf @@ -5,7 +5,7 @@ target C { timeout: 2 secs, build-type: RelWithDebInfo, - auth: true, // FIXME: This will be updated to string such as HMAC. + auth: true, logging: DEBUG }