Skip to content

Problems with -Xprint diffing #1405

@odersky

Description

@odersky

I have several problems with it:

  1.    dotc A.scala B.scala
    

    Prints the diff between B.scala and A.scalaI

  2. Diffing can take an extremely long time if there are lots of differences. I was counting 6 seconds for a file of 250 lines. Diffing would need to be more robust than that becuase in debug situations it's quite possible to have huge outputs with many changes. We can't accept the output to grind to a halt because of diffing. Proposal: Have a timeout, maybe configurable?

  3. Diffing creates another dependency, on diff-utils. Compiler dependencies should be minimized. So I would prepare if diffutls was not a hard dependency but found through reflection.

  4. And, the worst: Diffing creates unusable output when I try take the outut and diff it with another tool, because of all the control characters embedded in the source. This is a killer which makes the fact that diffing is enabled a total blocker for my work.

Given all the issues above, I advocate that diffing should be opt in, enabled by a command line option.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions