summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-12-13 13:55:32 +0100
committerGitHub <noreply@github.com>2022-12-13 13:55:32 +0100
commit0ff6a1bd1ca018d15529bd38f79810ad0d915e14 (patch)
treee8b7e4b15d95744707ba6cc8eb08d9627690f768 /lib
parentf9cfc2f57e2d500cba7301c419dfbf5360b48837 (diff)
downloadspack-0ff6a1bd1ca018d15529bd38f79810ad0d915e14.tar.gz
spack-0ff6a1bd1ca018d15529bd38f79810ad0d915e14.tar.bz2
spack-0ff6a1bd1ca018d15529bd38f79810ad0d915e14.tar.xz
spack-0ff6a1bd1ca018d15529bd38f79810ad0d915e14.zip
spack/package.py: improve editor support for some +/- static props (#34319)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py21
-rw-r--r--lib/spack/spack/package.py19
2 files changed, 20 insertions, 20 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 788f896a86..d609fd1aa7 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -37,14 +37,12 @@ import io
import multiprocessing
import os
import re
-import shutil
import sys
import traceback
import types
from typing import List, Tuple
import llnl.util.tty as tty
-from llnl.util.filesystem import install, install_tree, mkdirp
from llnl.util.lang import dedupe
from llnl.util.symlink import symlink
from llnl.util.tty.color import cescape, colorize
@@ -52,6 +50,7 @@ from llnl.util.tty.log import MultiProcessFd
import spack.build_systems.cmake
import spack.build_systems.meson
+import spack.build_systems.python
import spack.builder
import spack.config
import spack.install_test
@@ -586,9 +585,6 @@ def set_module_variables_for_package(pkg):
m.gmake = MakeExecutable("gmake", jobs)
m.ninja = MakeExecutable("ninja", jobs, supports_jobserver=False)
- # easy shortcut to os.environ
- m.env = os.environ
-
# Find the configure script in the archive path
# Don't use which for this; we want to find it in the current dir.
m.configure = Executable("./configure")
@@ -608,21 +604,6 @@ def set_module_variables_for_package(pkg):
m.spack_f77 = os.path.join(link_dir, pkg.compiler.link_paths["f77"])
m.spack_fc = os.path.join(link_dir, pkg.compiler.link_paths["fc"])
- # Emulate some shell commands for convenience
- m.pwd = os.getcwd
- m.cd = os.chdir
- m.mkdir = os.mkdir
- m.makedirs = os.makedirs
- m.remove = os.remove
- m.removedirs = os.removedirs
- m.symlink = symlink
-
- m.mkdirp = mkdirp
- m.install = install
- m.install_tree = install_tree
- m.rmtree = shutil.rmtree
- m.move = shutil.move
-
# Useful directories within the prefix are encapsulated in
# a Prefix object.
m.prefix = pkg.prefix
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 46c9da4844..c41d77d895 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -8,13 +8,25 @@
Everything in this module is automatically imported into Spack package files.
"""
+from os import chdir, environ, getcwd, makedirs, mkdir, remove, removedirs
+from shutil import move, rmtree
+
+# Emulate some shell commands for convenience
+env = environ
+cd = chdir
+pwd = getcwd
+
# import most common types used in packages
from typing import Dict, List, Optional
import llnl.util.filesystem
from llnl.util.filesystem import *
+from llnl.util.symlink import symlink
import spack.util.executable
+
+# These props will be overridden when the build env is set up.
+from spack.build_environment import MakeExecutable
from spack.build_systems.aspell_dict import AspellDictPackage
from spack.build_systems.autotools import AutotoolsPackage
from spack.build_systems.bundle import BundlePackage
@@ -83,3 +95,10 @@ from spack.variant import (
disjoint_sets,
)
from spack.version import Version, ver
+
+# These are just here for editor support; they will be replaced when the build env
+# is set up.
+make = MakeExecutable("make", jobs=1)
+gmake = MakeExecutable("gmake", jobs=1)
+ninja = MakeExecutable("ninja", jobs=1)
+configure = Executable(join_path(".", "configure"))