I have the following script...
#!/usr/bin/env spack-python
import spack
import spack.main
import spack.store
from spack.main import SpackCommand
from llnl.util.filesystem import working_dir
from spack.util.executable import which
import os
import mmap
import re
from shutil import rmtree as rmdashf
import sys
idir = '/Users/miller86/spack/spack/opt/foobar'
rmdashf(idir)
spack.store.layout = spack.directory_layout.YamlDirectoryLayout(idir)
spack.store.db = spack.database.Database(idir)
pkgSpec = 'amrex'
specs = spack.cmd.parse_specs(pkgSpec, concretize=True)
assert(len(specs)==1)
pkg = spack.repo.get(specs[0])
with spack.stage.Stage(pkg.url) as stage:
stage.fetch()
print os.getcwd()
print os.listdir(os.getcwd())
If I use amrex (a Git fetch strategy package), I get this output...
[scratlantis:~/spack/spack] miller86% ./fitck_download.py
Git
==> Fetching https://github.com/AMReX-Codes/amrex.git
######################################################################## 100.0%
==> Warning: The contents of
the archive
look like HTML.
The checksum will likely be bad. If it is, you can use
'spack clean <package>' to remove the bad archive, then
fix your internet gateway issue and install again.
/private/var/folders/nx/mtgf501d3573jd6cmgv9lnzr0003jr/T/miller86/spack-stage/spack-stage-CCVG_A
['amrex.git']
In particular, it does not actually stage the package but instead appears to attempt to fetch amrex vi its Get repo URL. The downloaded file is indeed an HTML file with...
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
However, if I do zlib, a URL fetch strategy, it works as expected.
I think this is a bug.
I have the following script...
If I use
amrex(a Git fetch strategy package), I get this output...In particular, it does not actually stage the package but instead appears to attempt to fetch amrex vi its Get repo URL. The downloaded file is indeed an HTML file with...
However, if I do zlib, a URL fetch strategy, it works as expected.
I think this is a bug.