swiftlang / swiftlang/swift-corelibs-libdispatch

[SR-7269] Explicitly declaring `import CDispatch` is required to use `NSEC_PER_SEC` on Linux.

Open
#659 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug libdispatch
Dominant language
C
Stars
2.6k
Forks
496
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Previous ID SR-7269
Radar None
Original Reporter @norio-nomura
Type Bug
Environment

swift-4.1-DEVELOPMENT-SNAPSHOT-2018-03-22-a

Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee None
Priority Medium

md5: 771ca6a4f852f7ce29492a2d0a307f75

Issue Description:

Since swift-corelibs-libdispatch does not have @_exported import CDispatch, explicitly declaring import CDispatch is required to use NSEC_PER_SEC on Linux.
Since CDispatch does not exist on Darwin, we need to use #if !_runtime(_ObjC) or #if os(Linux) on importing CDispatch. This is inconvenient.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how swift-corelibs-libdispatch exposes CDispatch and how NSEC_PER_SEC is made available on Linux versus Darwin. Review the conditional-import and module-export behavior around these symbols, then identify coverage for this import path. Done when Linux clients no longer need an explicit CDispatch import while Darwin remains buildable.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, swift
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.