diff --git a/ManagedWimLib.Tests/ManagedWimLib.Tests.csproj b/ManagedWimLib.Tests/ManagedWimLib.Tests.csproj index 49a60f8..53cfc49 100644 --- a/ManagedWimLib.Tests/ManagedWimLib.Tests.csproj +++ b/ManagedWimLib.Tests/ManagedWimLib.Tests.csproj @@ -1,11 +1,19 @@  - net48;net5.0; - net5.0; + + net48;net6.0 + + net6.0 + + net6.0 false + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/ManagedWimLib.Tests/TestSetup.cs b/ManagedWimLib.Tests/TestSetup.cs index b47e137..de8853e 100644 --- a/ManagedWimLib.Tests/TestSetup.cs +++ b/ManagedWimLib.Tests/TestSetup.cs @@ -140,7 +140,7 @@ public static class TestHelper #region Temp Path private static int _tempPathCounter = 0; private static readonly object TempPathLock = new object(); - private static readonly RNGCryptoServiceProvider SecureRandom = new RNGCryptoServiceProvider(); + private static readonly RandomNumberGenerator SecureRandom = RandomNumberGenerator.Create(); private static FileStream _lockFileStream = null; private static string _baseTempDir = null; diff --git a/ManagedWimLib/ManagedWimLib.csproj b/ManagedWimLib/ManagedWimLib.csproj index d87e993..75cd4e5 100644 --- a/ManagedWimLib/ManagedWimLib.csproj +++ b/ManagedWimLib/ManagedWimLib.csproj @@ -6,19 +6,18 @@ ManagedWimLib latest true - 2.2.0 + 2.3.0 Eric Biggers, Hajin Jang Joveler Native wimlib wrapper library for .NET. Provides every capabilities of wimlib. Supports Windows, Linux and macOS. - Copyright (c) 2018-2021 Hajin Jang + Copyright (c) 2018-2022 Hajin Jang LGPL-3.0-or-later https://github.com/ied206/ManagedWimLib images\Logo.png https://github.com/ied206/ManagedWimLib - - Update included wimlib to 1.13.4. -- Fix UpdateProgress and VerifyStreamsProgress marshalling issue. + - Update included wimlib to 1.13.5. wim wimlib dism imagex archive native pinvoke interop diff --git a/ManagedWimLib/runtimes/linux-arm/native/libwim.so b/ManagedWimLib/runtimes/linux-arm/native/libwim.so index 64a80c8..b66c64f 100644 Binary files a/ManagedWimLib/runtimes/linux-arm/native/libwim.so and b/ManagedWimLib/runtimes/linux-arm/native/libwim.so differ diff --git a/ManagedWimLib/runtimes/linux-arm64/native/libwim.so b/ManagedWimLib/runtimes/linux-arm64/native/libwim.so index c9cf3d0..9a70b55 100644 Binary files a/ManagedWimLib/runtimes/linux-arm64/native/libwim.so and b/ManagedWimLib/runtimes/linux-arm64/native/libwim.so differ diff --git a/ManagedWimLib/runtimes/linux-x64/libwim.so b/ManagedWimLib/runtimes/linux-x64/libwim.so deleted file mode 100755 index 1e5f868..0000000 Binary files a/ManagedWimLib/runtimes/linux-x64/libwim.so and /dev/null differ diff --git a/ManagedWimLib/runtimes/linux-x64/native/libwim.so b/ManagedWimLib/runtimes/linux-x64/native/libwim.so index 0e3a16c..964b6c4 100644 Binary files a/ManagedWimLib/runtimes/linux-x64/native/libwim.so and b/ManagedWimLib/runtimes/linux-x64/native/libwim.so differ diff --git a/ManagedWimLib/runtimes/osx-x64/libwim.dylib b/ManagedWimLib/runtimes/osx-x64/libwim.dylib deleted file mode 100755 index 12cb1c7..0000000 Binary files a/ManagedWimLib/runtimes/osx-x64/libwim.dylib and /dev/null differ diff --git a/ManagedWimLib/runtimes/osx-x64/native/libwim.dylib b/ManagedWimLib/runtimes/osx-x64/native/libwim.dylib old mode 100644 new mode 100755 index e22070c..e983899 Binary files a/ManagedWimLib/runtimes/osx-x64/native/libwim.dylib and b/ManagedWimLib/runtimes/osx-x64/native/libwim.dylib differ diff --git a/ManagedWimLib/runtimes/win-arm64/native/libwim-15.dll b/ManagedWimLib/runtimes/win-arm64/native/libwim-15.dll index 655f2d2..068b7c6 100644 Binary files a/ManagedWimLib/runtimes/win-arm64/native/libwim-15.dll and b/ManagedWimLib/runtimes/win-arm64/native/libwim-15.dll differ diff --git a/ManagedWimLib/runtimes/win-arm64/native/libwinpthread-1.dll b/ManagedWimLib/runtimes/win-arm64/native/libwinpthread-1.dll index 0880dbd..49443b4 100644 Binary files a/ManagedWimLib/runtimes/win-arm64/native/libwinpthread-1.dll and b/ManagedWimLib/runtimes/win-arm64/native/libwinpthread-1.dll differ diff --git a/ManagedWimLib/runtimes/win-arm64/native/libxml2-2.dll b/ManagedWimLib/runtimes/win-arm64/native/libxml2-2.dll index 5a0033b..8c7c379 100644 Binary files a/ManagedWimLib/runtimes/win-arm64/native/libxml2-2.dll and b/ManagedWimLib/runtimes/win-arm64/native/libxml2-2.dll differ diff --git a/ManagedWimLib/runtimes/win-x64/native/libwim-15.dll b/ManagedWimLib/runtimes/win-x64/native/libwim-15.dll index 8a17acb..a6186f4 100644 Binary files a/ManagedWimLib/runtimes/win-x64/native/libwim-15.dll and b/ManagedWimLib/runtimes/win-x64/native/libwim-15.dll differ diff --git a/ManagedWimLib/runtimes/win-x86/native/libwim-15.dll b/ManagedWimLib/runtimes/win-x86/native/libwim-15.dll index c4d35a5..be995f5 100644 Binary files a/ManagedWimLib/runtimes/win-x86/native/libwim-15.dll and b/ManagedWimLib/runtimes/win-x86/native/libwim-15.dll differ diff --git a/README.md b/README.md index 8753539..c0dd519 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,13 @@ macOS arm64 should be supported on theory, but I do not have access to an Apple | Architecture | Distribution | Note | |--------------|--------------|------| -| x64 | Ubuntu 18.04 | Tested on AppVeyor CI | -| arm | Debian 10 | Emulated on QEMU's virt board | -| arm64 | Debian 10 | Emulated on QEMU's virt board | +| x64 | Ubuntu 20.04 | Tested on AppVeyor CI | +| arm | Debian 11 | Emulated on QEMU's virt board | +| arm64 | Debian 11 | Emulated on QEMU's virt board | ### Supported wimlib version -- 1.13.4 (Included) +- 1.13.5 (Included) ## Usage diff --git a/USAGE.md b/USAGE.md index b14bdca..0942bfe 100644 --- a/USAGE.md +++ b/USAGE.md @@ -107,10 +107,10 @@ ManagedWimLib comes with sets of binaries of `wimlib 1.13.4`. They will be copie | Windows x86 | `$(OutDir)\runtimes\win-x86\native\libwim-15.dll` | LGPLv3 | | Windows x64 | `$(OutDir)\runtimes\win-x64\native\libwim-15.dll` | LGPLv3 | | Windows arm64 | `$(OutDir)\runtimes\win-arm64\native\libwim-15.dll` | LGPLv3 | -| Ubuntu 18.04 x64 | `$(OutDir)\runtimes\linux-x64\native\libwim.so` | LGPLv3 (w/o NTFS-3G) | -| Debian 10 armhf | `$(OutDir)\runtimes\linux-arm\native\libwim.so` | LGPLv3 (w/o NTFS-3G) | -| Debian 10 arm64 | `$(OutDir)\runtimes\linux-arm64\native\libwim.so` | LGPLv3 (w/o NTFS-3G) | -| macOS 10.15 x64 | `$(OutDir)\runtimes\osx-x64\native\libwim.dylib` | LGPLv3 (w/o NTFS-3G) | +| Ubuntu 20.04 x64 | `$(OutDir)\runtimes\linux-x64\native\libwim.so` | LGPLv3 (w/o NTFS-3G) | +| Debian 11 armhf | `$(OutDir)\runtimes\linux-arm\native\libwim.so` | LGPLv3 (w/o NTFS-3G) | +| Debian 11 arm64 | `$(OutDir)\runtimes\linux-arm64\native\libwim.so` | LGPLv3 (w/o NTFS-3G) | +| macOS Big Sur x64 | `$(OutDir)\runtimes\osx-x64\native\libwim.dylib` | LGPLv3 (w/o NTFS-3G) | - Linux binaries are not portable. Included binaires may not work on your distribution. - On Linux, wimlib depends on system-installed `libfuse`. @@ -120,15 +120,15 @@ ManagedWimLib comes with sets of binaries of `wimlib 1.13.4`. They will be copie #### Build Command -| Platform | Binary Source | Dependency | -|------------------|---------------------------------------------------------------------------------------|-----------------| -| Windows x86 | [Official Release](https://wimlib.net/downloads/wimlib-1.13.3-windows-i686-bin.zip) | - | -| Windows x64 | [Official Release](https://wimlib.net/downloads/wimlib-1.13.3-windows-x86_64-bin.zip) | - | -| Windows arm64 | Compile with MSYS2 and llvm-mingw | - | -| Ubuntu 18.04 x64 | Compile with libxml2 dependency | libfuse | -| Debian 10 armhf | Compile with libxml2 dependency | libfuse | -| Debian 10 arm64 | Compile with libxml2 dependency | libfuse | -| macOS 10.15 | Compile with libxml2 dependency | - | +| Platform | Binary Source | Dependency | +|-------------------|---------------------------------------------------------------------------------------|-----------------| +| Windows x86 | [Official Release](https://wimlib.net/downloads/wimlib-1.13.3-windows-i686-bin.zip) | - | +| Windows x64 | [Official Release](https://wimlib.net/downloads/wimlib-1.13.3-windows-x86_64-bin.zip) | - | +| Windows arm64 | Compile with MSYS2 and llvm-mingw | - | +| Ubuntu 20.04 x64 | Compile with libxml2 dependency | libfuse | +| Debian 11 armhf | Compile with libxml2 dependency | libfuse | +| Debian 11 arm64 | Compile with libxml2 dependency | libfuse | +| macOS Big Sur x64 | Compile with libxml2 dependency | - | ### Custom binary diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 722b6d6..e355db0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -23,10 +23,10 @@ variables: steps: - task: UseDotNet@2 - displayName: 'Install .NET SDK 5.0' + displayName: 'Install .NET SDK 6.0' inputs: packageType: 'sdk' - version: '5.0.x' + version: '6.0.x' - task: DotNetCoreCLI@2 displayName: 'Restore Nuget Pacakges' inputs: diff --git a/native/windows/README.md b/native/windows/README.md index 9c39d4a..5f3b7e7 100644 --- a/native/windows/README.md +++ b/native/windows/README.md @@ -5,7 +5,6 @@ Use MSYS2 and llvm-mingw to compile ARM64 wimlib dll. ## Status - `libwim-15.dll` is compilable with a bit of a patch. -- `ld.lld` fails to link `wimlib-imagex.exe`. ## Required Tools @@ -17,19 +16,23 @@ Use MSYS2 and llvm-mingw to compile ARM64 wimlib dll. ## Required Sources -- [libxml2](http://www.xmlsoft.org/downloads.html): Tested with 2.9.10. -- [wimlib](https://wimlib.net/downloads/index.html): Tested with 1.13.3. +- [libxml2](http://www.xmlsoft.org/downloads.html): Tested with 2.9.12. +- [wimlib](https://wimlib.net/downloads/index.html): Tested with 1.13.5. ## Build Manual 1. Extract the `libxml2` and `wimlib` source code. 1. Open MSYS2 MinGW 64bit shell. 1. Apply `patch/libxml2-llvm-linker.patch` to `libxml2` source. + ``` + cd /d/build/native/libxml2-2.9.12 + patch -p1 < /d/build/ManagedWimLib/native/windows/patch/libxml2-llvm-linker.patch + ``` 1. Build `libxml2` by running `libxml2-msys2.sh`. - You must pass a path of `llvm-mingw` to compile ARM64 binaries. ``` [Examples] - aarch64: ./libxml2-msys2.sh.sh -a aarch64 -t /c/llvm-mingw /d/build/native/libxml2- + aarch64: ./libxml2-msys2.sh -a aarch64 -t /c/llvm-mingw /d/build/native/libxml2-2.9.12 ``` 1. Edit `include/wimlib.h` of `wimlib` source. - Define `WIMLIBAPI` as `__declspec(dllexport)`. @@ -72,7 +75,7 @@ Fortunately, @jeremyd2019 found a solution: borrow `libxslt`'s linker detection ### Why clang refuses to build vanilla wimlib? -Clang requires every function symbols have consistency on dllimport/dllexport-ness ([ref1](https://github.com/llvm-mirror/clang/blob/master/test/Sema/dllexport.c), [ref2](http://clang-developers.42468.n3.nabble.com/Latest-clang-shows-failure-in-redeclaration-with-dllimport-td4045316.html), while GCC and MSVC allows this behavior. +Clang requires every function symbols have consistency on dllimport/dllexport-ness ([ref1](https://github.com/llvm-mirror/clang/blob/master/test/Sema/dllexport.c), [ref2](http://clang-developers.42468.n3.nabble.com/Latest-clang-shows-failure-in-redeclaration-with-dllimport-td4045316.html)), while GCC and MSVC allows this behavior. For example, GCC allows this code, while CLANG throws an error. @@ -95,8 +98,10 @@ wimlib_free(WIMStruct *wim); ## Unsolvable issues -#### Unable to build wimlib-imagex.exe -- llvm-mingw fails to link `wimlib-imagex.exe`, but I couldn't know why. +### Unable to build wimlib-imagex.exe + +- llvm-mingw (LLVM 11.0.0) fails to link `wimlib-imagex.exe`, but I couldn't know why. + - Latest LLVM 13 succesfully builds `wimlib-imagex.exe`. ``` CCLD libwim.la CCLD wimlib-imagex.exe @@ -105,6 +110,9 @@ wimlib_free(WIMStruct *wim); clang-11: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [Makefile:1318: wimlib-imagex.exe] Error 1 ``` + +### Unable to link static libxml2 + - libtool refuses to link `wimlib` with static `libxml2`. ``` *** Warning: Trying to link with static lib archive . diff --git a/native/windows/libxml2-msys2.sh b/native/windows/libxml2-msys2.sh index fa72176..0ad5dd2 100644 --- a/native/windows/libxml2-msys2.sh +++ b/native/windows/libxml2-msys2.sh @@ -55,7 +55,7 @@ CORES=$(grep -c ^processor /proc/cpuinfo) # Create prefix directory LIB_PREFIX="${BASE_DIR}/build-prefix-${ARCH}" -mkdir "${LIB_PREFIX}" +mkdir -p "${LIB_PREFIX}" # Compile libxml2 # Adapted from https://wimlib.net/git/?p=wimlib;a=tree;f=tools/windeps/Makefile;