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-15226] URLSession async features not available under x86_64-unknown-linux-gnu #57548

Closed
swift-ci opened this issue Sep 22, 2021 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. duplicate Resolution: Duplicates another issue Foundation transfer candidate The issue may belong in another repository

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Sep 22, 2021

Previous ID SR-15226
Radar None
Original Reporter msbit (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment
$ swiftc --version
Swift version 5.5 (swift-5.5-RELEASE)
Target: x86_64-unknown-linux-gnu
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: c558b324f8d5372e363d9afa9dcfb355

duplicates:

Issue Description:

With code like:

import Foundation
import FoundationNetworking

let bytes = URLSession.AsyncBytes()

Task.detached {
  let url = URL(string: "https://www.example.com")!

  await URLSession.shared.bytes(from: url)
  await URLSession.shared.data(from: url)
  await URLSession.shared.download(from: url)
}

when run via:

swiftc main.swift

gives me the following errors:

main.swift:4:24: error: type 'URLSession' has no member 'AsyncBytes'
let bytes = URLSession.AsyncBytes()
            ~~~~~~~~~~ ^~~~~~~~~~
main.swift:9:27: error: value of type 'URLSession' has no member 'bytes'
  await URLSession.shared.bytes(from: url)
        ~~~~~~~~~~~~~~~~~ ^~~~~
main.swift:10:27: error: value of type 'URLSession' has no member 'data'
  await URLSession.shared.data(from: url)
        ~~~~~~~~~~~~~~~~~ ^~~~
main.swift:11:27: error: value of type 'URLSession' has no member 'download'
  await URLSession.shared.download(from: url)
        ~~~~~~~~~~~~~~~~~ ^~~~~~~~

Is there a separate import or some other invocation (similar to import FoundationNetworking) required for non-Apple platforms to use these APIs?

@typesanitizer
Copy link

IIUC these APIs aren't fully implemented in swift-corelibs-foundation.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@adam-rocska
Copy link

This is insanity....

@AnthonyLatsis AnthonyLatsis added transfer candidate The issue may belong in another repository Foundation duplicate Resolution: Duplicates another issue and removed compiler The Swift compiler in itself labels Mar 25, 2023
@AnthonyLatsis
Copy link
Collaborator

@shahmishal This is a duplicate of an issue that was transferred last year to corelibs-foundation. Can we transfer it as well?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. duplicate Resolution: Duplicates another issue Foundation transfer candidate The issue may belong in another repository
Projects
None yet
Development

No branches or pull requests

4 participants