adamreeve commented on code in PR #41599:
URL: https://github.com/apache/arrow/pull/41599#discussion_r1612520321


##########
ci/scripts/install_vcpkg.sh:
##########
@@ -25,7 +25,7 @@ if [ "$#" -lt 1 ]; then
 fi
 
 arrow_dir=$(cd -- "$(dirname -- "$0")/../.." && pwd -P)
-default_vcpkg_version=$(cat "${arrow_dir}/.env" | grep "VCPKG" | cut -d "=" 
-f2 | tr -d '"')
+default_vcpkg_version=$(source "${arrow_dir}/.env" && echo "$VCPKG" || echo "")

Review Comment:
   This was needed because there are some tasks that run in Docker where the 
`.env` file isn't included (it's not explicitly included in `.dockerignore`), 
eg: 
https://github.com/apache/arrow/blob/fb61e9f7a821dcb3c753fa6d6c36eec3714c257b/ci/docker/python-wheel-manylinux.dockerfile#L72
   
   This wasn't a problem previously because the pipefail option isn't set, so 
the failure calling `cat` was ignored.
   
   From what I can see these explicitly set the vcpkg version so 
`default_vcpkg_version` isn't used. Maybe it would make more sense to only try 
to read the vcpkg_version from `.env` if `$2` isn't set?



##########
ci/scripts/install_vcpkg.sh:
##########
@@ -25,7 +25,7 @@ if [ "$#" -lt 1 ]; then
 fi
 
 arrow_dir=$(cd -- "$(dirname -- "$0")/../.." && pwd -P)
-default_vcpkg_version=$(cat "${arrow_dir}/.env" | grep "VCPKG" | cut -d "=" 
-f2 | tr -d '"')
+default_vcpkg_version=$(source "${arrow_dir}/.env" && echo "$VCPKG" || echo "")

Review Comment:
   This was needed because there are some tasks that run in Docker where the 
`.env` file isn't included (it's not explicitly included in `.dockerignore`), 
eg: 
https://github.com/apache/arrow/blob/fb61e9f7a821dcb3c753fa6d6c36eec3714c257b/ci/docker/python-wheel-manylinux.dockerfile#L72
   
   From what I can see these explicitly set the vcpkg version so 
`default_vcpkg_version` isn't used. Maybe it would make more sense to only try 
to read the vcpkg_version from `.env` if `$2` isn't set?
   
   This wasn't a problem previously because the pipefail option isn't set, so 
the failure calling `cat` was ignored.



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