Repository: spack/spack

Issue:
 Error: Cannot find directory sc/config when spack install --keep-stage -v p4est
<!-- 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! -->
I meet a problem about error: cannot find directory sc/config when spack install --keep-stage -v p4est.
### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
[root@centos8 p4est]# git diff
diff --git a/__pycache__/package.cpython-36.pyc b/__pycache__/package.cpython-36.pyc
index 00cbdd1..54a829c 100644
Binary files a/__pycache__/package.cpython-36.pyc and b/__pycache__/package.cpython-36.pyc differ
diff --git a/package.py b/package.py
index b7c2a80..85337b0 100644
--- a/package.py
+++ b/package.py
@@ -10,13 +10,15 @@ class P4est(AutotoolsPackage):
     """Dynamic management of a collection (a forest) of adaptive octrees in
     parallel"""
     homepage = "http://www.p4est.org"
-    url      = "http://p4est.github.io/release/p4est-2.2.tar.gz"
+    url      = "https://github.com/cburstedde/p4est/archive/refs/tags/v2.3.1.tar.gz"

     maintainers = ['davydden']

-    version('2.2', sha256='1549cbeba29bee2c35e7cc50a90a04961da5f23b6eada9c8047f511b90a8e438')
-    version('2.0', sha256='c522c5b69896aab39aa5a81399372a19a6b03fc6200d2d5d677d9a22fe31029a')
-    version('1.1', sha256='0b5327a35f0c869bf920b8cab5f20caa4eb55692eaaf1f451d5de30285b25139')
+    version('2.3.1', sha256='8acd592863f440656f8a97561f323b7e888fd82127203c06ae2e14753dea66a2')
+    version('2.3',   sha256='3fa2471888e07152d77e002d216d109c0d8bbc144fe3fd89833845883e28d3b8')
+    version('2.2',   sha256='7df0e9a161b6ea680324dfdbc0ffc6e0d0a6c9c9b0ea5b37c973e71a054226c2')
+    version('2.1',   sha256='83938a46a016f1836e63b63800366b8c9906f246bc8340aaebb6e74fd9de590b')
+    version('2.0',   sha256='1533989c089253372bf3a134740a06cad3fff6c6e9969c09dc31ee14b27f1efe')

     variant('mpi', default=True, description='Enable MPI')
     variant('openmp', default=False, description='Enable OpenMP')
[root@centos8 p4est]# spack install --keep-stage -v p4est
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libiconv-1.16-dx2c372kkymixiwrw6jtba3gruhddu2d
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/pkgconf-1.7.4-ikffkz6hwfns2buce5tud6347cqoqvmo
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/xz-5.2.5-n6x7ibnlnr5sovxoy5kjhhglcjerbgyy
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/zlib-1.2.11-4jtfw6w6w3p7fk6kmewvik22samcjo6c
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/berkeley-db-18.1.40-3iikdjqje7xysxuarta4utetdcastamc
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libsigsegv-2.12-hlg3277qpi5cifqonc2bnetgdfdphdiz
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/util-macros-1.19.1-qfkzudf2vypexlneptcntzr6pio3dqga
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/diffutils-3.7-gnxhse3mokojswxuezy564565dydg2dk
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/tar-1.34-iofxsdlyeidhhmnwjxgo7re7bmotcsnd
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/ncurses-6.2-izz664uhnirqbradwycfl4t3fmvspqoh
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libxml2-2.9.10-ufo5plslr5ucnhxrhv4a5iuyuzbh6vh3
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/m4-1.4.18-hqb7zucblvvteuesapp37gfak3biyh7s
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/bzip2-1.0.8-corln5kph65itvn6xbh3qdtx4aemcwmd
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/readline-8.1-ub23eamogfdea4hlpltmsawi7ruaj7dl
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libedit-3.1-20210216-pxtfofimtus3iwnvj2wv7qjaatyjvd2g
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libtool-2.4.6-6w2yuvybjmm6amwr7ydluafb3tgtnacx
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/gettext-0.21-nain2gv5tap5zyzepj6ixm24mye6r35q
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/gdbm-1.19-iljm5hybzvpmb37ksmxoiqokwyi4gsy7
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libpciaccess-0.16-t5wplngigwwetserfoefxgufneuvngcz
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/perl-5.32.1-qcuhfwae7o6bqouwvwnohfsqiazet2xo
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/hwloc-2.4.1-jy354ker4ydbxe34zmguqegdptyz6x3z
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/openssl-1.1.1k-md4i3kcjdpija6oxvrkub3uwju6guonc
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/help2man-1.47.16-k3y7dgufyol3splvwhqxlwguriyhkiuj
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/libevent-2.1.12-k2zwaz536ffznr75l2gfrlbsiwb5364y
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/openssh-8.5p1-67vztjfqx2d3ly5lxsp3xbkzzs4sr6fe
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/autoconf-2.69-fjucuvzpdplzq3frxgqkgsmr5m5mtazs
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/automake-1.16.3-mk32b2yjmnlcelep7hstxzjvqjfu3mgv
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/numactl-2.0.14-rkccr7zomsdfg42x4ey2ibrjygeecp4n
[+] /home/spack/spack/opt/spack/linux-centos8-aarch64/gcc-8.3.1/openmpi-4.0.5-zxif3uzbw7ptczcmc3k7weeukc4h5v56
==> Installing p4est-2.3.1-rkclnjl3n6mz2ysx75crfcq2x4qsaxg4
==> No binary for p4est-2.3.1-rkclnjl3n6mz2ysx75crfcq2x4qsaxg4 found: installing from source
==> Fetching https://github.com/cburstedde/p4est/archive/refs/tags/v2.3.1.tar.gz
################################################################################################################################################################################################## 100.0%  -=O=-   #        #         #           #
==> No patches needed for p4est
==> p4est: Executing phase: 'autoreconf'
==> [2021-04-22-14:54:29.444474] './bootstrap'
Error: Cannot find directory sc/config
   If you just called ./bootstrap from a fresh clone of p4est
   you may need to checkout the submodule sc:
   $ git submodule init && git submodule update
==> Error: ProcessError: Command exited with status 1:
    './bootstrap'

1 error found in build log:
  >> 3    Error: Cannot find directory sc/config
     4       If you just called ./bootstrap from a fresh clone of p4est
     5       you may need to checkout the submodule sc:
     6       $ git submodule init && git submodule update

See build log for details:
  /tmp/root/spack-stage/spack-stage-p4est-2.3.1-rkclnjl3n6mz2ysx75crfcq2x4qsaxg4/spack-build-out.txt
```
I wanted to update the p4est version, but the old website: https://github.com/p4est/p4est.github.io/tree/master/release/. was updated to version 2.2. Now, according to the official documentation, the latest version has been submitted to the new website: https://github.com/cburstedde/p4est., but I had an accident here. The SC submodule of the release version used by the p4EST is empty. The error is as follows.
I used another method to change:
```console
diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py
index b7c2a80da3..8366edf368 100644
--- a/var/spack/repos/builtin/packages/p4est/package.py
+++ b/var/spack/repos/builtin/packages/p4est/package.py
@@ -10,10 +10,12 @@ class P4est(AutotoolsPackage):
     """Dynamic management of a collection (a forest) of adaptive octrees in
     parallel"""
     homepage = "http://www.p4est.org"
-    url      = "http://p4est.github.io/release/p4est-2.2.tar.gz"
+    url      = "https://github.com/cburstedde/p4est/archive/refs/tags/v2.3.1.tar.gz"
+    git      = "https://github.com/cburstedde/p4est.git"
 
     maintainers = ['davydden']
 
+    version('2.3.1', tag='v2.3.1', submodules=True)
     version('2.2', sha256='1549cbeba29bee2c35e7cc50a90a04961da5f23b6eada9c8047f511b90a8e438')
     version('2.0', sha256='c522c5b69896aab39aa5a81399372a19a6b03fc6200d2d5d677d9a22fe31029a')
     version('1.1', sha256='0b5327a35f0c869bf920b8cab5f20caa4eb55692eaaf1f451d5de30285b25139')
```
Although this approach allows the p4est compilation to be installed through, and even the sc submodules can be downloaded, doing so would destroy previous users' content. I hope you can provide a good p4est modification, compilation and installation can pass, sc submodules can also be updated to the corresponding version.
### Information on your system
[root@centos8 p4est]# spack debug report
* **Spack:** 0.16.1-2263-181341c8b3
* **Python:** 3.6.8
* **Platform:** linux-centos8-aarch64
* **Concretizer:** original
<!-- 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]()
* [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. -->
- [ ] 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
- [ ] I have searched the issues of this repo and believe this is not a duplicate

p4est: update url and version
According to `http://www.p4est.org/`
the github repository is `https://github.com/cburstedde/p4est`.


Discussion:

Hi, Is there anything I need to change for this patch?
@darmac LGTM though the conflict needs to be resolved before this PR can be merged.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/p4est/package.py b/var/spack/repos/builtin/packages/p4est/package.py
--- a/var/spack/repos/builtin/packages/p4est/package.py
+++ b/var/spack/repos/builtin/packages/p4est/package.py
@@ -9,14 +9,18 @@
 class P4est(AutotoolsPackage):
     """Dynamic management of a collection (a forest) of adaptive octrees in
     parallel"""
-    homepage = "http://www.p4est.org"
-    url      = "http://p4est.github.io/release/p4est-2.2.tar.gz"
-    git = "https://github.com/cburstedde/p4est.git"
+    homepage = "https://www.p4est.org"
+
+    # Only use the official tarball releases provided on p4est.org or
+    # p4est.github.io. The automatically generated releases from the
+    # Github repository lack important parts.
+    url = "https://p4est.github.io/release/p4est-2.3.1.tar.gz"
 
     maintainers = ['davydden']
 
-    version('2.3.1', submodules=True, tag='v2.3.1')
+    version('2.3.1', sha256='be66893b039fb3f27aca3d5d00acff42c67bfad5aa09cea9253cdd628b2bdc9a')
     version('2.2', sha256='1549cbeba29bee2c35e7cc50a90a04961da5f23b6eada9c8047f511b90a8e438')
+    version('2.1', sha256='07ab24bd63a652a30576fbca12c0fc068dffa615d888802d7f229fa994a9c1ef')
     version('2.0', sha256='c522c5b69896aab39aa5a81399372a19a6b03fc6200d2d5d677d9a22fe31029a')
     version('1.1', sha256='0b5327a35f0c869bf920b8cab5f20caa4eb55692eaaf1f451d5de30285b25139')
 


Test patch: