Skip to content

[BUG] Three issues with build_ninja.bash #3708

@GreyHak

Description

@GreyHak

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 1449b46 (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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    build / testing / port / CIAffecting the build system, tests, platform support, porting, or continuous integration.good first issueGood one-day project for beginners without much knowledge of the code base.help wantedA task that is desired, but needs somebody to commit the effort to implement it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions