pitrou commented on code in PR #13556:
URL: https://github.com/apache/arrow/pull/13556#discussion_r925810577


##########
docker-compose.yml:
##########
@@ -62,6 +62,12 @@ x-ccache: &ccache
   CCACHE_MAXSIZE: 1G
   CCACHE_DIR: /ccache
 
+x-sccache: &sccache
+  AWS_ACCESS_KEY_ID:
+  AWS_SECRET_ACCESS_KEY:
+  SCCACHE_BUCKET:

Review Comment:
   Does it mean they are inherited from the calling process environment?



##########
docker-compose.yml:
##########
@@ -245,8 +251,10 @@ services:
     volumes: &conda-volumes
       - .:/arrow:delegated
       - ${DOCKER_VOLUME_PREFIX}conda-ccache:/ccache:delegated
-    command:
-      ["/arrow/ci/scripts/cpp_build.sh /arrow /build &&
+    command: &conda-cpp-command
+      ["/arrow/ci/scripts/install_sccache.sh unknown-linux-musl &&

Review Comment:
   I'm curious: why "unknown-linux-musl"? Does our conda image really use musl?



##########
dev/tasks/r/github.packages.yml:
##########
@@ -82,10 +82,15 @@ jobs:
       {{ macros.github_checkout_arrow()|indent }}
       {{ macros.github_change_r_pkg_version(is_fork, '${{ 
needs.source.outputs.pkg_version }}')|indent }}
       {{ macros.github_install_archery()|indent }}
+
       - name: Build libarrow
         shell: bash
         env:
-          UBUNTU: {{ '${{ matrix.config.version}}' }}
+          AWS_ACCESS_KEY_ID: {{ '${{ secrets.AWS_ACCESS_KEY_ID }}' }}
+          AWS_SECRET_ACCESS_KEY: {{' ${{ secrets.AWS_SECRET_ACCESS_KEY }}' }}
+          SCCACHE_BUCKET: {{ '${{ secrets.SCCACHE_BUCKET }}' }}
+          SCCACHE_S3_KEY_PREFIX: sccache

Review Comment:
   This snippet is everywhere, can it be made a macro?



##########
docker-compose.yml:
##########
@@ -245,8 +251,10 @@ services:
     volumes: &conda-volumes
       - .:/arrow:delegated
       - ${DOCKER_VOLUME_PREFIX}conda-ccache:/ccache:delegated
-    command:
-      ["/arrow/ci/scripts/cpp_build.sh /arrow /build &&
+    command: &conda-cpp-command
+      ["/arrow/ci/scripts/install_sccache.sh unknown-linux-musl &&

Review Comment:
   Also, can the `install_sccache.sh` call instead be moved to the dockerfile?



##########
docker-compose.yml:
##########
@@ -245,8 +251,10 @@ services:
     volumes: &conda-volumes
       - .:/arrow:delegated
       - ${DOCKER_VOLUME_PREFIX}conda-ccache:/ccache:delegated
-    command:
-      ["/arrow/ci/scripts/cpp_build.sh /arrow /build &&
+    command: &conda-cpp-command
+      ["/arrow/ci/scripts/install_sccache.sh unknown-linux-musl &&
+        export PATH=$$(pwd)/sccache:$$PATH &&

Review Comment:
   Probably sccache can be installed to `/usr/local/bin` instead?



##########
r/inst/build_arrow_static.sh:
##########
@@ -87,4 +87,7 @@ ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
 
 ${CMAKE} --build . --target install
 
+echo "=== sccache stats after the build ==="
+sccache --show-stats

Review Comment:
   Can we add similar snippets to `ci/script/cpp_build.sh`, just as with ccache?



##########
ci/scripts/install_sccache.sh:
##########
@@ -0,0 +1,51 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+if [  "$#" -lt 1 -o "$#" -gt 3 ]; then
+    echo "Usage: $0 <build> <arch> <version>"
+    echo "Will default to arch=x86_64 and version=0.3.0 "
+    exit 1
+fi
+
+BUILD=$1
+ARCH=${2:-x86_64}
+VERSION=${3:-0.3.0}
+
+SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v0.3.0/sccache-v$VERSION-$ARCH-$BUILD.tar.gz";
+SCCACHE_ARCHIVE=sccache.tar.gz
+
+# Download archive and checksum
+curl -L $SCCACHE_URL --output $SCCACHE_ARCHIVE
+curl -L $SCCACHE_URL.sha256 --output $SCCACHE_ARCHIVE.sha256
+
+echo "$(cat $SCCACHE_ARCHIVE.sha256) $SCCACHE_ARCHIVE" | sha256sum --check 
--status
+
+mkdir -p sccache
+tar -xzvf $SCCACHE_ARCHIVE --strip-component=1 --directory sccache
+chmod u+x sccache/sccache
+
+SCCACHE_DIR=$(pwd)/sccache

Review Comment:
   Can the install prefix instead be taken as an argument, just like for 
`install_minio.sh`?
   



-- 
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]

Reply via email to