Conversation
|
@microsoft-github-policy-service agree |
|
@gfs I think this is ready to go now. All the tests are passing, it just needs checking over to see if you think the LTRData fork of DiscUtils is ready for use. |
|
@Erik-White awesome. I'm running pipeline tests now and I'll aim to give this a thorough review tomorrow. |
|
/azp run |
|
Azure Pipelines failed to run 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
gfs
left a comment
There was a problem hiding this comment.
LGTM. Thanks @Erik-White for the contribution!
|
Implemented DMG extractor and added compatible DMG file. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Test failure is related to different invalid path character definitions between net4.8 and net core. See dotnet/runtime#63383. Will aim to determine which character is the issue and develop a new sample tomorrow. |
|
The problem with the DMG test is due to a file entry that has an invalid character in the name: We end up calling Path.Combine from DiscUtils and I wonder if that helper method should maybe have a conditional that excludes .NET framework i.e. The other option is to change the file entry name in the test data, but I'm not sure what's best. Is this a scenario that needs to be tested? |
This is an issue I've had to resolve at other times in Recursive Extractor in order to be able to use Path.Combine - .I think I see a couple options here:
Either way its likely prudent to add some extra exception handling as this exception bubbling up to the user does violate one of the design principles I try to follow for this project - that in general unparseable/malformed archives should not throw exceptions. https://github.com/microsoft/RecursiveExtractor/#exceptions As for if this case is needed - we need a test case for DMG parsing, but this file in particular is not special. However, this file does represent a relatively naiive DMG that I imagine someone may create, so it would be nice if we could support it, and it would be nice to keep feature parity as much as possible between different runtimes. I think the ideal solution is probably option 1, perhaps using a mechanism like the one I linked above in |
|
@Erik-White, got a chance to look at the discutils code you linked. I think I agree the simplest fix may be to change #if NET461_OR_GREATER || NETSTANDARD || NETCOREAPP
return Path.Combine(a, b);
#elseto #if NETSTANDARD || NETCOREAPP
return Path.Combine(a, b);
#else |
|
I found the two locations with the differing lists of invalid path chars. Net 4.8: https://referencesource.microsoft.com/#mscorlib/system/io/pathinternal.cs,32 At a minimum it looks like at least |
Sorry, I should have been clearer, I meant characters that affected the failing test 😃 Changing to
|
Ah okay, yes, sorry missed what you meant. It also doesn't appear to me either that we have any of those characters here (perhaps the \r at the end of what you clipped above?). I opened a PR with the change here, and validated locally by referencing the net code from recursive extractor that it seems to resolve the test issue with net4.8: LTRData/DiscUtils#4 . all the DiscUtils tests still pass without modification - but it would be hard for me to speak if it had some other unintended effect not covered by the tests. I dont think it has any negative impact for other recursive extractor paths as this should only effect net4.8 and testing indicates this resolves the issue. I'm not totally sure on if netstandard should be included in the directive or not, I think there's a reasonable argument to only use Path.Combine on netcoreapp, but I think this is the minimal change which resolves the issue we see here. |
|
Nice! We just need DiscUtils with the latest fix and then hopefully it's all good to go |
|
Your fix is now in with the latest DiscUtils and the tests are green! Everything looks good from my side, nice work with the DmgExtractor 🥇 |
|
Nice. I'll give it one more look over and likely merge today. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Thanks again @Erik-White for your contribution! |
|
Fantastic, thanks for all your work on this project! |
Closes #144, fixes #93, fixes #59
The current fork of DiscUtils is almost abandoned at this point. The LTRData fork is much further ahead and has made some great performance improvements and bug fixes. Moving to the newer fork would help resolve some existing issues, as well as make future fixes much easier to resolve.