Avoid task_TIMESTAMP use on macOS generic-worker

This commit is contained in:
Alexandre Lissy 2018-10-15 14:24:20 +02:00
parent c7e6759293
commit 32a75d1d9d
3 changed files with 26 additions and 46 deletions

View File

@ -79,54 +79,16 @@ payload:
- "-cxe"
- >
export TASKCLUSTER_ARTIFACTS="$(pwd)/public/" &&
export TASKCLUSTER_ORIG_TASKDIR="$(pwd)" &&
(mkdir ../tc-workdir/ || rm -fr ../tc-workdir/*) && cd ../tc-workdir/ &&
(mv $TASKCLUSTER_ORIG_TASKDIR/homebrew/ homebrew/ || true) &&
(mv $TASKCLUSTER_ORIG_TASKDIR/homebrew.cache/ homebrew.cache/ || true) &&
export TASKCLUSTER_TASK_DIR="$(pwd)" &&
export LC_ALL=C &&
export TASKCLUSTER_ORIGIN_PATH="${system.homedir.osx}/TaskCluster/.*/task_[[:digit:]]\{10\}" &&
export TASKCLUSTER_REWRITE_PATH="$TASKCLUSTER_TASK_DIR" &&
export PKG_CONFIG_PATH="$TASKCLUSTER_TASK_DIR/homebrew/lib/pkgconfig" &&
export MACOSX_DEPLOYMENT_TARGET=10.10 &&
env &&
(
(
for link in $(find -L "$TASKCLUSTER_TASK_DIR/homebrew/" -type l);
do
newloc=$(readlink "$link" | sed -e "s|$TASKCLUSTER_ORIGIN_PATH|$TASKCLUSTER_REWRITE_PATH|g");
ln -hfs "$newloc" "$link";
done) || true) &&
(
(
for lib in $(find "$TASKCLUSTER_TASK_DIR/homebrew/" -type f -name "*.dylib");
do
chmod +w "$lib";
for id in $(otool -D "$lib" | grep "$TASKCLUSTER_ORIGIN_PATH");
do
newid=$(echo $id | sed -e "s|$TASKCLUSTER_ORIGIN_PATH|$TASKCLUSTER_REWRITE_PATH|g");
install_name_tool -id "$newid" "$lib";
done;
for dep in $(otool -L "$lib" | awk '{ print $1 }' | grep "$TASKCLUSTER_ORIGIN_PATH");
do
newdep=$(echo $dep | sed -e "s|$TASKCLUSTER_ORIGIN_PATH|$TASKCLUSTER_REWRITE_PATH|g");
install_name_tool -change "$dep" "$newdep" "$lib";
done;
chmod -w "$lib";
otool -L "$lib";
done) || true) &&
(
(
for bin in $(find "$TASKCLUSTER_TASK_DIR/homebrew/" -perm +111 -type f);
do
chmod +w "$bin";
for dep in $(otool -L "$bin" | awk '{ print $1 }' | grep "$TASKCLUSTER_ORIGIN_PATH");
do
newdep=$(echo $dep | sed -e "s|$TASKCLUSTER_ORIGIN_PATH|$TASKCLUSTER_REWRITE_PATH|g");
install_name_tool -change "$dep" "$newdep" "$bin";
done;
chmod -w "$bin";
otool -L "$bin";
done) || true) &&
(wget -O - $TENSORFLOW_BUILD_ARTIFACT | pixz -d | gtar -C $TASKCLUSTER_TASK_DIR --transform "s|$TASKCLUSTER_ORIGIN_PATH|$TASKCLUSTER_REWRITE_PATH|g" -xf - ) &&
((grep -R -I --files-with-matches "$TASKCLUSTER_ORIGIN_PATH" $TASKCLUSTER_TASK_DIR | grep -v "$TASKCLUSTER_TASK_DIR/generic-worker/" | xargs -n 1 -P 16 sed -i '' -e "s|$TASKCLUSTER_ORIGIN_PATH|$TASKCLUSTER_REWRITE_PATH|g") || true) &&
(wget -O - $TENSORFLOW_BUILD_ARTIFACT | pixz -d | gtar -C $TASKCLUSTER_TASK_DIR -xf - ) &&
git clone --quiet ${event.head.repo.url} $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/ &&
cd $TASKCLUSTER_TASK_DIR/DeepSpeech/ds && git checkout --quiet ${event.head.sha} &&
ln -s $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/native_client/ $TASKCLUSTER_TASK_DIR/DeepSpeech/tf/native_client &&
@ -134,7 +96,10 @@ payload:
$TASKCLUSTER_TASK_DIR/DeepSpeech/tf/tc-brew.sh &&
${swig.patch_nodejs.osx} &&
$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.build} &&
$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.package}
$TASKCLUSTER_TASK_DIR/DeepSpeech/ds/${build.scripts.package} ;
mv $TASKCLUSTER_TASK_DIR/homebrew/ $TASKCLUSTER_ORIG_TASKDIR/homebrew/ &&
mv $TASKCLUSTER_TASK_DIR/homebrew.cache/ $TASKCLUSTER_ORIG_TASKDIR/homebrew.cache/ &&
cd $TASKCLUSTER_TASK_DIR/../ && rm -fr tc-workdir/
artifacts:
- type: "directory"

View File

@ -23,6 +23,8 @@ then:
scopes: [
"queue:route:notify.irc-channel.*",
"generic-worker:cache:deepspeech-homebrew-bin",
"generic-worker:cache:deepspeech-homebrew-cache",
]
payload:
@ -49,6 +51,10 @@ then:
extraSystemSetup: { $eval: strip(str(build.system_setup)) }
in: >
export TASKCLUSTER_ARTIFACTS="$(pwd)/public/" &&
export TASKCLUSTER_ORIG_TASKDIR="$(pwd)" &&
(mkdir ../tc-workdir/ || rm -fr ../tc-workdir/*) && cd ../tc-workdir/ &&
(mv $TASKCLUSTER_ORIG_TASKDIR/homebrew/ homebrew/ || true) &&
(mv $TASKCLUSTER_ORIG_TASKDIR/homebrew.cache/ homebrew.cache/ || true) &&
export TASKCLUSTER_TASK_DIR="$(pwd)" &&
export TASKCLUSTER_TMP_DIR="$TASKCLUSTER_TASK_DIR/tmp" &&
export LC_ALL=C &&
@ -59,7 +65,16 @@ then:
cd $TASKCLUSTER_TASK_DIR/DeepSpeech/ds && git checkout --quiet ${event.head.sha} &&
cd $TASKCLUSTER_TASK_DIR &&
source $TASKCLUSTER_TASK_DIR/DeepSpeech/ds/tc-brew-tests.sh && ${extraSystemSetup} &&
/bin/bash ${build.args.tests_cmdline}
/bin/bash ${build.args.tests_cmdline} ;
mv $TASKCLUSTER_TASK_DIR/homebrew/ $TASKCLUSTER_ORIG_TASKDIR/homebrew/ &&
mv $TASKCLUSTER_TASK_DIR/homebrew.cache/ $TASKCLUSTER_ORIG_TASKDIR/homebrew.cache/ &&
cd $TASKCLUSTER_TASK_DIR/../ && rm -fr tc-workdir/
mounts:
- cacheName: deepspeech-homebrew-bin
directory: homebrew/
- cacheName: deepspeech-homebrew-cache
directory: homebrew.cache/
metadata:
name: ${build.metadata.name}

View File

@ -37,7 +37,7 @@ install_local_homebrew()
mkdir -p "${LOCAL_HOMEBREW_DIRECTORY}"
mkdir -p "${HOMEBREW_CACHE}"
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C "${LOCAL_HOMEBREW_DIRECTORY}"
curl -L https://github.com/Homebrew/brew/tarball/1.7.7 | tar xz --strip 1 -C "${LOCAL_HOMEBREW_DIRECTORY}"
export PATH=${LOCAL_HOMEBREW_DIRECTORY}/bin:$PATH
if [ ! -x "${LOCAL_HOMEBREW_DIRECTORY}/bin/brew" ]; then