whikloj / BagItTools

A PHP BagIt library
MIT License
11 stars 5 forks source link

BagItTools does not perform on Windows (in CI) #47

Closed whikloj closed 1 year ago

whikloj commented 2 years ago

There are several tests that do not pass when run under Windows, this could be intricacies in Windows on Github Actions or it could be failures of the code.

This ticket is serve as notice that there are currently no guarantees if you want to use this library under PHP on Windows. Currently I'd recommend the Windows Subsystem for Linux.

https://github.com/whikloj/BagItTools/runs/7055596694?check_suite_focus=true

pinging @jonasraoni

jonasraoni commented 2 years ago

Hmm, AFAICS there were few OS specific things that could break the code, the only thing that comes to my mind would be the PHP_EOL, all the tests, with the exception of the fetch one, worked fine on my Windows box after I removed those files with "bad" names. Thanks for warning, I'll investigate once I get some free time here =]

whikloj commented 2 years ago

Yeah, I remember from a Java project that setting up Github Actions under Windows required some special tweaks, so it might not be the code but until I can resolve them I wanted to draw attention to it.

jonasraoni commented 2 years ago

Update: I know that at least one user used the updated package in Windows and it worked fine.

whikloj commented 2 years ago

That is good, but unfortunately I still can't check that any of my future changes doesn't break Windows compatibility until I can get the tests to run under Windows.

jonasraoni commented 2 years ago

I'll have some free time this weekend, so I'll try to check these issues :) On a first sight it looks like it's related to line-breaks (e.g. checksums using \n while the code is using PHP_EOL, which will end up as \r\n on Windows).

whikloj commented 2 years ago

I've done some work on standardizing the path separators and some other changes here https://github.com/whikloj/BagItTools/tree/minor-cleanup

jonasraoni commented 2 years ago

Great, I'll move to there :)

whikloj commented 2 years ago

Hey @jonasraoni I am still getting 2 failures on the Windows test in Github Actions. Both are related to Tar Bzip files. It appears that the Tar Gzip tests work fine. So I am wondering if there is a) a problem with bzip under Windows or b) some special setup necessary?

whikloj commented 2 years ago

https://github.com/whikloj/BagItTools/runs/7621901576?check_suite_focus=true

whikloj commented 2 years ago

Actually, it appears as if its more than 2 failing tests. https://github.com/whikloj/BagItTools/runs/7622196030?check_suite_focus=true

jonasraoni commented 2 years ago

I just got a fresh branch in my machine, reinstalled the packages and no signal of errors.

Looks like it's something on the GitHub action, I've enabled it on my account (and I see the same errors now), so I'll try to debug later 😁

whikloj commented 2 years ago

Partially resolved by #51, waiting on https://github.com/donatj/mock-webserver/pull/42

whikloj commented 1 year ago

Now resolved with https://github.com/whikloj/BagItTools/commit/b2ccb773c5f63ef0244bd90090d325a4ec461b98 🎉