OpenImageIO icon indicating copy to clipboard operation
OpenImageIO copied to clipboard

[BUG] Three issues with build_ninja.bash

Open GreyHak opened this issue 2 years ago • 1 comments
trafficstars

Describe the bug

  1. https://github.com/OpenImageIO/oiio/blob/master/src/build-scripts/build_ninja.bash#L13 performs a check to see if a .zip file exists. If it doesn't a .tar.gz file is downloaded. Either way a .tar.gz file is extracted. The check should be for the existance of a .tar.gz file, not a .zip file.
  2. The path of the file downloaded https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz, no longer aligned with GitHub's release file structure. The download is now available at https://github.com/ninja-build/ninja/archive/refs/tags/v1.10.2.tar.gz. "refs/tags" needs to be added.

To Reproduce Steps to reproduce the behavior:

  1. Run src/build-scripts/build_ninja.bash
  2. Or run src/build-scripts/build_ninja.bash with oiio/ext/downloads/ninja-1.10.2.zip already present. You can download it from https://github.com/ninja-build/ninja/archive/refs/tags/v1.10.2.zip

Expected behavior If the .zip file is present, but the .tar.gz file is not, the script will attempt to untar the nonexistent file and fail. If neither file is present, the script will attempt to download the .tar.gz file file from the wrong location and fail.

Evidence

+ LOCAL_DEPS_DIR=/home/cent/git/external/oiio/ext
+ DOWNLOADS_DIR=/home/cent/git/external/oiio/ext/downloads
+ NINJA_REPO=https://github.com/ninja-build/ninja
+ NINJA_VERSION=1.10.2
+ NINJA_BRANCH=v1.10.2
+ NINJA_INSTALL_DIR=/home/cent/git/external/oiio/ext/dist/bin
+ '[' '!' -f /home/cent/git/external/oiio/ext/downloads/ninja-1.10.2.zip ']'
+ curl --location https://github.com/ninja-build/ninja/archive/v1.10.2.tar.gz -o /home/cent/git/external/oiio/ext/downloads/ninja-v1.10.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Failed to create the file
Warning: /home/cent/git/external/oiio/ext/downloads/ninja-v1.10.2.tar.gz: No
Warning: such file or directory
  0  208k    0   512    0     0    773      0  0:04:36 --:--:--  0:04:36  2327
curl: (23) Failure writing output to destination

Platform information:

  • OIIO branch/version: commit 1449b465000bf7c83e983cf870ca7b1f2966d446 (HEAD -> master, origin/master, origin/HEAD)
  • OS: CentOS Stream release 9
  • C++ compiler: g++ 11.3.1 20221121
  • Any non-default build flags when you build OIIO: No. Not getting that far.

GreyHak avatar Dec 14 '22 23:12 GreyHak

Trying to get passed that error I discovered that it's trying to download into a downloads folder which does not exist. So that's a third problem.

GreyHak avatar Dec 14 '22 23:12 GreyHak