Repository: spack/spack

Issue:
Ruby-narray build issue
@adamjstewart , Regarding PR [18199](https://github.com/spack/spack/pull/18199), in commit [443407c](https://github.com/spack/spack/commit/443407cda545e31d33c9d5abac393c8ac8ad33a2) `ruby-narray` modified to new build_systems `RubyPackage`, I tried to build latest and last 4 previous releases and all failed, any ideas on this? thought mention it here before take it to `narray` developers.
<!-- Thanks for taking the time to report this build failure. To proceed with the report please:

1. Title the issue "Installation issue: <name-of-the-package>".
2. Provide the information required below.

We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack spec --install-status ruby-narray@0.9.1.8 ^/p33cxs7
Input spec
--------------------------------
 -   ruby-narray@0.9.1.8
[+]      ^ruby@2.6.2%gcc@9.1.0+openssl+readline arch=linux-rhel6-haswell
[+]          ^libffi@3.2.1%gcc@9.1.0 arch=linux-rhel6-haswell
[+]          ^libx11@1.6.7%gcc@9.1.0 arch=linux-rhel6-haswell
[+]              ^kbproto@1.0.7%gcc@9.1.0 arch=linux-rhel6-haswell
[+]              ^libxcb@1.13%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                  ^libpthread-stubs@0.4%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                  ^libxau@1.0.8%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                      ^xproto@7.0.31%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                  ^libxdmcp@1.1.2%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                      ^libbsd@0.9.1%gcc@9.1.0 arch=linux-rhel6-haswell
[+]              ^xextproto@7.3.0%gcc@9.1.0 arch=linux-rhel6-haswell
[+]          ^openssl@1.1.1d%gcc@9.1.0+systemcerts arch=linux-rhel6-haswell
[+]              ^zlib@1.2.11%gcc@9.1.0+optimize+pic+shared arch=linux-rhel6-haswell
[+]          ^readline@8.0%gcc@9.1.0 arch=linux-rhel6-haswell
[+]              ^ncurses@6.1%gcc@9.1.0~symlinks~termlib arch=linux-rhel6-haswell
[+]          ^tcl@8.6.8%gcc@9.1.0 arch=linux-rhel6-haswell
[+]          ^tk@8.6.8%gcc@9.1.0+xft+xss arch=linux-rhel6-haswell
[+]              ^libxft@2.3.2%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                  ^fontconfig@2.12.3%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                      ^font-util@1.3.2%gcc@9.1.0 fonts=encodings,font-adobe-100dpi,font-adobe-75dpi,font-adobe-utopia-100dpi,font-adobe-utopia-75dpi,font-adobe-utopia-type1,font-alias,font-arabic-misc,font-bh-100dpi,font-bh-75dpi,font-bh-lucidatypewriter-100dpi,font-bh-lucidatypewriter-75dpi,font-bh-ttf,font-bh-type1,font-bitstream-100dpi,font-bitstream-75dpi,font-bitstream-speedo,font-bitstream-type1,font-cronyx-cyrillic,font-cursor-misc,font-daewoo-misc,font-dec-misc,font-ibm-type1,font-isas-misc,font-jis-misc,font-micro-misc,font-misc-cyrillic,font-misc-ethiopic,font-misc-meltho,font-misc-misc,font-mutt-misc,font-schumacher-misc,font-screen-cyrillic,font-sun-misc,font-winitzki-cyrillic,font-xfree86-type1 arch=linux-rhel6-haswell
[+]                      ^freetype@2.10.1%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                          ^bzip2@1.0.8%gcc@9.1.0+shared arch=linux-rhel6-haswell
[+]                          ^libpng@1.6.37%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                      ^libxml2@2.9.9%gcc@9.1.0~python arch=linux-rhel6-haswell
[+]                          ^libiconv@1.16%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                          ^xz@5.2.4%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                  ^libxrender@0.9.10%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                      ^renderproto@0.11.1%gcc@9.1.0 arch=linux-rhel6-haswell
[+]              ^libxscrnsaver@1.2.2%gcc@9.1.0 arch=linux-rhel6-haswell
[+]                  ^libxext@1.3.3%gcc@9.1.0 arch=linux-rhel6-haswell
```

### Information on your system

```
$ spack debug report
* **Spack:** 0.15.4
* **Python:** 2.6.6
* **Platform:** linux-rhel6-haswell
```

<!-- Please include the output of `spack debug report` -->

<!-- If you have any relevant configuration detail (custom `packages.yaml` or `modules.yaml`, etc.) you can add that here as well. -->

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->
* [spack-build-out.txt]()

```
==> Installing ruby-narray
==> No binary for ruby-narray found: installing from source
==> Fetching https://github.com/ruby-numo/numo-narray/archive/v0.9.1.8.tar.gz
######################################################################## 100.0%
==> ruby-narray: Executing phase: 'build'
==> [2020-11-09-11:04:22.024157] '/sw/spack-rhel6/ruby-2.6.2-p33cxs/bin/gem' 'build' '--norc' 'numo-narray.gemspec'
fatal: Not a git repository (or any of the parent directories): .git
WARNING:  open-ended dependency on rake (>= 12.3.3, development) is not recommended
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: numo-narray
  Version: 0.9.1.8
  File: numo-narray-0.9.1.8.gem
==> ruby-narray: Executing phase: 'install'
==> [2020-11-09-11:04:22.418063] '/sw/spack-rhel6/ruby-2.6.2-p33cxs/bin/gem' 'install' '--norc' '--ignore-dependencies' 'numo-narray-0.9.1.8.gem'
Building native extensions. This could take a while...
ERROR:  Error installing numo-narray-0.9.1.8.gem:
	ERROR: Failed to build gem native extension.

    current directory: /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.1.8-ufp3le/gems/numo-narray-0.9.1.8/ext/numo/narray
/mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/bin/ruby -I /mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/lib/ruby/2.6.0 -r ./siteconf20201109-37266-1kzysu3.rb extconf.rb
checking for stdbool.h... yes
checking for stdint.h... yes
checking for bool in stdbool.h... yes
checking for u_int8_t in stdint.h... yes
checking for u_int16_t in stdint.h... yes
checking for int32_t in stdint.h... yes
checking for u_int32_t in stdint.h... yes
checking for int64_t in stdint.h... yes
checking for u_int64_t in stdint.h... yes
checking for exp10()... yes
checking for rb_arithmetic_sequence_extract()... yes
checking for rb_cComplex... yes
creating /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.1.8-ufp3le/gems/numo-narray-0.9.1.8/ext/numo/narray/numo/extconf.h
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/bin/$(RUBY_BASE_NAME)
/mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/lib/ruby/2.6.0/mkmf.rb:1716:in `initialize': No such file or directory @ rb_sysopen - /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.1.8-ufp3le/gems/numo-narray-0.9.1.8/ext/numo/narray/numo/extconf.h (Errno::ENOENT)
	from /mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/lib/ruby/2.6.0/mkmf.rb:1716:in `open'
	from /mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/lib/ruby/2.6.0/mkmf.rb:1716:in `create_header'
	from extconf.rb:96:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.1.8-ufp3le/extensions/x86_64-linux/2.6.0-static/numo-narray-0.9.1.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.1.8-ufp3le/gems/numo-narray-0.9.1.8 for inspection.
Results logged to /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.1.8-ufp3le/extensions/x86_64-linux/2.6.0-static/numo-narray-0.9.1.8/gem_make.out
==> Error: ProcessError: Command exited with status 1:
    '/sw/spack-rhel6/ruby-2.6.2-p33cxs/bin/gem' 'install' '--norc' '--ignore-dependencies' 'numo-narray-0.9.1.8.gem'

1 error found in build log:
     44    	--without-opt-lib=${opt-dir}/lib
     45    	--with-make-prog
     46    	--without-make-prog
     47    	--srcdir=.
     48    	--curdir
     49    	--ruby=/mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/
           bin/$(RUBY_BASE_NAME)
  >> 50    /mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/lib/ruby
           /2.6.0/mkmf.rb:1716:in `initialize': No such file or directory @@ rb_
           sysopen - /mnt/lustre01/spack-workplace/spack-rhel6/ruby-narray-0.9.
           1.8-ufp3le/gems/numo-narray-0.9.1.8/ext/numo/narray/numo/extconf.h (
           Errno::ENOENT)
     51    	from /mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/li
           b/ruby/2.6.0/mkmf.rb:1716:in `open'
     52    	from /mnt/lustre01/spack-workplace/spack-rhel6/ruby-2.6.2-p33cxs/li
           b/ruby/2.6.0/mkmf.rb:1716:in `create_header'
     53    	from extconf.rb:96:in `<main>'
     54    
     55    To see why this extension failed to compile, please check the mkmf.l
           og which can be found here:
     56    
```
* [spack-build-env.txt]()

<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [ ] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [ ] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/ruby-narray/package.py b/var/spack/repos/builtin/packages/ruby-narray/package.py
--- a/var/spack/repos/builtin/packages/ruby-narray/package.py
+++ b/var/spack/repos/builtin/packages/ruby-narray/package.py
@@ -11,7 +11,9 @@ class RubyNarray(RubyPackage):
 
     homepage = "https://masa16.github.io/narray/"
     url      = "https://github.com/ruby-numo/numo-narray/archive/v0.9.1.8.tar.gz"
+    git      = "https://github.com/ruby-numo/numo-narray.git"
 
+    version('master',  branch='master')
     version('0.9.1.8', sha256='48814c6ebf2c4846fcf6cfd2705a15a97a608960c1676cb6c7b5c9254b0dd51b')
 
     depends_on('ruby@2.2:2.999', type=('build', 'run'))


Test patch: