Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround for spack python activate blocker #82

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion uberenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,16 @@ def disable_spack_config_scopes(self,spack_dir):
"#DISABLED BY UBERENV: " + cfg_scope_stmt)
open(spack_lib_config,"w").write(cfg_script)

def disable_spack_activate_protection(self,spack_dir):
spack_fsview = pjoin(spack_dir,"lib","spack","spack","filesystem_view.py")
print("[activate protection in {0}]".format(spack_fsview))
cyrush marked this conversation as resolved.
Show resolved Hide resolved
blocker = "raise SingleMergeConflictError(conflicts[0])"
fsview_src = open(spack_fsview).read()
if fsview_src.count(blocker) > 0:
blocker = fsview_src.replace(blocker,
"pass # DISABLED BY UBERENV: " + blocker)
open(spack_fsview,"w").write(fsview_src)


def patch(self):

Expand All @@ -761,6 +771,7 @@ def patch(self):

# force spack to use only "defaults" config scope
self.disable_spack_config_scopes(spack_dir)
self.disable_spack_activate_protection(spack_dir)
spack_etc_defaults_dir = pjoin(spack_dir,"etc","spack","defaults")

if cfg_dir is not None:
Expand Down Expand Up @@ -858,6 +869,7 @@ def show_info(self):

return res


def install(self):
# use the uberenv package to trigger the right builds
# and build an host-config.cmake file
Expand Down Expand Up @@ -901,7 +913,6 @@ def install(self):
full_spec = self.read_spack_full_spec(self.pkg_name,self.opts["spec"])
if "spack_activate" in self.project_opts:
print("[activating dependent packages]")
# get the full spack spec for our project
pkg_names = self.project_opts["spack_activate"].keys()
for pkg_name in pkg_names:
pkg_spec_requirements = self.project_opts["spack_activate"][pkg_name]
Expand Down