Aggarwal-Raghav commented on code in PR #6832:
URL: https://github.com/apache/hive/pull/6832#discussion_r4144917481


##########
.github/workflows/build.yml:
##########
@@ -45,8 +45,51 @@ jobs:
           java-version: '21'
           distribution: 'temurin'
           cache: maven
+      - name: Cache Thrift 0.16.0
+        if: runner.os == 'Linux'
+        id: cache-thrift
+        uses: actions/cache@v4
+        with:
+          path: ${{ github.workspace }}/thrift-0.16.0-install
+          key: thrift-0.16.0-${{ runner.os }}-${{ runner.arch }}
+      - name: Install Thrift 0.16.0
+        if: runner.os == 'Linux' && steps.cache-thrift.outputs.cache-hit != 
'true'
+        run: |
+          sudo apt-get update && sudo apt-get install -y automake bison flex 
g++ libboost-all-dev libevent-dev libssl-dev libtool make pkg-config
+          wget -q 
https://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz
+          tar xzf thrift-0.16.0.tar.gz
+          cd thrift-0.16.0
+          ./bootstrap.sh
+          ./configure --prefix=${{ github.workspace }}/thrift-0.16.0-install \
+            --without-java --without-python --without-py3 --without-ruby \
+            --without-nodejs --without-go --without-erlang --without-lua \
+            --without-perl --without-php --without-php_extension 
--without-dart \
+            --without-dotnetcore --without-swift --without-rs \
+            --without-cl --without-haskell --without-d \
+            --without-cpp --without-c_glib --without-netstd
+          make -j$(nproc)
+          make install
+          mkdir -p ${{ github.workspace }}/thrift-0.16.0-install/share/fb303/if
+          cp contrib/fb303/if/fb303.thrift ${{ github.workspace 
}}/thrift-0.16.0-install/share/fb303/if/
+          cd ..
+          rm -rf thrift-0.16.0 thrift-0.16.0.tar.gz
       - name: Build with Maven
-        run: >
-          mvn clean install -DskipTests -Pitests
+        run: |
+          PROFILES="-Pitests"
+          if [[ "$RUNNER_OS" == "Linux" ]]; then
+            PROFILES+=",thriftif -Dthrift.home=${{ github.workspace 
}}/thrift-0.16.0-install"
+          fi
+          mvn clean install -DskipTests $PROFILES
+      - name: Thrift validation
+        if: runner.os == 'Linux'
+        run: |
+          n=$(git status -s -- '*/src/gen/thrift/*' | wc -l)

Review Comment:
   I don't find wc reliable as shell configs and line endings  (`'\r', '\n', 
'\r\n'`) can give different output
   ```
   if [ -n "$(git status -s -- '*/src/gen/thrift/*')" ]; then
     echo "ERROR: Thrift generated code is out of date!" >&2
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to