New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrooge: Fixing Travis CI builds #196
Changes from 1 commit
28b8983
8fe5750
dc60240
5c389bb
a5a4002
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ jdk: | |
- oraclejdk7 | ||
- openjdk7 | ||
|
||
script: "./sbt ++$TRAVIS_SCALA_VERSION test" | ||
script: ./build-support/bin/ci.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set -e? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the way !! |
||
function clone_repo { | ||
local name=$1 | ||
local repo=$2 | ||
local branch=$3 | ||
git clone $repo || { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can simplify this by using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's right ... I will go for it and change it at the script. |
||
echo "Unable to clone $name from $repo" | ||
exit 1 | ||
} | ||
cd $name || { | ||
echo "Unable to get $name from $repo" | ||
exit 2 | ||
} | ||
git checkout $branch || { | ||
echo "Unable to checkout branch $branch for $name from $repo" | ||
exit 3 | ||
} | ||
cd .. | ||
} | ||
|
||
function publish_local { | ||
local name=$1 | ||
local target=$2 | ||
cd $name || { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems unlikely to fail, and if it does, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good point, will change it with set -e and -x too. |
||
echo "Unable to get $name for publish local $target" | ||
exit 4 | ||
} | ||
../../../sbt ++$TRAVIS_SCALA_VERSION $target || { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not use ./sbt? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using the ./sbt included with finagle and util gives errors, exactly the error is -> bad sbt-launch.jar. delete sbt-launch.jar and run ./sbt again. I tried to delete de sbt-launch.jar just for curiosity but the error remains. For a moment I though it was a local error on my machine but Travis CI gives the same error. So, I just use the sbt included on scrooge. Do you have the same error using ./sbt from finagle ? I will try to figure out what the error is and we can discuss about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, that's very strange. That should only happen if you're in a directory which already has an sbt-launch.jar. Don't spend too much time on it, if you can't figure out why, just add a TODO. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've found the error -> The SBTOPTS from Travis CI are clashing with the internal ./sbt So I just added "unset SBTOPTS" to the .travis.yml file and it works now and actually finagle's .travis.yml file has the same "unset SBTOPTS" configuration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh oh !! ... the ./sbt of util is crashing at the JVM when using openjdk7 and scrooge sbt is working just fine. I will put a TODO by now. |
||
echo "Unable to publish local $name with target $target" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is cool, but we could probably just publish-local everything. do you not want to do that because it's slow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it was because it was slow, but on top of that it's because a couple of finagle projects got errors while building from develop, so I try to reduce the impact on finagle dependencies including the ones that specifically scrooge depends on. What do you think ? |
||
exit 5 | ||
} | ||
cd .. | ||
} | ||
|
||
function bootstrap_scrooge { | ||
local current_branch=$(git rev-parse --abbrev-ref HEAD) | ||
if [ "$current_branch" != "master" ]; then | ||
mkdir -p build-support/tmp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe use mktemp instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duh for me !! ... you are right, that's even better (easier and cleaner). I will change it to mktemp instead. |
||
cd build-support/tmp | ||
# util | ||
clone_repo util https://github.com/twitter/util.git develop | ||
publish_local util publishLocal | ||
# ostrich | ||
clone_repo ostrich https://github.com/twitter/ostrich.git develop | ||
publish_local ostrich publishLocal | ||
# finagle | ||
clone_repo finagle https://github.com/twitter/finagle.git develop | ||
publish_local finagle finagle-core/publishLocal | ||
publish_local finagle finagle-mux/publishLocal | ||
publish_local finagle finagle-httpx/publishLocal | ||
publish_local finagle finagle-thrift/publishLocal | ||
publish_local finagle finagle-thriftmux/publishLocal | ||
publish_local finagle finagle-ostrich4/publishLocal | ||
cd ../.. | ||
fi | ||
} | ||
|
||
bootstrap_scrooge | ||
|
||
./sbt ++$TRAVIS_SCALA_VERSION test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ object Scrooge extends Build { | |
val suffix = if (branch == "master") "" else "-SNAPSHOT" | ||
|
||
val libVersion = "3.18.1" + suffix | ||
|
||
// For develop users: if you are using new features in util and finagle dependencies | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we say "For users of the develop branch"? Seems a little clearer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, it might be a good idea to recommend publishing Util and Finagle locally for anyone working on the develop branch—users may not have any idea whether Scrooge is using features that have been introduced since the last release, and if they guess wrong they may end up with weird errors (possibly at runtime). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course. Here it goes !! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ostrich is also a required local dependency when working with the develop branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyway, I think that explanation is already included at https://github.com/twitter/scrooge/blob/master/README.md |
||
// that are not yet published to Maven Central, you'll need to publish util and | ||
// finagle locally | ||
val utilVersion = "6.24.0" + suffix | ||
val finagleVersion = "6.25.0" + suffix | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love putting this in build-support/bin, we already have a bin directory, can we use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point. I will put it in the already existing bin directory.