Closed omarzd closed 6 years ago
From the looks of your terminal output, the difference seems to be quite subtle. It could the handling of newlines (\r\n
vs \n
) on Windows or do you have any special language configured?
Could you maybe try to debug the DOTSerializationTest
, and tell me what the actual difference between the two values is right before the violating check? (Any IDE with TestNG support should be able to this).
You're absolutely right.
dotWriter.toString()
has \n
.
expectedWriter.toString()
has \r\n
.
How do I fix this?
Great, thanks for the info. We will look into this. At this point I'm not sure yet, if this is an issue with the test or the way, the serializer works.
For now, if you're just interested in building the latest AutomataLib artifacts, you could run mvn clean install -DskipTests
or use the public snapshot artifacts
@omarzd, could you maybe try to build https://github.com/mtf90/automatalib/tree/platformFixes? If this works for you, I can merge the changes in the main repo.
@omarzd did you have the chance to test my branch?
@mtf90 I just did. It gives the same error.
@omarzd Hm, that is weird. I set up AppVeyor to have continuous integration on Windows platforms and merged the changes from my branch. As you can see, the build succeeds.
However, I did have to enable git's autocrlf
(so that the test files committed with \n
are checked out with \r\n
newlines). I assume you use the same configuration, because in your initial feedback you said, that the expectedWriter
(which is reading the file) contained \r\n
. Do the test files (e.g. serialization/dot/src/test/resources/graph.dot
) have correct newlines if you open them in an arbitrary editor?
@mtf90 It looks like you merged the fix. I just set my git using git config --global core.autocrlf true
and compiled again and it passed the tests. Maybe the git config should be mentioned in the README.
Thank you
@omarzd You haven't configured anything similar before? This makes me wonder how you ended up with \r\n
newlines in the first place (see your comment), because we mainly use UNIX systems for development (which only use \n
).
Anyway, it looks like everything is working out now. Thanks for raising this issue and reminding us to share more love for windows users :P.
Edit: Also, you probably don't have to set this as a global setting, which may interfere with other projects of yours. Apparently, we can also solve this by adding a .gitattributes
file to the repository, so that we can provide a proper out-of-the-box configuration. I'll have a look at that.
@omarzd 3c1a0c5 added a .gitattributes
file which should automatically take care of correct, platform dependent newlines conversion, so you shouldn't need to manually configure anything for Automatalib. Although AppVeyor VMs still seem to require manual configuration via core.autocrlf
, I checked at least one Windows box where everything worked out-of-the-box.
Hi I faced the following error during a
mvn clean install
. The setup is JDK 1.8 on Windows 7 x64.