Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
Medium
-
Resolution: Done
-
Component/s: Package Manager
-
Labels:None
-
Environment:
OS X 10.11
Description
Currently if you try something like this in your Package.swift
if let _ = String.fromCString(getenv("TEST")) { let package = Package(name: "getenv_was_true") } else { let package = Package(name: "getenv_was_false") }
it uses the else path whether TEST is set or not which I assume is due to the explicit environment parameter here:
https://github.com/apple/swift-package-manager/blob/64f1b2f5bd30d1dabb59a63181243becdd8797bb/Sources/dep/Manifest.swift#L158
I wrote a sample project for the issue:
https://github.com/Memorion/getenvdemo