Bug 215968

Summary: [WinCairo] Can't load xml2.dll and xslt.dll in v2020.08.20 of WebKitRequirementsWin64.zip
Product: WebKit Reporter: Kagami Sascha Rosylight <saschanaz>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: don.olmstead, Hironori.Fujii, stephan.szabo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
output of dependencies.exe -chain
none
./Dependencies.exe -chain none

Description Kagami Sascha Rosylight 2020-08-28 20:34:55 PDT
TestWebKit.exe fails with this message:

```
TestWebKit can't open.
::LoadLibraryW failed:
path=C:\Users\Kagami\Downloads\266319\TestWebKitLib.dll
The specified module could not be found.
```

This happens regardless of existence of WinCairoRequirements dlls. Somehow jsc.exe is the only executable that runs without errors.

I have a full Visual Studio 2019 installation, and followed "Download build artifacts from Buildbot" from https://trac.webkit.org/wiki/BuildingCairoOnWindows#DownloadbuildartifactsfromBuildbot.
Comment 1 Fujii Hironori 2020-08-28 23:55:57 PDT
Could you check what is the missing DLL by using Dependencies?
https://github.com/lucasg/Dependencies
Comment 2 Kagami Sascha Rosylight 2020-08-29 04:38:37 PDT
Dependencies does not support LoadLibrary:

> Dynamic loading via LoadLibrary are not supported (and probably won't ever be).

... and thus I could not find any problem with Dependencies. It only shows five system DLLs (SHLWAPI.dll, user32.dll, kernel32.dll, MSVC140.dll, VCRUNTIME140.dll) and five api-ms-win-crt ones.
Comment 3 Fujii Hironori 2020-08-29 12:37:43 PDT
Oh, right. those exe files are using LoadLibrary.
Open TestWebKitLib.dll and MiniBrowserLib.dll instead of exe files.
Comment 4 Kagami Sascha Rosylight 2020-08-29 12:45:14 PDT
Oops, did it and found these four DLLs are missing:

ext-ms-win-core-winrt-remote-l1-1-0.dll
ext-ms-win-com-apartmentrestriction-l1-1-0.dll
ext-ms-win-com-suspendresiliency-l1-1-0.dll
ext-ms-win-ro-typeresolution-l1-1-0.dll
Comment 5 Fujii Hironori 2020-08-29 13:09:48 PDT
Created attachment 407546 [details]
output of dependencies.exe -chain

This is my result. I think NOT_FOUND of ext-* is not problem. 
However, the difference is ext-ms-win-com-apartmentrestriction-l1-1-0.dll is not in my list.
Comment 6 Kagami Sascha Rosylight 2020-08-29 13:20:56 PDT
Created attachment 407547 [details]
./Dependencies.exe -chain

Attaching mine. Huge and hard to diff, hmm.
Comment 7 Kagami Sascha Rosylight 2020-08-29 13:30:30 PDT
BTW, TestWebKitLib.dll is clean and my attached result is from MiniBrowserLib.dll.

Not sure why it still fails to load TestWebKitLib.dll.
Comment 8 Fujii Hironori 2020-08-29 13:35:52 PDT
I'm sorry. I was checking old revision. I tried the same revision and fails to load MiniBrowser.

https://s3-us-west-2.amazonaws.com/archives.webkit.org/wincairo-x86_64-release/266319.zip
https://github.com/WebKitForWindows/WebKitRequirements/releases/tag/v2020.08.20

dependencies.exe correctly points out what are the missing DLL.
xml2.dll (NOT_FOUND)
xslt.dll (NOT_FOUND)

Those dll files are missing in v2020.08.20 of WebKitRequirementsWin64.zip.
Comment 9 Fujii Hironori 2020-08-29 13:41:20 PDT
Use CMake files from upstream libxml2 repo (#36) · WebKitForWindows/WebKitRequirements@5429437
https://github.com/WebKitForWindows/WebKitRequirements/commit/5429437e8c3e59cf1c6cdbda313acfd70237bf08

Use CMake files from upstream libxslt repo (#37) · WebKitForWindows/WebKitRequirements@15c71c4
https://github.com/WebKitForWindows/WebKitRequirements/commit/15c71c4cb8b48d601a2016ab816ce31298d6e3d1

These changes seem the culprit.
Comment 10 Don Olmstead 2020-08-29 13:55:59 PDT
The name of the dlls changed from xml2.dll to libxml2.dll. Those files are from the upstream repositories so they should probably be fixed so the prefix isn't there on windows.
Comment 11 Fujii Hironori 2020-08-29 14:02:50 PDT
WinCairo bot still has stale import libs for xml2 and xslt.
I confirmed copying xml2.dll and xslt.dll from the previous WebKitRequirements can work around the loading issue.

https://github.com/WebKitForWindows/WebKitRequirements/releases/tag/v2020.07.01
Comment 12 Stephan Szabo 2020-08-31 11:37:13 PDT
The old versions should now be gone on the builders, so builds starting with 266357 appear from dependencies -chain to be referring to libxml2 and libxslt.

We still need to make dealing with dependency removal/rename more automatic than needing to clear out the dependencies directory manually.
Comment 13 Fujii Hironori 2020-08-31 12:56:38 PDT
Yeah, it works. Thank you, Steph. Closed this bug.
Comment 14 Radar WebKit Bug Importer 2020-08-31 12:57:19 PDT
<rdar://problem/68093827>