Giter Club home page Giter Club logo

swiftenv's Introduction

swiftenv's People

Contributors

adam-fowler avatar bscothern avatar deepumukundan avatar dpgao avatar felix91gr avatar herrbischoff avatar ianpartridge avatar ikesyo avatar josefdolezal avatar julien-c avatar kattrali avatar kimar avatar kylef avatar lxrd-aj avatar murcie avatar nachosoto avatar otaran avatar raimon49 avatar sinoru avatar stupergenius avatar tomquist avatar yockow avatar zeveisenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftenv's Issues

A Full & Proper Uninstall

Would you please outline a full and proper uninstall that fully removes swiftenv & reverts to the system default Swift?

I used homebrew for the installation.

Seemingly I would follow these steps:

  1. Remove from my .bash_profile the line
    'if which swiftenv > /dev/null; then eval "$(swiftenv init -)"; fi'
  2. Uninstall using Homebrew
    $brew uninstall swiftenv

What I struggle with is how to properly set the path back to the system Swift.

(I'm no sysadmin!) Thanks in advance.

Pointer to most recent version

Hi,

I can use swiftenv install dev-3.0 to install that version. However how can I find the most up-to-date version of the master branch on the swift website?

Maybe swiftenv install newest would be a nice command :-)

Make swiftenv-api endpoint configurable

Currently the swiftenv-api is a requirement to install Linux builds. The API is down currently and has been down for an hour or more and is preventing our CI from running.

Even if we hosted our own swiftenv-api there is currently no way to configure it. The scripts should allow an environment variable to override the default URL.

curl timeout

curl: (28) Operation timed out after 89999 milliseconds with 113328128 out of 211085000 bytes received

Is it possible to increase the timeout?

Not Loaded Error

After installing swiftenv and dev version of Swift (with swiftenv). When i run swift build --help i get the following error: dyld: Library not loaded: @rpath/libswiftCore.dylib

Swift version: swift-DEVELOPMENT-SNAPSHOT-2016-03-16-a

Strange behavior with Go and linking CGo libraries

It may not make any sense for swiftenv users, but when evaling swiftenv init, it appears to inject some environment that later conflicts with Go (the programming language), and causes the Go linker to hang indefinitely.

For documentation purposes, here's the Go output.
golang/go#17192

For now I've disabled automatic initialization of swiftenv.

Hopefully this issue helps others.

Fail to install `3.0-preview-2` on linux

install script on travis-ci:

$ eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"

.swift-version:

3.0-preview-2

error message:

3.0-preview-2 was not found on swift.org.
  https://swift.org/builds/swift-3.0-preview-2-release/ubuntu1404/swift-3.0-preview-2-RELEASE/swift-3.0-preview-2-RELEASE-ubuntu14.04.tar.gz

https://travis-ci.org/Quick/Nimble/jobs/143823099

Has promise, but kind of a pita to use currently.

Context: nvm (Node Version Manager)

Things I miss:

  • nvm ls (better than swiftenv versions by quite a bit imo). How about svm ls?
  • nvm ls-remote displays a list of all available versions. <- amazingly helpful.
  • nvm install v4 will install the latest version of v4. eg. v4.4.9. As opposed to this craziness: swift-2.2.1-SNAPSHOT-2016-04-12-a

The last two in that list are pretty much deal breakers for me personally since I need to go the swift website to find the version I need to download anyway, just to pass into swiftenv. I'll just pull the file while I'm there and install it at that point.

Can't find Swift version when manually install Swift for current user only

In OS X, when I use Swift Binary Package .pkg manually install for current user only, which install Swift into ~/Library/Developer/Toolchains/, and then run swiftenv rehash, it does't show current installed Swift version by running switenv versions
But it works when install for all users


OS X 10.11.4
swiftenv 1.0.2
Swift DEVELOPMENT-SNAPSHOT-2016-06-06-a

swiftenv causes some of swift compiler tests to fail

Hi Kyle, I really like swiftenv, thank you for making this awesome product! However, I have some issue with swiftenv and swift compiler tests right now.

I built swift complier from apple/swift repo, and I ran swift compiler tests by $ swift/utils/build-script --test. When swiftenv is isntalled, 346 tests fails as "Unexpected Failures" with the following error (this is one of the failed test result messages):

********************
FAIL: Swift(macosx-x86_64) :: PlaygroundTransform/high_performance.swift (326 of 2938)
******************** TEST 'Swift(macosx-x86_64) :: PlaygroundTransform/high_performance.swift' FAILED ********************
Script:
--
rm -rf /Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/PlaygroundTransform/Output/high_performance.swift.tmp
mkdir -p /Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/PlaygroundTransform/Output/high_performance.swift.tmp
cp /Users/keitaito/Swift/swift-source/swift/test/PlaygroundTransform/high_performance.swift /Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/PlaygroundTransform/Output/high_performance.swift.tmp/main.swift
xcrun --toolchain default --sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swiftc -target x86_64-apple-macosx10.9  -module-cache-path '/var/folders/4y/_c55p9_170n54jw_s64mx_c80000gn/T/swift-testsuite-clang-module-cacheR0Chhb' -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks -Xlinker -rpath -Xlinker /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks    -Xfrontend -playground -Xfrontend -playground-high-performance -Xfrontend -debugger-support -o /Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/PlaygroundTransform/Output/high_performance.swift.tmp/main /Users/keitaito/Swift/swift-source/swift/test/PlaygroundTransform/Inputs/PlaygroundsRuntime.swift /Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/PlaygroundTransform/Output/high_performance.swift.tmp/main.swift
/Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/test-macosx-x86_64/PlaygroundTransform/Output/high_performance.swift.tmp/main | /Users/keitaito/Swift/swift-source/swift/utils/PathSanitizingFileCheck --sanitize 'BUILD_DIR=/Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64' --sanitize 'SOURCE_DIR=/Users/keitaito/Swift/swift-source/swift' --use-filecheck '/Users/keitaito/Swift/swift-source/build/Ninja-DebugAssert/llvm-macosx-x86_64/./bin/FileCheck' /Users/keitaito/Swift/swift-source/swift/test/PlaygroundTransform/high_performance.swift
--
Exit Code: 1

Command Output (stderr):
--
mkdir: /.swiftenv: Permission denied
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

Here is the overall tests result with swiftenv:

********************
Testing Time: 815.15s
********************
Failing Tests (346):
    Swift(macosx-x86_64) :: SILOptimizer/specialize_partial_apply.swift
    Swift(macosx-x86_64) :: SILOptimizer/let_properties_opts_runtime.swift
    Swift(macosx-x86_64) :: SILOptimizer/capture_propagation_linkage.swift
    ... (this is pretty long for 346)
    Swift(macosx-x86_64) :: Reflection/box_descriptors.sil
    Swift(macosx-x86_64) :: Runtime/backtrace.swift
    Swift(macosx-x86_64) :: SILGen/coverage_smoke.swift

  Expected Passes    : 2520
  Expected Failures  : 8
  Unsupported Tests  : 64
  Unexpected Failures: 346
*** Failed while running tests for swift (check-swift-macosx-x86_64)
swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

Full failing tests list is here: https://gist.github.com/keitaito/0247ab6cfd6e86f0f636a7d3306c9012

After the above failure, I uninstalled swiftenv, and I tried swift compiler tests again. This time, there are no "Unexpected Failures", and all tests are finished correctly. Here is the overall tests result:

Testing Time: 887.59s
  Expected Passes    : 2866
  Expected Failures  : 8
  Unsupported Tests  : 64
-- check-swift-macosx-x86_64 finished --
--- Finished tests for swift ---

Do you have any idea why swiftenv causes this issue, and how can I fix it?

I just only installed swiftenv, and no other versions of swift installed via swiftenv.

$ swiftenv versions
* system
  3.0
$ swiftenv version
system (set by /Users/keitaito/.swiftenv/version)

OS: OS X El Capitan version 10.11.6
Installed Xcode: Xcode 8
Built swift compiler directory name: Ninja-DebugAssert -> swift-macosx-x86_64

Sorry in advance if my explanation here is not clear enough. Please let me know if you need any other information. Thank you.

Align swift build flags with Swift's binary build flags

Currently swiftenv build will not reproduce similar builds of Swift to the binaries found at swift.org/downloads. When swiftenv builds Swift 3.0, Foundation, etc is are not built.

We should align the flags for each version (2.2, 2.2.1, 3.0) as the Swift team does for the Swift they distribute binaries.

$ swiftenv install 2.2
$ swiftenv install 2.2.1
$ swiftenv install 3.0-dev # eventually 3.0

New route to binary @ swift.org πŸŽ‰

Rationale

$ swiftenv install swift-2.2-SNAPSHOT-2016-01-25-a
swift-2.2-SNAPSHOT-2016-01-25-a was not found on swift.org.
https://swift.org/builds/xcode/swift-2.2-SNAPSHOT-2016-01-25-a/swift-2.2-SNAPSHOT-2016-01-25-a-osx.pkg

Old binary url

https://swift.org/builds/xcode/swift-$VERSION/swift-$VERSION-osx.pkg

New binary url

https://swift.org/builds/swift-2.2-branch/xcode/swift-2.2-SNAPSHOT-2016-01-25-a/swift-2.2-SNAPSHOT-2016-01-25-a-osx.pkg

πŸ™ˆ

Request: support for aliases

The development snapshot names are long and tedious to type/copy.

ipartrid@apus:~$ swiftenv versions
  DEVELOPMENT-SNAPSHOT-2016-03-24-a
  DEVELOPMENT-SNAPSHOT-2016-04-12-a
  DEVELOPMENT-SNAPSHOT-2016-04-25-a
* 2.2 (set by /Users/ipartrid/.swiftenv/version)
ipartrid@apus:~$ swiftenv local DEVELOPMENT-SNAPSHOT-2016-04-25-a
ipartrid@apus:~$

It would be nice to be able to do:

ipartrid@apus:~$ swiftenv alias dev=DEVELOPMENT-SNAPSHOT-2016-04-25-a
ipartrid@apus:~$ swiftenv local dev

swiftenv install 3.0 fails with "version `3.0' is not installed" on TravisCi's xcode7.2 image

I've set up a Travis CI build to install swift 3.0 on their xcode7.2 image. When I configure it to install 3.0, I see:

$ swiftenv install --verbose 3.0
Checking for a URL for the 3.0 on osx.
Installing 3.0 from https://swift.org/builds/swift-3.0-release/xcode/swift-3.0-RELEASE/swift-3.0-RELEASE-osx.pkg on osx.
Downloading https://swift.org/builds/swift-3.0-release/xcode/swift-3.0-RELEASE/swift-3.0-RELEASE-osx.pkg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  254M  100  254M    0     0  11.1M      0  0:00:22  0:00:22 --:--:-- 12.5M
installer: Package name is Swift Open Source Xcode Toolchain
installer: Installing at base path /
installer: The install was successful.
3.0 has been installed.
swiftenv: version `3.0' is not installed

I think this is because https://github.com/kylef/swiftenv/blob/master/share/swiftenv-install/3.0#L11 will use https://swift.org/builds/swift-3.0-release/xcode/swift-3.0-RELEASE/swift-3.0-RELEASE-osx.pkg to install version 3.0. That package installs to /Library/Developer/Toolchains/swift-3.0-RELEASE.xctoolchain, but https://github.com/kylef/swiftenv/blob/master/libexec/swiftenv-prefix#L29 instead checks for /Library/Developer/Toolchains/swift-3.0.xctoolchain (without the -RELEASE).

I can't replicated it locally, as I've installed Xcode 8 & swiftenv-prefix finds /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift, and its version is

Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9

which is recognised by https://github.com/kylef/swiftenv/blob/master/libexec/swiftenv-prefix#L47

Unable to uninstall existing version

Hi Kyle,

Good to see swiftenv getting updated to 1.0

I was trying to uninstall a version of swift I have installed using swiftenv.
But swiftenv stated that the version is not installed. Attaching a screenshot.

screen shot 2016-03-21 at 6 19 17 pm

Ubuntu 14.04 lts and GM

When trying to install I am getting the following error

mv: cannot stat β€˜/tmp/swiftenv-3.0-RELEASE/swift-3.0-RELEASE-RELEASE*’: No such file or directory

Platform-agnostic .swift-version file

With the new Swift snapshot that we get from Xcode 8, it is now impossible (as far as I am aware, please correct me if I'm wrong) to pin the proper Swift version on both OSX and Ubuntu. On OSX, the version is 3.0. On Ubuntu, the correct version is swift-3.0-preview-1.

What's the best approach/solution here?

Unable to switch to 2.2

Hi,

I am using swiftenv local 2.2 or swiftenv global 2.2, however when running swift --version it still shows swift 3.0?

Any idea why that is happening? :-)

Thank you very much.

Is there Swift 2.3 version?

I am trying to migrate my project from 2.3 to 3.0.
Now I want to install Swift 2.3 version, but when I use
swiftenv install 2.3
The error message show
We don't have build instructions for 2.3.
Is there any solution?

install fails on FreeBSD

First off thank you for building swiftenv. I've been using it on my mac for a while now :).

I'm not too familiar with FreeBSD, but I installed the depenceids that you detailed in the wiki. After that I tried to build swift on FreeBSD and I run into this error:

[freebsd@free-haris ~]$ swiftenv install 3.0-dev
Found swift, skipping download
Found compiler-rt, skipping download
Found llvm, skipping download
Found clang, skipping download
Found lldb, skipping download
Found cmark, skipping download
Found swiftpm, skipping download
Found llbuild, skipping download
Found swift-corelibs-xctest, skipping download
Found swift-corelibs-foundation, skipping download
Found swift-corelibs-libdispatch, skipping download
Building Swift
This may take a very long time...
Building Swift failed
Check out the logfile for more information: /home/freebsd/.swiftenv/tmp/swiftenv-build-3.0-dev/swiftenv-build.20160608060410.1397.log
You can inspect or delete the working tree at: /home/freebsd/.swiftenv/tmp/swiftenv-build-3.0-dev

If I cat the log file this is what I get:

[freebsd@free-haris ~]$ cat /home/freebsd/.swiftenv/tmp/swiftenv-build-3.0-dev/swiftenv-build.20160608055536.1199.log
Cloning into 'swift'...
Checking out files: 100% (10799/10799), done.
Cloning into 'compiler-rt'...
Cloning into 'llvm'...
Checking out files: 100% (20127/20127), done.
Cloning into 'clang'...
Checking out files: 100% (11768/11768), done.
Cloning into 'lldb'...
Checking out files: 100% (5479/5479), done.
Cloning into 'cmark'...
Cloning into 'swiftpm'...
Cloning into 'llbuild'...
Cloning into 'swift-corelibs-xctest'...
Cloning into 'swift-corelibs-foundation'...
Cloning into 'swift-corelibs-libdispatch'...
usage: 
  build-script [-h | --help] [OPTION ...]
  build-script --preset=NAME [SUBSTITUTION ...]
build-script: error: unknown argument: --build-jobs

Any ideas?

Individual user cannot install a snapshot that root already installed

While using swiftenv as root it downloaded swiftenv-DEVELOPMENT-SNAPSHOT-2016-05-31-a to /tmp, thus setting permissions to root only.

Later as a regular system user I tried installing the same snapshot for that user, and was greeted with:

tar: swift-DEVELOPMENT-SNAPSHOT-2016-05-31-a-ubuntu15.10/usr/include/lldb/Interpreter/OptionValueChar.h: Cannot open: No such file or directory

Perhaps swiftenv should create a user-specific directory in /tmp when extracting the snapshot .tgz?

CI solution for building Swift Toolchain

Hey!

I tried using your gist for building Swift OSS snapshot and running SPM on Travis CI, however it does not seem to work on latest version of Swift. Is it updated to latest swift.org URLs?

Here's successful build with old version of Swift - https://travis-ci.org/DenHeadless/Transporter/jobs/109139150
And here's attempt for building with new one - https://travis-ci.org/DenHeadless/Transporter/jobs/109138678

I will keep digging this myself, but any help from you would be much appreciated.

Doesn't install 3.0 on Ubuntu 16.04

I'm using fac720df64c28bbc04832b65d245da72a2054be8 swiftenv.

$ swiftenv install --verbose 3.0
Checking for a URL for the 3.0 on ubuntu16.04.
Did not find a binary release for 3.0 on ubuntu16.04.
We don't have build instructions for 3.0.

Homebrew package issue

I'm not completely sure where the problem lies, but I'm going to report it anyway and you can decide…

After an hombrew upgrade to swiftenv I found that all the shims were incorrect, i.e. shims/swiftc

#!/usr/bin/env bash
set -e
exec "/usr/local/Cellar/swiftenv/1.0.0/bin/../libexec/swiftenv" exec "--shim" "swiftc" "$@"

instead of

#!/usr/bin/env bash
set -e
exec "/usr/local/Cellar/swiftenv/1.0.1/bin/../libexec/swiftenv" exec "--shim" "swiftc" "$@"

And I had to update all the references to 1.0.1 manually, then swift worked again.

I hope that issue report helps and let me know if you want any other details.

No build instructions for 3.0-GM-CANDIDATE

$ swiftenv --version
swiftenv 1.1.0
$ swiftenv install 3.0-GM-CANDIDATE
We don't have build instructions for 3.0-GM-CANDIDATE.
$ swiftenv install https://swift.org/builds/swift-3.0-GM-CANDIDATE/xcode/swift-3.0-GM-CANDIDATE/swift-3.0-GM-CANDIDATE-osx.pkg
installer: Package name is Swift Open Source Xcode Toolchain
installer: Installing at base path /
installer: The install was successful.
3.0-GM-CANDIDATE has been installed.

swift --version is still 2.2

I am trying to install DEVELOPMENT-SNAPSHOT-2016-02-08-a.

install works ok
then i do swiftenv local DEVELOPMENT-SNAPSHOT-2016-02-08-a in directory, but swift --version outputs

Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9

I have installed swiftenv via brew with --HEAD

El Capitan 10.11.4

Support installing from swiftnightly.com

There's a great way to get nightly swift builds at http://swiftnightly.com - I'd love to see support from installing from it in swiftenv. In particular, I have two stages of support in mind.

(1) User can just copy the remote url and install with swiftenv install URL, however currently that doesn't work due to the nightlies being packaged in .tar.gz instead of the expected .pkg, so you get

➜  ~ swiftenv install https://s3.ap-south-1.amazonaws.com/swiftsnapshots/swift-DEVELOPMENT-SNAPSHOT-2016-07-16-a-osx.tar.gz
https://s3.ap-south-1.amazonaws.com/swiftsnapshots/swift-DEVELOPMENT-SNAPSHOT-2016-07-16-a-osx.tar.gz does not end in '-osx.pkg' as expected.

(2) Swiftenv could support the keyword nightly (or similar) which would automatically pull the latest published nightly from swiftnightly.com, so the URL copying wouldn't even be necessary.

(1) is a blocker at the moment, (2) would be a nice-to-have.

Thanks for considering!

Bad error

I am trying to do stuff using the swift command line tools(e.g. swift build or swift package generate-xcodeproj) but i get the error /Users/Si/.swiftenv/shims/swift: line 3: /usr/local/Cellar/swiftenv/1.0.1/libexec/../libexec/swiftenv: No such file or directory

Issues when installing on Ubuntu 16.04

Hi, I'm trying to install both 2.2 and 3.0-dev versions, and I'm getting the following error message in the logs:
Can't find source directory for ninja (tried ~/.swiftenv/tmp/swiftenv-build-3.0-dev/ninja)

Do I need to clone github.com/martine/ninja in that directory? If so, which version do I need?
Thanks.

Selecting 3.0 when Xcode-beta is installed doesn't work

Hi,

I've installed swiftenv with homebrew. I have both Xcode 7.3.1 and Xcode 8 beta 1 installed. Output of swiftenv versions follows:

% swiftenv versions
* system
  2.2-SNAPSHOT-2016-02-08-a
  2.2
  3.0

After I've executed swift local 3.0 for my project swift build prints this:

error: system(["/Users/user/Documents/MySwiftProject/swiftc",
"--driver-mode=swift", "-I", 
"/Users/user/Documents/lib/swift/pm", "-L", "/Users/user/Documents/lib/swift/pm",
"-lPackageDescription", "-target", "x86_64-apple-macosx10.10", 
"/Users/user/Documents/MySwiftProject/Package.swift", 
"-fileno", "4"], posix_spawn error: No such file or directory (2), 
`["/Users/user/Documents/MySwiftProject/swiftc", 
"--driver-mode=swift", "-I", "/Users/user/Documents/lib/swift/pm", "-L", 
"/Users/user/Documents/lib/swift/pm", "-lPackageDescription",
"-target", "x86_64-apple-macosx10.10", 
"/Users/user/Documents/MySwiftProject/Package.swift", "-fileno", "4"]`)

Is there any easy way to diagnose this further or fix?

Thanks.

Can not install 2.2 on Travis

Here is my travis.yml file:

matrix:
  include:
    - os: linux
      dist: trusty
      sudo: required
    - os: osx
      osx_image: xcode7.3

language: generic

install:
- ./.travis/install.sh

script:
- ./.travis/build.sh

install.sh:

eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/02090c7ede5a637b76e6df1710e83cd0bbe7dcdf/swiftenv-install.sh)"

Here is the log: http://pastebin.com/BQFHniaa

Building on TravisCI/Linux, can't find swift-build

Hi Kyle, at the moment i'm using the following .travis.yml, a variation on the sample from the docs:

os:
  - linux
language: generic
sudo: required
dist: trusty
osx_image: xcode7.2
install:
  - eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
env:
  - SWIFT_VERSION=2.2.1-SNAPSHOT-2016-04-23-a
script:
  - swift build

I tried with the SWIFT_VERSION you see above and with 2.2, but the result is always the same, travis can't find the swift-build binary:

Setting environment variables from .travis.yml
$ export SWIFT_VERSION=2.2.1-SNAPSHOT-2016-04-23-a

$ bash -c 'echo $BASH_VERSION'
4.3.11(1)-release
$ eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
Cloning into '/home/travis/.swiftenv'...
remote: Counting objects: 67, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 67 (delta 4), reused 34 (delta 3), pack-reused 0
Unpacking objects: 100% (67/67), done.
Checking connectivity... done.
Downloading https://swift.org/builds/swift-2.2-branch/ubuntu1404/swift-2.2.1-SNAPSHOT-2016-04-23-a/swift-2.2.1-SNAPSHOT-2016-04-23-a-ubuntu14.04.tar.gz
2.2.1-SNAPSHOT-2016-04-23-a has been installed.

$ swift build
error: unable to invoke subcommand: /home/travis/.swiftenv/versions/2.2.1-SNAPSHOT-2016-04-23-a/usr/bin/swift-build (No such file or directory)

The command "swift build" exited with 2.

I'm a missing something obvious in my travis.yml?

Full log here, everything else seems to be working.

Resuming download.

Currently if download failed, say, a network interrupt, run swiftenv again will download the swift distribution from start. Since swift distribution is not small, this will cause problems if network is unstable.

swiftenv uses curl to download swift distribution.
curl has -C|--continue-at to resume a download.

Supporting resume download will also fix #28

Errors after uninstalling snapshot

Here's how I got stuck up. I had three versions installed

* 2.2.1-SNAPSHOT-2016-04-23-a (set by /Users/sudhanshuraheja/.swiftenv/version)
  DEVELOPMENT-SNAPSHOT-2016-05-31-a
  2.2

I first moved to the development snapshot - swiftenv global DEVELOPMENT-SNAPSHOT-2016-05-31-a and then uninstalled 2.2.1-SNAPSHOT-2016-04-23-a by using swiftenv uninstall 2.2.1-SNAPSHOT-2016-04-23-a

Then I started getting these errors:

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

I now I get them everytime I run swiftenv versions

I'm on OSX 10.11.5 and installed SwiftEnv via Brew.

Feature swift list

Couldn't figure out which version I had to install, so maybe a command to list all versions of swift available to install or even a swift install latest

Swift-3.0 Preview-Branch Snapshots have malformed download links

To reproduce:

$> swiftenv install swift-3.0-preview-1-SNAPSHOT-2016-05-31-a
3.0-preview-1-SNAPSHOT-2016-05-31-a was not found on swift.org.
  https://swift.org/builds/swift-3.0-branch/xcode/swift-3.0-preview-1-SNAPSHOT-2016-05-31-a/swift-3.0-preview-1-SNAPSHOT-2016-05-31-a-osx.pkg

For previous snapshots, the base path was swift.org/builds/swift-3.0/branch. For these new preview snapshots, however, the base path changed to swift.org/builds/swift-3.0-preview-<version>-branch

For example: https://swift.org/builds/swift-3.0-preview-1-branch/xcode/swift-3.0-preview-1-SNAPSHOT-2016-05-31-a/swift-3.0-preview-1-SNAPSHOT-2016-05-31-a-osx.pkg.

I will create new issues for other bugs I run into.

c++ command messed up

Sorry for the hazy title but wanted to file this issue to keep track of it and add more info to it as I find time investigating this.

I'm on OSX 10.10.3.
I've installed swiftenv and it seemed to work well, until some system tool tried to call c++ which resulted in empty stdout-put.

which c++ yielded

~/.swiftenv/shims/c++

contents of ~/.swiftenv/shims/c++ is this:

#!/usr/bin/env bash
set -e
exec "/usr/local/Cellar/swiftenv/0.2.0/bin/../libexec/swiftenv" exec "c++" "$@"

Commenting out swiftenv in my .zshrc resolves the issues and I'm currently falling back to the system c++.

Let's play a game...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.