spack/lib/spack/spack
Carson Woods 33752eabb8
Improve package source code context display on error (#37655)
Spack displays package code context when it shouldn't (e.g., on `FetchError`s)
and doesn't display it when it should (e.g., when errors occur in builder classes.
The line attribution can sometimes be off by one, as well.

- [x] Display package context when errors occur in a subclass of `PackageBase`
- [x] Display package context when errors occur in a subclass of `BaseBuilder`
- [x] Do not display package context when errors occur in `PackageBase`,
      `BaseBuilder` or other core code that is not in a `package.py` file.
- [x] Fix off-by-one error for core code (don't subtract one from the line number *unless*
      it's in an actual `package.py` file.

---------

Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
2023-05-15 13:38:11 -07:00
..
bootstrap deprecate buildcache create --rel, buildcache install --allow-root (#37285) 2023-05-05 09:51:53 +02:00
build_systems cuda: add versions 12.0.1, 12.1.0 and 12.1.1 (#37083) 2023-05-10 15:31:07 +02:00
cmd Bump tutorial command (#37674) 2023-05-15 13:54:52 +02:00
compilers Fix logic in setting oneapi microarchitecture flags (#37634) 2023-05-12 10:58:08 -04:00
container Improve error message for missing "command" entry in containerize (#37590) 2023-05-11 10:33:51 +02:00
detection Windows: Fix external detection for service accounts (#37293) 2023-05-10 18:12:58 -04:00
environment concretizer: don't change concrete environments without --force (#37438) 2023-05-14 13:36:03 +02:00
hooks Disable module file generation by default (#37258) 2023-05-02 10:28:27 +02:00
modules lmod: fix CompilerSpec concrete version / range (#37604) 2023-05-11 12:00:07 +02:00
operating_systems Fix compiler version issues (concrete vs range) (#37572) 2023-05-10 17:26:22 +02:00
platforms Detection of Cray's slingshot detection has relied on the presence of (#35779) 2023-03-01 23:19:20 -08:00
reporters Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
schema gitlab ci: release fixes and improvements (#37601) 2023-05-12 15:22:42 -05:00
solver bugfix: allow reuse of packages from foreign namespaces 2023-05-15 09:15:49 -07:00
test concretizer: don't change concrete environments without --force (#37438) 2023-05-14 13:36:03 +02:00
util Windows: prefer Python decompression support (#36507) 2023-05-10 18:07:56 -04:00
__init__.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
abi.py Split satisfies(..., strict=True/False) into two functions (#35681) 2023-03-08 13:00:53 +01:00
audit.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
binary_distribution.py Allow buildcache specs to be referenced by hash (#35042) 2023-05-12 10:27:42 -07:00
build_environment.py Improve package source code context display on error (#37655) 2023-05-15 13:38:11 -07:00
builder.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
caches.py typehint a few globals (#36544) 2023-03-31 08:32:56 +02:00
ci_needs_workaround.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
ci_optimization.py Style: black 23, skip magic trailing comma (#35351) 2023-02-16 23:06:12 -06:00
ci.py gitlab ci: release fixes and improvements (#37601) 2023-05-12 15:22:42 -05:00
compiler.py windows: use sys.platform == "win32" instead of is_windows (#35640) 2023-03-05 07:58:05 -08:00
concretize.py Improve version, version range, and version list syntax and behavior (#36273) 2023-05-05 22:04:41 -06:00
config.py Update vendored ruamel.yaml to v0.17.21 (#37008) 2023-05-04 08:00:38 -07:00
cray_manifest.py Improve version, version range, and version list syntax and behavior (#36273) 2023-05-05 22:04:41 -06:00
database.py Improve error message for buildcaches (#37626) 2023-05-12 11:55:13 +02:00
dependency.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
directives.py Add a "requires" directive, extend functionality of package requirements (#36286) 2023-05-08 10:12:26 -07:00
directory_layout.py windows: use sys.platform == "win32" instead of is_windows (#35640) 2023-03-05 07:58:05 -08:00
error.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
extensions.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
fetch_strategy.py Improve version, version range, and version list syntax and behavior (#36273) 2023-05-05 22:04:41 -06:00
filesystem_view.py spack view copy: relocate symlinks (#32306) 2023-05-09 12:17:16 +02:00
gcs_handler.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
graph.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
hash_types.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
install_test.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
installer.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
main.py Environments: store spack version/commit in spack.lock (#32801) 2023-05-11 23:13:36 -04:00
mirror.py Update vendored ruamel.yaml to v0.17.21 (#37008) 2023-05-04 08:00:38 -07:00
mixins.py netcdf: fix bugs introduced with multiple build systems split (#36825) 2023-04-14 10:59:12 +02:00
multimethod.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
package_base.py Improve package source code context display on error (#37655) 2023-05-15 13:38:11 -07:00
package_prefs.py Improve version, version range, and version list syntax and behavior (#36273) 2023-05-05 22:04:41 -06:00
package_test.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
package.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
parser.py Allow buildcache specs to be referenced by hash (#35042) 2023-05-12 10:27:42 -07:00
patch.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
paths.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
projections.py Split satisfies(..., strict=True/False) into two functions (#35681) 2023-03-08 13:00:53 +01:00
provider_index.py Split satisfies(..., strict=True/False) into two functions (#35681) 2023-03-08 13:00:53 +01:00
relocate_text.py macos: set new ad-hoc signature with codesign after binary string replacement (#35585) 2023-03-28 00:33:35 -04:00
relocate.py remove unused global in bindist tests (#37358) 2023-05-03 05:34:14 -04:00
repo.py Improve the message for errors in package recipes (#37589) 2023-05-11 10:34:39 +02:00
report.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
resource.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
rewiring.py modules: correctly detect explicit installation (#36533) 2023-04-03 11:19:18 +02:00
s3_handler.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
spec_list.py Improve version, version range, and version list syntax and behavior (#36273) 2023-05-05 22:04:41 -06:00
spec.py bugfix: don't look up patches from packages for concrete specs 2023-05-15 09:15:49 -07:00
stage.py Allow configurable stage names (#36509) 2023-03-31 11:46:47 -07:00
store.py typehint a few globals (#36544) 2023-03-31 08:32:56 +02:00
subprocess_context.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
tag.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
target.py Remove handling of deprecated target names (graviton) (#35537) 2023-03-01 11:03:12 +01:00
tengine.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
traverse.py Allow buildcache specs to be referenced by hash (#35042) 2023-05-12 10:27:42 -07:00
url.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
user_environment.py license year bump (#34921) 2023-01-18 14:30:17 -08:00
variant.py Split satisfies(..., strict=True/False) into two functions (#35681) 2023-03-08 13:00:53 +01:00
verify.py Stand-alone testing: make recipe support and processing spack-/pytest-like (#34236) 2023-05-10 11:34:54 +02:00
version.py Improve version, version range, and version list syntax and behavior (#36273) 2023-05-05 22:04:41 -06:00