Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix tracing options so that they appear in targetConfig #1642

Merged
merged 2 commits into from
Mar 12, 2023

Conversation

ChadliaJerad
Copy link
Collaborator

This is a fix to make tracing options appear in tragetConfig (Issue #1602).

Copy link
Collaborator

@petervdonovan petervdonovan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should merge this.

I am not 100% sure that this is the "right" solution because it looks like information is being thrown away when we do not use federate.targetConfig. However I'm in favor of merging this quickly so that we can make progress, especially since this whole issue of conflicting target configurations is expected to go away within the next year.

@ChadliaJerad
Copy link
Collaborator Author

ChadliaJerad commented Mar 11, 2023

I am not 100% sure that this is the "right" solution because it looks like information is being thrown away when we do not use federate.targetConfig.

It is indeed more of a hack than a fix :)
But why do we use the targetConfig of exactly fedearte[0]? Why not federate[1]?
Where is the decision of what to pass where?

@petervdonovan
Copy link
Collaborator

Ah, okay, I see your point. I agree, this cannot be worse than arbitrarily choosing the target config of the zeroth federate.

Copy link
Collaborator

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need this.

@edwardalee
Copy link
Collaborator

Tagging @Jakio815 because it looks like this PR exposes a bug in authentication for federates. The test test/C/src/federated/SimpleFederatedAuthenticated.lf segfaults on Ubuntu (not on my Mac, so I can't reproduce it). I think the test was passing before because the auth: true target property was being ignored when the launch script was generated. Now, the launch script generator sees that auth is true, and this apparently causes a segfault in Ubuntu. @Jakio815 , can you find a fix?

@Jakio815
Copy link
Collaborator

First, I tried a clean build on Ubuntu, but I get a weird error that looks like this.

dongha@2a365dfb10db:~/project/lingua-franca$ ./gradlew runlfc --args test/C/src/federated/SimpleFederated.lf

> Task :org.lflang:compileJava FAILED
/home/dongha/project/lingua-franca/org.lflang/src/org/lflang/generator/DockerGenerator.java:5: error: cannot find symbol
import org.lflang.generator.ts.TSDockerGenerator;
                              ^
  symbol:   class TSDockerGenerator
  location: package org.lflang.generator.ts
/home/dongha/project/lingua-franca/org.lflang/src/org/lflang/generator/GeneratorBase.java:178: warning: [unchecked] unchecked conversion
    private List<AstTransformation> astTransformations = new ArrayList();
                                                         ^
  required: List<AstTransformation>
  found:    ArrayList
/home/dongha/project/lingua-franca/org.lflang/src/org/lflang/generator/DockerGenerator.java:53: error: cannot find symbol
            case TS -> new TSDockerGenerator(context);
                           ^
  symbol:   class TSDockerGenerator
  location: class DockerGenerator
/home/dongha/project/lingua-franca/org.lflang/src/org/lflang/generator/GeneratorUtils.java:209: warning: [unchecked] unchecked cast
                T current = (T) next;
                                ^
  required: T
  found:    EObject
  where T is a type-variable:
    T extends Object declared in method <T>findAll(Resource,Class<T>)
/home/dongha/project/lingua-franca/org.lflang/src/org/lflang/federated/generator/FedGenerator.java:181: warning: [unchecked] unchecked conversion
            final List<DockerData> services = new ArrayList();
                                              ^
  required: List<DockerData>
  found:    ArrayList
2 errors
3 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':org.lflang:compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 802ms
5 actionable tasks: 1 executed, 4 up-to-date

The runlfc command works well on the master branch, but when I checkout to this tracing-in-targetconfig branch, I get this error. The problem is that not even HelloWorld.lf works. I saw this warning, Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. and changed Gradle from 8.0.2 to 7.6.1, which the CI test runner uses, but I still get this error. I don't know why this happens only on this branch. And of course, I used the main branch of the reactor-c and installed RTI.

Also, I see some weird problems of the CI test. On the c-tests run(ubuntu-latest), in the Install RTI test, I found out it doesn't use the refactored RTI, which was splitted into rti_lib.c and rti.c. So I checked the Check out lingua-fraca repository action, and the reactor-c repo is checked to 4f78b42a which was the 2 weeks ago RTI version. This may not be related to this problem, but I'm not sure if this was intended.

@ChadliaJerad
Copy link
Collaborator Author

Any update on this, @Jakio815?
Shall this PR be merged?

@lhstrh
Copy link
Member

lhstrh commented Mar 14, 2023

This PR was already merged and was then reverted.

@Jakio815
Copy link
Collaborator

I'm not sure what's happening on this branch. Looks like it was accidentally merged and reverted, and this branch is still deleted. So are we still on the same page with the test not passing?

@lhstrh
Copy link
Member

lhstrh commented Mar 14, 2023

When I find the time, I'll create a new branch, cherry pick the commit, and work on a fix. Maybe tomorrow. Will get in touch if I need help, @Jakio815!

@cmnrd
Copy link
Collaborator

cmnrd commented Mar 14, 2023

I saw this warning, Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. and changed Gradle from 8.0.2 to 7.6.1, which the CI test runner uses, but I still get this error. I don't know why this happens only on this branch. And of course, I used the main branch of the reactor-c and installed RTI.

@Jakio815 The gradle wrapper (./gradlew) installs its own version of gradle independent of what is installed in your system. ./gradlew --version should show "Gradle 7.6.1" even if you have another version of gradle installed. The warning that you mentioned is harmless, as long as we don't upgrade to grade 8. The warning is always shown and does not influence the build.

Note that we have discussed the build problem also here: #1645. It seems that ./gradlew clean fixes the problem.

@ChadliaJerad
Copy link
Collaborator Author

ChadliaJerad commented Mar 14, 2023

This PR was already merged and was then reverted.

Yes. I did the merge after @petervdonovan and @edwardalee approvals.
But I overlooked the authentication bug mentioned by @edwardalee to @Jakio815.
That's why I did revert the merge until the problem is solved.
I am also restoring the branch (I deleted).

@ChadliaJerad ChadliaJerad restored the tracing-in-targetconfig branch March 14, 2023 17:28
@cmnrd cmnrd added the exclude Exclude from change log label Mar 22, 2023
@cmnrd cmnrd deleted the tracing-in-targetconfig branch June 8, 2023 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude Exclude from change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants