Allow installing dub in standalone#301
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
c2fe280 to
707db0d
Compare
| log "Using dub shipped with $2" | ||
| DUB_BIN_PATH="${ROOT}/dub" | ||
| install_dub | ||
| fi |
There was a problem hiding this comment.
I deliberately avoided updating the default dub symlink (which happens in install_dub), though there are pros and cons for this.
| DUB_VERSION="$(fetch "${mirrors[@]}")" | ||
| local DUB="dub-${DUB_VERSION}" | ||
| if [ -z "$1" ] ; then | ||
| COMPILER="$DUB" |
There was a problem hiding this comment.
I wasn't sure on the best way to deal with this.
The problem is that I wanted to reuse the logic here in install_dub, but in install dmd path, we can't set COMPILER, but for install dub we should.
The missing coverage is because currently we only use specific versions on for the CI.
| if [[ $name =~ \.tar\.xz$ ]]; then | ||
| tar --strip-components=1 -C "$tmp" -Jxf "$tmp/$name" | ||
| elif [[ $name =~ \.tar\.gz$ ]]; then | ||
| tar -C "$tmp" -xf "$tmp/$name" |
There was a problem hiding this comment.
The dub binary is in the root-level.
| deactivate() { | ||
| export PATH="\$_OLD_D_PATH" | ||
| EOF | ||
| if [ -n "$libpath" ] ; then |
There was a problem hiding this comment.
The following code writes thin activate scripts that only set the variables that are actually set.
In other words things like LIBRARY_PATH aren't written for dub
test/all.sh
Outdated
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
| . $DIR/common.sh | ||
|
|
||
| for file in $(find "$DIR" -name "*.sh") ; do |
There was a problem hiding this comment.
Motivation: it's a lot more convenient to have small files as they can be run individually.
I have already run into this before, e.g. #297 (contains the same idea with test/all.sh)
|
FYI this has now been used by Vibe.d (vibe-d/vibe.d#2140) and Dub (vibe-d/vibe.d#2140) for about a month with the builds being a lot more greenish... |
|
At DConf Martin was a bit sceptical about using |
|
How about simply |
c9b4641 to
4b2741e
Compare
Ok. Went with this ;-) |
Any objections? |
|
Not really, but I don't understand the code very well. |
This allows using the installer script to install an individual version of DUB.
The main motivation for this are the failing DUB + Vibe.d Travis builds which still test very old DMD versions which don't come with the latest DUB binaries.
In the future we might support something like
dmd-2.072.0+dub(latest dub) ordmd-2.072.2+dub.1.7.2, but for now this allows @s-ludwig to do add this extra line to update to the latest dub: