Commit e3abe4b
authored
[libzip-windows] Fix building with
Whenever `external/mono` is bumped, the
[`xamarin-android-msbuild` job breaks][0]:
[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-msbuild/838/
Building target "_Make" completely.
...
Task "Touch" (TaskId:1642)
Task Parameter:
Files=
…/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/x64/libzip.dll
CMake=/Users/builder/android-toolchain/mxe-b9cbb53/bin/x86_64-w64-mingw32.static-cmake
CMakeFlags=
CopyToOutputDirectory=Always
OutputLibrary=x64/libzip.dll
OutputLibraryPath=lib/libzip.dll
…/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/libzip.dll
CMake=/Users/builder/android-toolchain/mxe-b9cbb53/bin/i686-w64-mingw32.static-cmake
CMakeFlags=
CopyToOutputDirectory=Always
OutputLibrary=libzip.dll
OutputLibraryPath=lib/libzip.dll (TaskId:1642)
Touching "…/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/x64/libzip.dll". (TaskId:1642)
…/build-tools/libzip/libzip.targets(52,5): error MSB3375: The file "…/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/libzip.dll" does not exist. […/build-tools/libzip-windows/libzip-windows.csproj]
Done executing task "Touch" -- FAILED. (TaskId:1642)
This is due to an "`xbuild`-ism" we were inadvertently using which
`msbuild` doesn't like: when item metadata is used in
`//Target/@Inputs`, [MSBuild Target Batching][1] is *not* used.
[1]: https://msdn.microsoft.com/en-us/library/ms171473.aspx
Case in point, the `_Make` target:
<!-- BAD! -->
<Target Name="_Make"
Condition=" '@(_LibZipTarget)' != '' "
Inputs="$(IntermediateOutputPath)\%(_LibZipTarget.Identity)\Makefile"
Outputs="@(Content)">
Because this used "inline" item metadata, the target wasn't being
batched as intended (and as `xbuild` does). Consequently,
`@(_LibZipTarget)` was only being built for mxe-Win64, *not*
mxe-Win32, which is why the `<Touch/>` use within the `_Make` target
failed.
The fix? Don't Do That™. Instead, use a new `@(_LibZipTargetMakefile)`
item group for the `//Target/@Inputs`, which allows `msbuild` to
properly batch the `_Make` target contents:
<ItemGroup>
<_LibZipTargetMakefile Include="$(IntermediateOutputPath)\%(_LibZipTarget.Identity)\Makefile" />
</ItemGroup>
<Target Name="_Make"
Condition=" '@(_LibZipTarget)' != '' "
Inputs="@(_LibZipTargetMakefile)"
Outputs="@(Content)">
Review other files matching `git grep 'Inputs=.*%'` and fix them too.msbuild (#1491)1 parent 0f0f783 commit e3abe4b
File tree
3 files changed
+24
-11
lines changed- build-tools/api-xml-adjuster
- src
- libzip
- mono-runtimes
3 files changed
+24
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
20 | | - | |
21 | | - | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
35 | | - | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | | - | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
789 | 794 | | |
790 | 795 | | |
791 | 796 | | |
792 | 797 | | |
793 | 798 | | |
794 | 799 | | |
795 | | - | |
796 | | - | |
| 800 | + | |
| 801 | + | |
797 | 802 | | |
798 | 803 | | |
799 | 804 | | |
| |||
802 | 807 | | |
803 | 808 | | |
804 | 809 | | |
805 | | - | |
| 810 | + | |
806 | 811 | | |
807 | 812 | | |
808 | 813 | | |
809 | 814 | | |
810 | 815 | | |
811 | 816 | | |
812 | 817 | | |
813 | | - | |
814 | | - | |
| 818 | + | |
| 819 | + | |
815 | 820 | | |
816 | 821 | | |
817 | 822 | | |
| |||
826 | 831 | | |
827 | 832 | | |
828 | 833 | | |
829 | | - | |
| 834 | + | |
830 | 835 | | |
831 | 836 | | |
832 | 837 | | |
| |||
0 commit comments