-
Notifications
You must be signed in to change notification settings - Fork 62
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
Introduce the script to ease the dev-build #265
Introduce the script to ease the dev-build #265
Conversation
The script spack_dev-build.sh eases the build of dev package using dev-build mode of spack. The script takes the spack find command output and forms the list of installed packages to be fed to the spack dev-build command.
Works like a charm for me. Thanks! |
Just tested it but got the following error: . ./spack_dev-build.sh ../../../FairRoot/dev/source fairroot mybuild+sim+examples
while trying to concretize the partial spec:
git requires pcre variant +jit, but spec asked for ~jit |
@TobiasStockmanns have you activated the environment before calling the script? |
Added protection against calling outside of spack env activate. |
Now I have it activated and the compilation started. Unfortunately it crashes with many a linker error to fair:Logger:
|
Do you have a reasonably new FairRoot dev? |
It somehow mixes two different FairMQ versions - that is not good. |
No change with a new version of FairRoot:
|
I am using "spack find" output for the list of packages. Did you try from to run the command from the clean shell and spack activate? This is certainly worrying that spack is trying to use different fairmqs.... |
I am using a clean shell but with SIMPATH and FAIRROOTPATH set and I run Here comes
|
OK. So there comes a potential problem. I have decided to only use the "Root specs" part of the "spack find" output. I did it, because MY spack find output matches exactly the dev-build command from the fairsoft README instructions. For me the output looks:
Checking, your env is probably env/dev/sim_threads.yaml, which has smaller number of specs, than our other env definitions. |
It may be worth a try to implement the proposed helper script as a spack extension written in python. That way, we can properly inspect and filter the environment and fairroot dependencies. |
After removing |
Great Tobias! Maybe the problem were then caused by the first unsuccessful tries. After doing it already few times, I usually delete this directory before starting the dev-build. The other problem is that I did not yet find a way to re'make' your spack-build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to tools/
?
Maybe add a little to the README?
spack_dev-build.sh
Outdated
return | ||
fi | ||
|
||
deps=$(spack find | sed -n '/Root/,/installed/p' | grep -v "Root specs" | grep -v ^$2@ | grep -v "installed packages" | sed 's/ //' | sed -e /^$/d | awk '{printf " ^%s",$0} END {print ""}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to come up with a little spack python to do that…
Here is a small python script, that does the same as the sed, awk, grep.
#! /usr/bin/python3
import sys
from argparse import ArgumentParser
from spack.environment import find_environment
def get_parser():
parser = ArgumentParser()
parser.add_argument("packagename")
return parser
def main():
parser = get_parser()
args = parser.parse_args()
env = find_environment(args)
if env is None:
sys.stderr.write("No environment\n")
sys.exit(1)
reslist = []
for spec in env.user_specs:
s = str(spec)
if s.startswith(args.packagename + '@'):
reslist.insert(0, s)
else:
reslist.append("^" + s)
print(" ".join(reslist))
if __name__ == '__main__':
main() |
It's OK with me, if you prefer python. |
Well, python let's us access the data structures of spack directly, without having to adapt to their output format. That's why I considered to rewrite the "prepare part of the commandline" part in python. My idea was to rewrite the That said, I am happy with everything that works for the people actually needing this! Yes, let's talk on Monday, or we can schedule something ad-doc using jitsi. P.S.: I have looked a bit into spack/spack#15256 (left a review), and that definitely looks like a good direction, but that still needs a bit of time. So it's good for us to have something going here first. |
Move both scripts to tools/. Add the possibility to run the script with 1 or 3 parameters.
ee1ee67
to
508a54f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good to be merged now. So give it to our "dev"-users!
The script spack_dev-build.sh eases the build
of dev package using dev-build mode of spack.
The script takes the spack find command output
and forms the list of installed packages
to be fed to the spack dev-build command.