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-883] Support conditional dependencies #5312

Open
sharplet opened this issue Mar 5, 2016 · 3 comments
Open

[SR-883] Support conditional dependencies #5312

sharplet opened this issue Mar 5, 2016 · 3 comments

Comments

@sharplet
Copy link

sharplet commented Mar 5, 2016

Previous ID SR-883
Radar rdar://problem/40237402
Original Reporter @sharplet
Type New Feature
Status Reopened
Resolution
Environment

Swift DEVELOPMENT-SNAPSHOT-2016-03-01-a

Additional Detail from JIRA
Votes 3
Component/s Package Manager
Labels New Feature
Assignee None
Priority Medium

md5: ea28f8835660c29d2bbde863352c0db5

duplicates:

relates to:

  • SR-859 Add a way to exclude files, folders, and targets when used as a dependency

Issue Description:

When swift-test was merged, fetching and building of test-only dependencies was removed. This appears to be a known issue, as the related tests were disabled: https://github.com/apple/swift-package-manager/blob/c3e97ac83bd1552f4312030a0004fab8b9134b32/Tests/Functional/TestMiscellaneous.swift#L75.

Expected: Test-only dependencies should be downloaded and built, and be able to import XCTest.

Actual: Test-only dependencies are ignored, although they can be added to the standard list of dependencies as a workaround. However, when building a building a test dependency, packages are unable to be linked against XCTest.

@ddunbar
Copy link
Member

ddunbar commented Apr 30, 2016

@mxcl do you know what is up here?

@mxcl
Copy link
Contributor

mxcl commented May 2, 2016

I removed this feature as it occurred to me it underwent no real design or consideration and was merged before we even had testing support.

It would be enough to discuss it here.

@ankitspd
Copy link
Member

ankitspd commented Apr 8, 2018

One possible solution is to enhance Package.swift to support conditional dependencies. Something like:

.package(url: "https://...", from: "1.0.0", when: .testing),
.package(url: "https://...", from: "2.0.0", when: .os(.linux),

We need to design and discuss this feature on Swift forums, possibly as part of build settings which is related to this JIRA.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
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

5 participants