[swift-build-dev] NSGetEnviron and PR#400

Ankit Agarwal ankit at ankit.im
Fri Jun 10 07:22:35 CDT 2016


Hi,

There is no native method in swift to get the environment list right now
but you can use Foundation's NSProcessInfo
If you want an example:
https://github.com/apple/swift-package-manager/blob/master/Sources/Commands/SwiftTestTool.swift#L188

Thanks

On Fri, Jun 10, 2016 at 2:49 PM, Yannick Heinrich via swift-build-dev <
swift-build-dev at swift.org> wrote:

> Hello,
>
> I initiated the PR #400 in the package manager and I’m trying to implement
> the last suggestion in this thread.
>
> This is to recopy the current environment variables for git clone instead
> of cherry-pick several specifics one.
>
> I would like to use the _NSGetEnviron variable that should be defined in
> Darwin but I don’t manage to reference it.
>
> I tried:
>
> return environ
>
> return Darwin.environ
>
> return libc.environ
>
>
> I’m using the DEVELOPMENT-SNAPSHOT-2016-05-09-a toolchain.
>
> Any tips on how to call this method from Swift ?
>
> Regards
>
> Yannick
>
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev
>
>


-- 
Ankit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20160610/e1054bd7/attachment.html>


More information about the swift-build-dev mailing list