encodeEncodable/decodeDecodable

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

Had a crack on this, is anyone able to test this on Linux?

···

On 20 Sep 2017, at 23:30, Luke Howard via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

Hi Luke,

Thanks for putting this together! Do you mind putting that up as a [pull request](https://github.com/apple/swift-corelibs-foundation/pulls\) so we can review it more formally and run it through CI?

— Itai

···

On 22 Sep 2017, at 19:53, Luke Howard via swift-corelibs-dev wrote:

Had a crack on this, is anyone able to test this on Linux?

[SR-5970] merge encodeEncodable/decodeDecodable from stdlib · lhoward/swift-corelibs-foundation@8f8d16c · GitHub

On 20 Sep 2017, at 23:30, Luke Howard via swift-corelibs-dev >> <swift-corelibs-dev@swift.org> wrote:

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Hi Itai,

Pull request is here <https://github.com/apple/swift-corelibs-foundation/pull/1237&gt;, unfortunately tests are failing on Linux. I’m still trying to get Swift built on Linux so I can investigate (didn’t have any luck using the prebuilt binaries to build Foundation).

Cheers,
Luke

···

On 26 Sep 2017, at 06:24, Itai Ferber <iferber@apple.com> wrote:

Hi Luke,

Thanks for putting this together! Do you mind putting that up as a pull request <https://github.com/apple/swift-corelibs-foundation/pulls&gt; so we can review it more formally and run it through CI?

— Itai

On 22 Sep 2017, at 19:53, Luke Howard via swift-corelibs-dev wrote:

Had a crack on this, is anyone able to test this on Linux?

[SR-5970] merge encodeEncodable/decodeDecodable from stdlib · lhoward/swift-corelibs-foundation@8f8d16c · GitHub

On 20 Sep 2017, at 23:30, Luke Howard via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

Still having trouble building it on Linux – I did kind of get it built from swift-4.0-branch, but didn’t have a working lldb so was difficult to debug (except by printf). Currently appear to be running into SR-5938 when trying to build from master.

···

On 26 Sep 2017, at 09:37, Luke Howard via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Hi Itai,

Pull request is here <https://github.com/apple/swift-corelibs-foundation/pull/1237&gt;, unfortunately tests are failing on Linux. I’m still trying to get Swift built on Linux so I can investigate (didn’t have any luck using the prebuilt binaries to build Foundation).

Cheers,
Luke

On 26 Sep 2017, at 06:24, Itai Ferber <iferber@apple.com <mailto:iferber@apple.com>> wrote:

Hi Luke,

Thanks for putting this together! Do you mind putting that up as a pull request <https://github.com/apple/swift-corelibs-foundation/pulls&gt; so we can review it more formally and run it through CI?

— Itai

On 22 Sep 2017, at 19:53, Luke Howard via swift-corelibs-dev wrote:

Had a crack on this, is anyone able to test this on Linux?

[SR-5970] merge encodeEncodable/decodeDecodable from stdlib · lhoward/swift-corelibs-foundation@8f8d16c · GitHub

On 20 Sep 2017, at 23:30, Luke Howard via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

Hi Luke,

Thanks for putting this together! In the meantime, CI testing has highlighted an issue that will need to be solved before this can be pulled in — namely that `NSKeyedUnarchiver` is currently incomplete as it does not implement or override `failWithError` properly.
This is something we’ll need to do in order to support this properly.

— Itai

···

On 27 Sep 2017, at 7:35, Luke Howard wrote:

Still having trouble building it on Linux – I did kind of get it built from swift-4.0-branch, but didn’t have a working lldb so was difficult to debug (except by printf). Currently appear to be running into SR-5938 when trying to build from master.

On 26 Sep 2017, at 09:37, Luke Howard via swift-corelibs-dev >> <swift-corelibs-dev@swift.org> wrote:

Hi Itai,

Pull request is here <https://github.com/apple/swift-corelibs-foundation/pull/1237&gt;, unfortunately tests are failing on Linux. I’m still trying to get Swift built on Linux so I can investigate (didn’t have any luck using the prebuilt binaries to build Foundation).

Cheers,
Luke

On 26 Sep 2017, at 06:24, Itai Ferber <iferber@apple.com >>> <mailto:iferber@apple.com>> wrote:

Hi Luke,

Thanks for putting this together! Do you mind putting that up as a pull request <https://github.com/apple/swift-corelibs-foundation/pulls&gt; so we can review it more formally and run it through CI?

— Itai

On 22 Sep 2017, at 19:53, Luke Howard via swift-corelibs-dev wrote:

Had a crack on this, is anyone able to test this on Linux?

[SR-5970] merge encodeEncodable/decodeDecodable from stdlib · lhoward/swift-corelibs-foundation@8f8d16c · GitHub

On 20 Sep 2017, at 23:30, Luke Howard via swift-corelibs-dev >>>> <swift-corelibs-dev@swift.org >>>> <mailto:swift-corelibs-dev@swift.org>> wrote:

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

Hi Itai,

I’ve done something for failWithError on Darwin, you should see it in the pull request. Still blocked on Linux, getting Swift to build.

Cheers,
Luke

···

On 28 Sep 2017, at 05:57, Itai Ferber <iferber@apple.com> wrote:

Hi Luke,

Thanks for putting this together! In the meantime, CI testing has highlighted an issue that will need to be solved before this can be pulled in — namely that NSKeyedUnarchiver is currently incomplete as it does not implement or override failWithError properly.
This is something we’ll need to do in order to support this properly.

— Itai

On 27 Sep 2017, at 7:35, Luke Howard wrote:

Still having trouble building it on Linux – I did kind of get it built from swift-4.0-branch, but didn’t have a working lldb so was difficult to debug (except by printf). Currently appear to be running into SR-5938 when trying to build from master.

On 26 Sep 2017, at 09:37, Luke Howard via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

Hi Itai,

Pull request is here <https://github.com/apple/swift-corelibs-foundation/pull/1237&gt;, unfortunately tests are failing on Linux. I’m still trying to get Swift built on Linux so I can investigate (didn’t have any luck using the prebuilt binaries to build Foundation).

Cheers,
Luke

On 26 Sep 2017, at 06:24, Itai Ferber <iferber@apple.com <mailto:iferber@apple.com>> wrote:

Hi Luke,

Thanks for putting this together! Do you mind putting that up as a pull request <https://github.com/apple/swift-corelibs-foundation/pulls&gt; so we can review it more formally and run it through CI?

— Itai

On 22 Sep 2017, at 19:53, Luke Howard via swift-corelibs-dev wrote:

Had a crack on this, is anyone able to test this on Linux?

[SR-5970] merge encodeEncodable/decodeDecodable from stdlib · lhoward/swift-corelibs-foundation@8f8d16c · GitHub

On 20 Sep 2017, at 23:30, Luke Howard via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

I’m fairly out of touch with Swift these days, but I took a quick look at importing the encodeEncodable/decodeDecodable changes from stdlib into SwiftFoundation.

I ran into a bunch of bridging issues with the PropertyListDecoder, where it would be balk on the encoded property list types being Foundation instead of Swift types (e.g. “Expected to decode Dictionary<String, Any> but found a dictionary instead”).

Not sure the best way to workaround these: I started doing so explicitly in the unbox methods, but it didn’t feel intuitively right (apart from all the boilerplate code, sometimes the input value would be a Foundation object, other times not). I haven’t had time to investigate further.

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;
_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;

Luke Howard
web <http://lukehoward.com/&gt; / facebook <https://www.facebook.com/lukehowardmusic&gt; / soundcloud <https://soundcloud.com/lukehoward/&gt; / spotify <Spotify – Web Player;