driazati commented on a change in pull request #10246:
URL: https://github.com/apache/tvm/pull/10246#discussion_r814260795
##########
File path: tests/scripts/task_build.sh
##########
@@ -15,5 +15,41 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-export VTA_HW_PATH=`pwd`/3rdparty/vta-hw
-cd $1 && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && make $2 && cd ..
+set -eux
+
+VTA_HW_PATH=$(pwd)/3rdparty/vta-hw
+export VTA_HW_PATH
+
+pushd "$1"
+
+# Set up sccache to use S3
+if [ -n "${3+x}" ] && which sccache; then
+ export SCCACHE_BUCKET=$3
+ HAS_SCCACHE=1
+else
+ export SCCACHE_BUCKET="no-bucket-configured"
+ HAS_SCCACHE=0
+fi
+
+if [ "$HAS_SCCACHE" -eq "1" ]; then
+ echo "Running with sccache enabled"
+ export CC=/opt/sccache/cc
+ export CXX=/opt/sccache/c++
+fi
+
+# Send this out through a side channel, the bucket name is not actually secret
+# so it's OK to leak it in this way
+echo "$SCCACHE_BUCKET" | base64
+
+if [ "$HAS_SCCACHE" -eq "1" ]; then
+ sccache --start-server || echo failed
+ sccache --show-stats
+fi
+
+cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
+cmake --build . -- VERBOSE=1 "$2"
+
+if [ "$HAS_SCCACHE" -eq "1" ]; then
+ sccache --show-stats
Review comment:
We could but the output is pretty recognizable, looks something like
this:
```
Compile requests 0
Compile requests executed 0
Cache hits 0
Cache misses 0
Cache timeouts 0
Cache read errors 0
Forced recaches 0
Cache write errors 0
Compilation failures 0
Cache errors 0
Non-cacheable compilations 0
Non-cacheable calls 0
Non-compilation calls 0
Unsupported compiler calls 0
Average cache write 0.000 s
Average cache read miss 0.000 s
Average cache read hit 0.000 s
Failed distributed compilations 0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]