Re: [swift-users] Swift linux repl can't import

2017-04-04 Thread Will Stanton via swift-users
From https://bugs.swift.org/browse/SR-3648, the work-around seems to be passing 
-I /path/to/extracted/usr/lib/swift/clang/include when invoking swift (credit 
Lukas and others, SR-3794 is more active)
So, ex. `swift -I ~/a-swift/usr/lib/swift/clang/include/`

Fortunately, the issue has only come up for me in the REPL. `swift build` works 
fine: I can build packages without an awkward -Xswiftc…

I wonder if the issue has anything to do with the clang-builtin-headers install 
component? (Maybe swiftc/something gets hardcoded with a path somewhere?)

Would be interested in learning more about install options, toolchains, and the 
build! I’ve been wanting to track down for a while now, how does 
--install-prefix affect the build? I’ve been relying on install_destdir to get 
a swift...

Regards,
Will Stanton

> On Apr 4, 2017, at 9:17 PM, Rick Mann via swift-users  
> wrote:
> 
> The installation instructions for Swift on Linux imply that the tarball can 
> be extracted anywhere, and the PATH set, and all should be well. But 
> unfortunately, while that's partly true, when I try to import packages, it 
> fails (Ubuntu 16.04 on Parallels on macOS 10.12.3):
> 
> $ swift
> Welcome to Swift version 3.1 (swift-3.1-RELEASE). Type :help for assistance.
>  1> 1+1
> $R0: Int = 2
>  2> import Glibc
> :3:10: note: in file included from :3:
> #include "///usr/include/utmp.h"
> ^
> 
> ///usr/include/utmp.h:23:10: note: in file included from 
> ///usr/include/utmp.h:23:
> #include 
> ^
> 
> error: /usr/include/x86_64-linux-gnu/sys/types.h:146:10: error: 'stddef.h' 
> file not found
> #include 
> ^
> 
> error: could not build Objective-C module 'SwiftGlibc'
> 
>  2>
> 
> I'm guessing it really wants Swift to live inside /usr?

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


[swift-users] Swift linux repl can't import

2017-04-04 Thread Rick Mann via swift-users
The installation instructions for Swift on Linux imply that the tarball can be 
extracted anywhere, and the PATH set, and all should be well. But 
unfortunately, while that's partly true, when I try to import packages, it 
fails (Ubuntu 16.04 on Parallels on macOS 10.12.3):

$ swift
Welcome to Swift version 3.1 (swift-3.1-RELEASE). Type :help for assistance.
  1> 1+1
$R0: Int = 2
  2> import Glibc
:3:10: note: in file included from :3:
#include "///usr/include/utmp.h"
 ^

///usr/include/utmp.h:23:10: note: in file included from 
///usr/include/utmp.h:23:
#include 
 ^

error: /usr/include/x86_64-linux-gnu/sys/types.h:146:10: error: 'stddef.h' file 
not found
#include 
 ^

error: could not build Objective-C module 'SwiftGlibc'

  2>

I'm guessing it really wants Swift to live inside /usr?



-- 
Rick Mann
rm...@latencyzero.com


___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] typealias for Generic in Generic

2017-04-04 Thread Adrian Zubarev via swift-users
R is a non generic type, because the generic part is set to T, that’s why R() 
works.

Otherwise you could create typealias Q = 
Сarriage and use it like this Q()



-- 
Adrian Zubarev
Sent with Airmail

Am 4. April 2017 um 19:25:45, Седых Александр via swift-users 
(swift-users@swift.org) schrieb:

Hello.
I stumbled on ambiguous behaviour of compiler. Is not allowed explicitly 
indicate type in Generic typealias.



struct Сarriage {
    let g = [T]()
}
 
struct Coma {
    typealias R = Сarriage
    let m = R()
    let d = R() \\ error: cannot specialize non-generic type 
'Сarriage'
    var b = Сarriage()
    mutatingfunc work() {
        m.g.append(<#T##newElement: T##T#>) \\ what I can write here?
        b.g.append("Z")
    }
}


--
Седых Александр ___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


[swift-users] typealias for Generic in Generic

2017-04-04 Thread Седых Александр via swift-users

Hello.
I stumbled on ambiguous behaviour of compiler. Is not allowed explicitly 
indicate type in Generic typealias.

struct Сarriage {
     let g = [ T ]()
}
 
struct Coma {
     typealias R =  Сarriage < T >
     let m =  R ()
     let d =  R < String >() \\  error: cannot specialize non-generic type 
'Сarriage'
     var b =  Сarriage < String >()
     mutating func work() {
         m .g.append(<#T##newElement: T##T#>) \\ what I can write here?
         b . g . append ( "Z" )
    }
}

-- 
Седых Александр___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


[swift-users] Swift Build issue

2017-04-04 Thread zaid kazi via swift-users
Hi, Im curently trying to use swift package manager to install the library
Stencil the project builds fine in xcode and i can run it. Although when
trying to install Stencial via package manager it complains that some of
the existing sources I have cannot find the module libxml2 although they
are linked and work fine in xcode.


Please help !
MacBook-Pro:XCUI-ReportGen zaid$ swift build -Xcc -fblocks -Xswiftc 
-I/usr/local/include -Xlinker -L/usr/local/lib
Fetching https://github.com/kylef/Stencil.git
Fetching https://github.com/kylef/PathKit.git
Fetching https://github.com/kylef/Spectre.git
Cloning https://github.com/kylef/Spectre.git
Resolving https://github.com/kylef/Spectre.git at 0.7.2
Cloning https://github.com/kylef/Stencil.git
Resolving https://github.com/kylef/Stencil.git at 0.8.0
Cloning https://github.com/kylef/PathKit.git
Resolving https://github.com/kylef/PathKit.git at 0.8.0
Compile Swift Module 'Spectre' (8 sources)
Compile Swift Module 'PathKit' (1 sources)
Compile Swift Module 'Stencil' (19 sources)
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25:
 warning: expression implicitly coerced from 'Any?' to Any
return dictionaries.popLast()
^~~
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25:
 note: provide a default value to avoid this warning
return dictionaries.popLast()
^~~
?? <#default value#>
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25:
 note: force-unwrap the value to avoid this warning
return dictionaries.popLast()
^~~
   !
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Context.swift:46:25:
 note: explicitly cast to Any with 'as Any' to silence this warning
return dictionaries.popLast()
^~~
as Any
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Loader.swift:55:14:
 warning: no calls to throwing functions occur within 'try' expression
  return try environment.templateClass.init(templateString: content, 
environment: environment, name: name)
 ^
/Users/zaid/XCUI-ReportGen/.build/checkouts/Stencil.git-7635584243355970173/Sources/Loader.swift:68:18:
 warning: no calls to throwing functions occur within 'try' expression
  return try environment.templateClass.init(templateString: content, 
environment: environment, name: templateName)
 ^
Compile Swift Module 'XCUIReportGenerator' (13 sources)
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
/Users/zaid/XCUI-ReportGen/XCUIReportGenerator/ExternalLibs/Fuzi/Document.swift:23:8:
 error: no such module 'libxml2'
import libxml2
   ^
:0: error: build had 1 command failures
error: exit(1): 
/Applications/Xcode8.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool
 -f /Users/zaid/XCUI-ReportGen/.build/debug.yaml


debug.yaml
Description: Binary data
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users