{"action":"created","issue":{"url":"https://api.github.com/repos/kylef/swiftenv/issues/118","repository_url":"https://api.github.com/repos/kylef/swiftenv","labels_url":"https://api.github.com/repos/kylef/swiftenv/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/kylef/swiftenv/issues/118/comments","events_url":"https://api.github.com/repos/kylef/swiftenv/issues/118/events","html_url":"https://github.com/kylef/swiftenv/issues/118","id":312243161,"number":118,"title":"Distros other than Vanilla Ubuntu have some issues","user":{"login":"felix91gr","id":11747623,"avatar_url":"https://avatars2.githubusercontent.com/u/11747623?v=4","gravatar_id":"","url":"https://api.github.com/users/felix91gr","html_url":"https://github.com/felix91gr","followers_url":"https://api.github.com/users/felix91gr/followers","following_url":"https://api.github.com/users/felix91gr/following{/other_user}","gists_url":"https://api.github.com/users/felix91gr/gists{/gist_id}","starred_url":"https://api.github.com/users/felix91gr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felix91gr/subscriptions","organizations_url":"https://api.github.com/users/felix91gr/orgs","repos_url":"https://api.github.com/users/felix91gr/repos","events_url":"https://api.github.com/users/felix91gr/events{/privacy}","received_events_url":"https://api.github.com/users/felix91gr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-07T21:06:56Z","updated_at":"2018-04-11T05:40:47Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm on Elementary OS, an Ubuntu-based Linux. The Swift binaries compiled for Ubuntu 16.04 are fully compatible with it. But if using **swiftenv**, I get two results depending on how I install Swift:\r\n\r\n### `swiftenv install N`: \r\n\r\nIt first downloads the repos:\r\n    \r\n* swift\r\n* swift-llvm\r\n* swift-clang\r\n* swift-lldb\r\n* swift-cmark\r\n* swift-llbuild \r\n* swift-package-manager\r\n* swift-compiler-rt\r\n* swift-corelibs-xctest\r\n* swift-corelibs-foundation\r\n* swift-corelibs-dispatch\r\n\r\nThen proceeds to compile Swift:\r\n```console\r\nBuilding Swift\r\nThis may take a very long time...\r\n```\r\nAnd after that when I run `swift` (to invoke the REPL), I get this error:\r\n```console\r\n<unknown>:0: error: unable to load standard library for target 'x86_64-unknown-linux-gnu'\r\nswift: /home/felix/.swiftenv/tmp/swiftenv-build-4.1/swift/include/swift/AST/Module.h:1193: swift::SourceFile &swift::ModuleDecl::getMainSourceFile(swift::SourceFileKind) const: Assertion `!Files.empty() && \"No files added yet\"' failed.\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x3f259a4]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x3f25ce6]\r\n/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f0a50ae4390]\r\n/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f0a4f009428]\r\n/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f0a4f00b02a]\r\n/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x7f0a4f001bd7]\r\n/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7f0a4f001c82]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x4dd35b]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x4dacb8]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x4c146c]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x4bf96c]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x478364]\r\n/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f0a4eff4830]\r\n/home/felix/.swiftenv/versions/4.1/usr/bin/swift[0x475c19]\r\nStack dump:\r\n0.\tProgram arguments: /home/felix/.swiftenv/versions/4.1/usr/bin/swift -frontend -repl -disable-objc-interop -color-diagnostics -module-name REPL \r\nfish: “swift” terminated by signal SIGABRT (Abort)\r\n```\r\n\r\n### `swiftenv install SWIFT_BINARIES_URL`\r\n\r\nAfter this happened, I decided to try again with a directed binary installation:\r\n\r\n```console\r\nswiftenv install https://swift.org/builds/swift-4.1-release/ubuntu1604/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu16.04.tar.gz\r\nDownloading https://swift.org/builds/swift-4.1-release/ubuntu1604/swift-4.1-RELEASE/swift-4.1-RELEASE-ubuntu16.04.tar.gz\r\n/tmp/swiftenv-4.1-RELEASE-felix ~\r\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                 Dload  Upload   Total   Spent    Left  Speed\r\n100  171M  100  171M    0     0  3648k      0  0:00:48  0:00:48 --:--:-- 5053k\r\n~\r\n4.1-RELEASE has been installed.\r\nfelix@felix-X550LD ~> swift\r\nWelcome to Swift version 4.1 (swift-4.1-RELEASE). Type :help for assistance.\r\n  1>  \r\n```\r\n\r\nWhich works no problem :+1: \r\n\r\n### What can be done\r\n\r\nI think the best alternative is to build under non-ubuntu-based distros and figure out what's wrong with the build process that doesn't let it build or configure properly the Stdlib, s.t. they can actually use `swiftenv`.\r\n\r\nAnd under ubuntu-based distros, having a way to tell what ubuntu are they based on. Then, proceeding to just install the binaries as if they were _that_ particular ubuntu.\r\n\r\n### What I don't know\r\n\r\nDoes building work properly under vanilla Ubuntu? Maybe the stdlib gets properly built or configured iff that's the OS `swiftenv` is under.\r\n\r\n### Extras\r\n\r\nI tested this both under Swift 4.0 and 4.1, to make sure it wasn't my 4.1 PR that made `swiftenv` fail."},"comment":{"url":"https://api.github.com/repos/kylef/swiftenv/issues/comments/380333693","html_url":"https://github.com/kylef/swiftenv/issues/118#issuecomment-380333693","issue_url":"https://api.github.com/repos/kylef/swiftenv/issues/118","id":380333693,"user":{"login":"kylef","id":44164,"avatar_url":"https://avatars1.githubusercontent.com/u/44164?v=4","gravatar_id":"","url":"https://api.github.com/users/kylef","html_url":"https://github.com/kylef","followers_url":"https://api.github.com/users/kylef/followers","following_url":"https://api.github.com/users/kylef/following{/other_user}","gists_url":"https://api.github.com/users/kylef/gists{/gist_id}","starred_url":"https://api.github.com/users/kylef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylef/subscriptions","organizations_url":"https://api.github.com/users/kylef/orgs","repos_url":"https://api.github.com/users/kylef/repos","events_url":"https://api.github.com/users/kylef/events{/privacy}","received_events_url":"https://api.github.com/users/kylef/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T05:40:47Z","updated_at":"2018-04-11T05:40:47Z","author_association":"OWNER","body":"That's neat, thanks for the PR #121!\r\n\r\nI'm not having much luck building Swift, I've tempted to get Swift building on Circle CI (https://github.com/kylef/swiftenv/commit/c0b19d43945e15f27f8aed1a6d2c4415d58e8882) but eventually it fails during the build with clang getting killed. I'm guessing this is due to memory pressure.\r\n\r\nTo make the built version work, I think the installation instructions at https://github.com/kylef/swiftenv/blob/master/libexec/swiftenv-build#L62-L65 will need to be to be updated to install other libraries in the package. Do you happen to still have the tmp directory from installation containing the built files? It is normally cleared after installation (unless `--no-clean` was provided to `swiftenv install`). It should be at `~/.swiftenv/tmp/swiftenv-build-4.1-dev/build/Ninja-ReleaseAssert/`. Inside will be the swift directory.\r\n"}}
{"actor":{"display_login":"kylef"}}