Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8259] Make PropertyListDecoder available on Linux #3665

Closed
keith opened this issue Jul 14, 2018 · 5 comments
Closed

[SR-8259] Make PropertyListDecoder available on Linux #3665

keith opened this issue Jul 14, 2018 · 5 comments

Comments

@keith
Copy link
Contributor

keith commented Jul 14, 2018

Previous ID SR-8259
Radar None
Original Reporter @keith
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 4
Component/s Foundation
Labels Improvement, Codable
Assignee None
Priority Medium

md5: 8dac4c81dd53c90b112705b1517e129a

Issue Description:

Right now PropertyListDecoder doesn't exist on Linux. From a quick look at the implementation https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/PlistEncoder.swift I don't see anything that jumps out as not being available on Linux. This would be a nice addition for some tools that want to operate on plists.

@swift-ci
Copy link
Contributor

swift-ci commented Oct 7, 2018

Comment by Sven A. Schmidt (JIRA)

I've come across this issue here trying to find a way to make `PropertyListDecoder` available on Linux.

It turns out that given your pointer above this was quite easy. I took the file you linked to and added

```

import Foundation

extension DecodingError {

internal static func \_typeMismatch(at path: \[CodingKey\], expectation: Any.Type, reality: Any) -\> DecodingError {

    let description = "Expected to decode (expectation) but found (type(of: reality)) instead."

    return .typeMismatch(expectation, Context(codingPath: path, debugDescription: description))

}

}

let kCFBooleanTrue = NSNumber(booleanLiteral: true)

let kCFBooleanFalse = NSNumber(booleanLiteral: false)

```

to fix a couple of missing declarations. This builds and runs fine on Linux with swift-4.2 (and probably earlier, I didn't test).

So I suppose that proves that this should be straightforward to add 🙂

I'd be happy to put in some time to open an MR for this but not having build swift or the stdlib I'm not really sure where to start.

@kevints
Copy link
Mannequin

kevints mannequin commented Nov 15, 2018

@millenomi it looks like the implementation for this is already in the overlay, could we copy it into s-c-f?

@swift-ci
Copy link
Contributor

Comment by Yonas (JIRA)

Is there an update on this?

@swift-ci
Copy link
Contributor

Comment by Ondrej Rafaj (JIRA)

hi, any update please? 🙁

@spevans
Copy link
Collaborator

spevans commented Jun 4, 2020

PropertyListEncoder/Decoder were added in #1849

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants