Skip to content

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

Closed

Description

@keith
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.

Activity

  1. swift-ci commented on Oct 7, 2018

    @swift-ci
    Contributor

    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.

  2. kevints commented on Nov 15, 2018

    kevintsmannequin
    Mannequin

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

  3. swift-ci commented on Jan 19, 2019

    @swift-ci
    Contributor

    Comment by Yonas (JIRA)

    Is there an update on this?

  4. swift-ci commented on May 13, 2019

    @swift-ci
    Contributor

    Comment by Ondrej Rafaj (JIRA)

    hi, any update please? 🙁

  5. spevans commented on Jun 4, 2020

    @spevans
    Contributor

    PropertyListEncoder/Decoder were added in #1849

  6. transferred this issue fromswiftlang/swifton May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions