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

Miscellaneous Scala clean up #4055

Merged
merged 18 commits into from
Mar 4, 2024
Merged

Miscellaneous Scala clean up #4055

merged 18 commits into from
Mar 4, 2024

Conversation

Scott-Guest
Copy link
Contributor

@Scott-Guest Scott-Guest commented Feb 28, 2024

This PR makes a couple quick miscellaneous changes:

  • Updates maven-compiler-plugin and scala-maven-plugin to their latest versions
  • Set the Java version with <release> rather than <source> and <target>
    • <source> and <target> only set the source code and generated class file formats, but do not take into account API changes between Java releases
    • This <release> tag should automatically be respected by scala-maven-plugin as well (once Java 17 (still) not supported in kore submodule #4041 is fixed)
  • Disable various Scala language extensions and enable -Werror
    • Not strictly necessary, but I figure this will minimize complications when we port to Scala 2.13.x and later Java
  • Delete the KORE.Att() sugar for Att.empty()
    • Unrelated, the indirection just seemed pointless
  • Delete ScalaSugar
    • It's only purpose was for implicit conversions, which requires a Scala language extension

The commit history is clean, and I recommend reviewing this one commit at a time.

@Scott-Guest Scott-Guest self-assigned this Feb 28, 2024
@rv-jenkins rv-jenkins changed the base branch from master to develop February 28, 2024 02:21
@Baltoli
Copy link
Contributor

Baltoli commented Feb 29, 2024

NixOS/nixpkgs#292323 for posterity, I implemented a feature in our backported maven builder that we can hopefully get upstreamed back into Nixpkgs

@Baltoli
Copy link
Contributor

Baltoli commented Mar 1, 2024

Going to hold off on merging this until @goodlyrottenapple can weigh in; the fixed-output derivation hash failure introduced in 8fe2f88 is something we've seen before with this Nix / Maven setup. As I recall, the issue is that any change to the kore package1 ends up breaking the hash because the corresponding deployed jar file ends up being deployed and re-downloaded when the FOD is built. I may be misremembering, though!

We discussed pulling this module out in #4063; doing so might be worth doing in order to make the Scala KORE parser a proper first-class dependency (and therefore avoid this problem).

Footnotes

  1. I think this effect is localised to that module because the required hash doesn't change in https://github.com/runtimeverification/k/pull/4055/commits/ed0fe1f99db95931262b51c7a2715f7b85a6eabe; that commit only changes files outside of the kore package.

Copy link
Contributor

@gtrepta gtrepta left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

coderabbitai bot commented Mar 4, 2024

Important

Auto Review Skipped

Auto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@Baltoli
Copy link
Contributor

Baltoli commented Mar 4, 2024

Confirmed with @goodlyrottenapple that extracting the code we currently push as a JAR to maven repositories to its own repo, and releasing versioned JARs rather than snapshots. In the interests of letting @Scott-Guest's Scala upgrade work go through, I'm going to merge this PR even though doing so will mean dealing with hash mismatches for a few days.

@rv-jenkins rv-jenkins merged commit d861d9e into develop Mar 4, 2024
8 checks passed
@rv-jenkins rv-jenkins deleted the scala-cleanup branch March 4, 2024 12:09
Baltoli added a commit that referenced this pull request Mar 5, 2024
rv-jenkins pushed a commit that referenced this pull request Mar 5, 2024
Reverts #4055

We will want to reinstate this PR once the required `scala-kore`
infrastructure is actually ready to use.
Scott-Guest pushed a commit to runtimeverification/llvm-backend that referenced this pull request Mar 18, 2024
#1006 is failing
because the Scala Maven plugin is trying to download the sources for the
compiler bridge, but can't do so outside of a Nix FOD. This PR adds the
bridge to the manually-downloaded Maven artifacts (as we did in
runtimeverification/k#4055)
rv-jenkins pushed a commit to runtimeverification/llvm-backend that referenced this pull request Mar 19, 2024
This PR makes a couple quick changes analogous to
runtimeverification/k#4055:

- Update `scala-maven-plugin` to its latest version
- Set the Java version by relying on `<release>` in
`maven-compiler-plugin` inherited from the parent POM, rather than
manually setting `-source` and `-target` for `javac`
- Disable various Scala language extensions and enable `-Werror`
  - One warning about pattern matching on an erased type
- Remaining warnings were exhaustiveness issues fixed with a `case _ =>
???`. This is poor style and an abuse of `???` IMO, but it's already
pervasive throughout our codebase.

---------

Co-authored-by: Bruce Collie <[email protected]>
rv-jenkins added a commit that referenced this pull request Mar 20, 2024
This reverts commit ec70555, which was
itself a revert of #4055 because of breakages in our Nix builds because
of issues around the `scala-kore` dependency. This PR reinstates the
original change now that `scala-kore` has been properly released and
versioned, and also makes a fix (see comment below) for an issue with
Nix / Maven integration that was producing spurious hash invalidations.

---------

Co-authored-by: Scott Guest <[email protected]>
Co-authored-by: rv-jenkins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants