Failure to import SwiftShims at the REPL


(Jason Dusek) #1

Hi List,

On Ubuntu 14.04, trying out Swift from the REPL fails for me when
Swift is unable to find the SwiftShims module. All other aspects of
installation -- Clang 3.6, libicu-dev -- are correct as far as I can
tell.

Putting `swift` in `strace` reveals that it tries to find and open

  /usr/local/lib/swift/linux/x86_64/SwiftShims.swiftmodule

and, failing to find it, errors out. However, shortly thereafter it finds

  /usr/local/lib/swift/shims/module.map

and even manages to load the module text. I've included ~80 lines of
relevant `strace` output at this Gist:

  https://gist.github.com/solidsnack/d902a761877b0f797835

One aspect of this that puzzles me is why it only searches for the
module in one place when there are potentially many it could be
loading it from. Another is why it works for some people (many of whom
are posting interesting things to this list) but not others.

I would appreciate it so much if someone could help me to get the
Swift distribution working on Ubuntu 14.04.

Best Regards,
  Jason Dusek


(Dmitri Gribenko) #2

Hi Jason,

Could you try unpacking the archive somewhere under your home
directory and trying to run the REPL from there? We haven't tested
installing the package into / or /usr/local, and since there is no
automated way to uninstall it, we are not recommending to install the
.tar.gz packages into / or /usr/local.

Dmitri

···

On Sat, Dec 5, 2015 at 5:36 PM, Jason Dusek via swift-users <swift-users@swift.org> wrote:

Hi List,

On Ubuntu 14.04, trying out Swift from the REPL fails for me when
Swift is unable to find the SwiftShims module. All other aspects of
installation -- Clang 3.6, libicu-dev -- are correct as far as I can
tell.

Putting `swift` in `strace` reveals that it tries to find and open

  /usr/local/lib/swift/linux/x86_64/SwiftShims.swiftmodule

and, failing to find it, errors out. However, shortly thereafter it finds

  /usr/local/lib/swift/shims/module.map

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/


(Jason Dusek) #3

Thank you Dmitri -- following your instructions, I was finally able to
complete the example at the REPL.

···

On Sat, 5 Dec 2015 at 18:17 Dmitri Gribenko <gribozavr@gmail.com> wrote:

On Sat, Dec 5, 2015 at 5:36 PM, Jason Dusek via swift-users > <swift-users@swift.org> wrote:
> Hi List,
>
> On Ubuntu 14.04, trying out Swift from the REPL fails for me when
> Swift is unable to find the SwiftShims module. All other aspects of
> installation -- Clang 3.6, libicu-dev -- are correct as far as I can
> tell.
>
> Putting `swift` in `strace` reveals that it tries to find and open
>
> /usr/local/lib/swift/linux/x86_64/SwiftShims.swiftmodule
>
> and, failing to find it, errors out. However, shortly thereafter it finds
>
> /usr/local/lib/swift/shims/module.map

Hi Jason,

Could you try unpacking the archive somewhere under your home
directory and trying to run the REPL from there? We haven't tested
installing the package into / or /usr/local, and since there is no
automated way to uninstall it, we are not recommending to install the
.tar.gz packages into / or /usr/local.

Dmitri

--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr@gmail.com>*/