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

Read previousVersions for bincompat checking from a file #3202

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Conversation

jackkoenig
Copy link
Contributor

This makes it much easier to automate checking new versions as they are released.

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Internal or build-related (includes code refactoring/cleanup)

Desired Merge Strategy

  • Squash

Release Notes

We can now simply append versions as they are released to project/previous-versions.txt on relevant release branches. build.sbt also now contains instructions are how to waive binary compatibility breakages.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.5.x or 3.6.x depending on impact, API modification or big change: 5.0.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

This makes it much easier to automate checking new versions as they are
released.
@jackkoenig jackkoenig added the Internal Internal change, does not affect users, will be included in release notes label Apr 24, 2023
@jackkoenig jackkoenig added this to the 3.6.x milestone Apr 24, 2023
@jackkoenig
Copy link
Contributor Author

Hard to test this sort of automation in CI, but I did test it locally and was able to get failures by running:

Show no issues

$ sbt "unipublish / mimaReportBinaryIssues"                             
[info] welcome to sbt 1.8.2 (GraalVM Community Java 11.0.13)                                             
[info] loading settings for project chisel5-build from plugins.sbt ...                                   
[info] loading project definition from /Users/jackk/work/chisel5/project                                 
[info] loading settings for project chisel from build.sbt ...                                            
[info] resolving key references (12864 settings) ...                                                     
[info] set current project to chisel (in build file:/Users/jackk/work/chisel5/)                          
[info] chisel-plugin: mimaPreviousArtifacts is empty, not analyzing binary compatibility.                
[info] compiling 1 Scala source to /Users/jackk/work/chisel5/firrtl/target/scala-2.13/classes ...        
[info] compiling 1 Scala source to /Users/jackk/work/chisel5/core/target/scala-2.13/classes ...          
[info] compiling 82 Scala sources to /Users/jackk/work/chisel5/target/scala-2.13/classes ...             
[info] chisel: mimaPreviousArtifacts is empty, not analyzing binary compatibility.                       
[success] Total time: 19 s, completed Apr 24, 2023, 4:57:28 PM

Add a previous version

$ echo "5.0.0-RC1" >> project/previous-versions.txt

Show failures

$ sbt "unipublish / mimaReportBinaryIssues"                             
[info] welcome to sbt 1.8.2 (GraalVM Community Java 11.0.13)                                             
[info] loading settings for project chisel5-build from plugins.sbt ...                                   
[info] loading project definition from /Users/jackk/work/chisel5/project                                 
[info] loading settings for project chisel from build.sbt ...                                            
[info] resolving key references (12864 settings) ...                                                     
[info] set current project to chisel (in build file:/Users/jackk/work/chisel5/)                          
[error] chisel: Failed binary compatibility check against org.chipsalliance:chisel_2.13:5.0.0-RC1! Found 7 potential problems
[error]  * method this(chisel3.Data,scala.math.BigInt)Unit in class chisel3.Mem does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.Mem.this")           
[error]  * method this(chisel3.Data,scala.math.BigInt)Unit in class chisel3.MemBase does not have a correspondent in current version                 
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.MemBase.this")       
[error]  * method this(chisel3.Data,scala.math.BigInt,scala.Enumeration#Value)Unit in class chisel3.SyncReadMem does not have a correspondent in current version
[error]    filter with: ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.SyncReadMem.this")   
[error]  * class chisel3.internal.firrtl.PartialConnect does not have a correspondent in current version 
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("chisel3.internal.firrtl.PartialConnect")                                        
[error]  * object chisel3.internal.firrtl.PartialConnect does not have a correspondent in current version                                             
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("chisel3.internal.firrtl.PartialConnect$")                                       
[error]  * class firrtl.ir.PartialConnect does not have a correspondent in current version               
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("firrtl.ir.PartialConnect")          
[error]  * object firrtl.ir.PartialConnect does not have a correspondent in current version              
[error]    filter with: ProblemFilters.exclude[MissingClassProblem]("firrtl.ir.PartialConnect$")         
[error] java.lang.RuntimeException: Failed binary compatibility check against org.chipsalliance:chisel_2.13:5.0.0-RC1! Found 7 potential problems

Waive failures

cat << EOF > unipublish/src/main/mima-filters/5.0.0-RC1.backwards.excludes
ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.Mem.this")
ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.MemBase.this")
ProblemFilters.exclude[DirectMissingMethodProblem]("chisel3.SyncReadMem.this")
ProblemFilters.exclude[MissingClassProblem]("chisel3.internal.firrtl.PartialConnect")
ProblemFilters.exclude[MissingClassProblem]("chisel3.internal.firrtl.PartialConnect$")
ProblemFilters.exclude[MissingClassProblem]("firrtl.ir.PartialConnect")
ProblemFilters.exclude[MissingClassProblem]("firrtl.ir.PartialConnect$")
EOF

Show success

$ sbt "unipublish / mimaReportBinaryIssues"
[info] welcome to sbt 1.8.2 (GraalVM Community Java 11.0.13)
[info] loading settings for project chisel5-build from plugins.sbt ...
[info] loading project definition from /Users/jackk/work/chisel5/project
[info] loading settings for project chisel from build.sbt ...
[info] resolving key references (12864 settings) ...
[info] set current project to chisel (in build file:/Users/jackk/work/chisel5/)
[success] Total time: 3 s, completed Apr 24, 2023, 5:04:35 PM

build.sbt Outdated Show resolved Hide resolved
Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
@jackkoenig jackkoenig enabled auto-merge (squash) April 25, 2023 16:11
@jackkoenig jackkoenig merged commit 2c6028b into main Apr 25, 2023
@jackkoenig jackkoenig deleted the better-mima branch April 25, 2023 16:35
@mergify mergify bot added the Backported This PR has been backported label Apr 25, 2023
mergify bot pushed a commit that referenced this pull request Apr 25, 2023
This makes it much easier to automate checking new versions as they are
released.

---------

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 2c6028b)

# Conflicts:
#	build.sbt
mergify bot pushed a commit that referenced this pull request Apr 25, 2023
This makes it much easier to automate checking new versions as they are
released.

---------

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 2c6028b)
mergify bot added a commit that referenced this pull request Apr 25, 2023
This makes it much easier to automate checking new versions as they are
released.

---------

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 2c6028b)

Co-authored-by: Jack Koenig <koenig@sifive.com>
mergify bot added a commit that referenced this pull request Apr 26, 2023
) (#3207)

* Read previousVersions for bincompat checking from a file (#3202)

This makes it much easier to automate checking new versions as they are
released.

---------

Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
(cherry picked from commit 2c6028b)

# Conflicts:
#	build.sbt

* Enable binary compatibility checking against 3.6.0

---------

Co-authored-by: Jack Koenig <koenig@sifive.com>
@sequencer sequencer mentioned this pull request Jun 20, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Internal Internal change, does not affect users, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants