You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
duckdb-swift bindings are not building on linux with open source swift-foundation due to differences in the interface of Decimal type:
// Interface on Apple platforms
publicstructDecimal:@uncheckedSendable{publicinit()publicinit(_exponent:Int32, _length:UInt32, _isNegative:UInt32, _isCompact:UInt32, _reserved:UInt32, _mantissa:(UInt16,UInt16,UInt16,UInt16,UInt16,UInt16,UInt16,UInt16))publicvar_exponent:Int32publicvar_length:UInt32publicvar_isNegative:UInt32publicvar_isCompact:UInt32publicvar_reserved:UInt32publicvar_mantissa:(UInt16,UInt16,UInt16,UInt16,UInt16,UInt16,UInt16,UInt16)}
// Open source foundation interface
publicstructDecimal:Sendable{publictypealiasMantissa=(UInt16,UInt16,UInt16,UInt16,UInt16,UInt16,UInt16,UInt16)publicinit(mantissa:UInt64, exponent:Int16, isNegative:Bool)publicinit()}
Workaround
I managed to compile the bindings by typecasting to a locally declared type, with a matching memory layout and copying over few required bits of the interface: Decimal+Linux.swift. While this workaround would break, if the underlying implementation changes - the typecasting could be covered few tests.
What happens?
Issue
duckdb-swift bindings are not building on linux with open source swift-foundation due to differences in the interface of
Decimal
type:Workaround
I managed to compile the bindings by typecasting to a locally declared type, with a matching memory layout and copying over few required bits of the interface: Decimal+Linux.swift. While this workaround would break, if the underlying implementation changes - the typecasting could be covered few tests.
Resources
To Reproduce
To reproduce - simply try building
duckdb-swift
on any platform which uses open source version ofFoundation
framework.OS:
aarch64, debian 12
DuckDB Version:
latest
DuckDB Client:
Swift 6.0.3
Hardware:
No response
Full Name:
Arturs Krumins
Affiliation:
none
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a source build
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
The text was updated successfully, but these errors were encountered: