tristanlabelle / swift-winui-sample

A sample WinUI app written in Swift
MIT License
0 stars 0 forks source link

Failed to build due to issue with: WindowsFoundation_IPropertyValue #3

Open Noemata opened 2 hours ago

Noemata commented 2 hours ago

Looks like I'm most of the way there on this project. Unfortunately, I ran into the following:

[build] D:\Swift\swift-winui-sample\build\debug\Dependencies\WinRT\Sources\UWP\Projection\WindowsFoundation\WindowsFoundation_IPropertyValue.swift:7:28: error: type alias 'WindowsFoundation_IPropertyValue' (aka 'any WindowsFoundation_IPropertyValueProtocol') cannot be imported as 'protocol' [build] 5 | import UWP_ABI [build] 6 | @_exported import protocol WindowsRuntime.WindowsFoundation_IPropertyValueProtocol [build] 7 | @_exported import protocol WindowsRuntime.WindowsFoundation_IPropertyValue [build] | `- error: type alias 'WindowsFoundation_IPropertyValue' (aka 'any WindowsFoundation_IPropertyValueProtocol') cannot be imported as 'protocol' [build] [build] D:\Swift\swift-winui-sample\build\debug\Dependencies\NuGet\TristanLabelle.SwiftWinRT.0.0.0.1\swift\WindowsRuntime\Projection\WindowsFoundation\WindowsFoundation_IPropertyValue.swift:2:18: note: 'WindowsFoundation_IPropertyValue' declared here [build] 1 | /// Represents a value in a property store. You can't implement this interface, see Remarks.

[build] [build] 2 | public typealias WindowsFoundation_IPropertyValue = any WindowsFoundation_IPropertyValueProtocol

[build] [build] | `- note: 'WindowsFoundation_IPropertyValue' declared here [build] 3 |

[build] [build] 4 | /// Represents a value in a property store. You can't implement this interface, see Remarks.

[build] [build] [build] D:\Swift\swift-winui-sample\build\debug\Dependencies\WinRT\Sources\UWP\Projection\WindowsFoundation\WindowsFoundation_IReference.swift:7:28: error: type alias 'WindowsFoundation_IReference' (aka 'any WindowsFoundation_IReferenceProtocol') cannot be imported as 'protocol' [build] 5 | import UWP_ABI [build] 6 | @_exported import protocol WindowsRuntime.WindowsFoundation_IReferenceProtocol [build] 7 | @_exported import protocol WindowsRuntime.WindowsFoundation_IReference [build] | `- error: type alias 'WindowsFoundation_IReference' (aka 'any WindowsFoundation_IReferenceProtocol') cannot be imported as 'protocol' [build] [build] D:\Swift\swift-winui-sample\build\debug\Dependencies\NuGet\TristanLabelle.SwiftWinRT.0.0.0.1\swift\WindowsRuntime\Projection\WindowsFoundation\WindowsFoundation_IReference.swift:6:18: note: 'WindowsFoundation_IReference' declared here [build] 4 | /// - Boxing primitives, value types and delegates to IInspectable.

[build] [build] 5 | /// - Providing a representation for nullable primitives, value types and delegates (since reference types can be null).

[build] [build] 6 | public typealias WindowsFoundation_IReference = any WindowsFoundation_IReferenceProtocol

[build] [build] | `- note: 'WindowsFoundation_IReference' declared here [build] 7 |

[build] [build] 8 | /// Enables arbitrary enumerations, structures, and delegate types to be used as property values.

[build] [build] [build] D:\Swift\swift-winui-sample\build\debug\Dependencies\WinRT\Sources\UWP\Projection\WindowsFoundation\WindowsFoundation_IStringable.swift:7:28: error: type alias 'WindowsFoundation_IStringable' (aka 'any WindowsFoundation_IStringableProtocol') cannot be imported as 'protocol' [build] 5 | import UWP_ABI [build] 6 | @_exported import protocol WindowsRuntime.WindowsFoundation_IStringableProtocol [build] 7 | @_exported import protocol WindowsRuntime.WindowsFoundation_IStringable [build] | `- error: type alias 'WindowsFoundation_IStringable' (aka 'any WindowsFoundation_IStringableProtocol') cannot be imported as 'protocol' [build] [build] D:\Swift\swift-winui-sample\build\debug\Dependencies\NuGet\TristanLabelle.SwiftWinRT.0.0.0.1\swift\WindowsRuntime\Projection\WindowsFoundation\WindowsFoundation_IStringable.swift:2:18: note: 'WindowsFoundation_IStringable' declared here [build] 1 | /// Provides a way to represent the current object as a string.

[build]

[build] 2 | public typealias WindowsFoundation_IStringable = any WindowsFoundation_IStringableProtocol

[build]

[build] | `- note: 'WindowsFoundation_IStringable' declared here

[build] 3 |

[build]

[build] 4 | /// Provides a way to represent the current object as a string.

[build]

[build] ninja: build stopped: subcommand failed.

Noemata commented 2 hours ago

I removed the lock file flags:

execute_process( COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/nuget.exe restore -Verbosity quiet -PackagesDirectory ${CMAKE_CURRENT_BINARY_DIR} -ConfigFile ${CMAKE_CURRENT_SOURCE_DIR}/nuget.config ${CMAKE_CURRENT_SOURCE_DIR}/packages.config COMMAND_ERROR_IS_FATAL ANY)

Noemata commented 2 hours ago

Oh, and changed packages.config for TristanLabelle.SwiftWinRT to match with generated file in swift-winrt:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Windows.SDK.Contracts" version="10.0.19041.2" />
  <package id="Microsoft.WindowsAppSDK" version="1.6.240829007" />
  <package id="Microsoft.Web.WebView2" version="1.0.2739.15" /> <!-- WinUI dependency -->
  <package id="TristanLabelle.SwiftWinRT" version="0.0.0.1" />
</packages>
Noemata commented 1 hour ago

Not sure if this helps, but:

https://learn.microsoft.com/en-us/uwp/api/windows.foundation.ipropertyvalue?view=winrt-26100

"You can't implement the IPropertyValue interface or include it in a signature. IPropertyValue is mainly an internal implementation detail of how the Windows Runtime implements boxing and nullable values."