Closed kpedro88 closed 2 years ago
A new Issue was created by @kpedro88 Kevin Pedro.
@Dr15Jones, @perrotta, @dpiparo, @makortel, @smuzaffar, @qliphy can you please review it and eventually sign/assign? Thanks.
cms-bot commands are listed here
@kpedro88 , I had also looked in to this and I think defining functions for cmsrel
and cmsenv
is better soultion. cmsrel should allow to use input parameters e.g. it shoudl be something like
cmsrel(){ scramv1 project CMSSW $@; }
@smuzaffar see https://github.com/cms-sw/cms-common/pull/4
this has been deployed and working now
[muzaffar@lxplus]$ cmssw-el8
Singularity> cmsenv
SCRAM fatal: Unable to locate the top of local release. Please run this command from a SCRAM-based area.
Aliases are limited in bash (and related shells). As far as I can tell, there is absolutely no way to make a construct like this "work":
where "work" is defined to mean that everything, including aliases, is passed to the (interactive) subshell. (
shopt -s expand_aliases
is not effective in this case, because the alias is defined before the subshell exists.) This has become more noticeable since the switch to el8 as the production OS. Since many of us do not have el8 machines yet, we are more often using the el8 container interactively, whereas previously (at least for me) the main usage of CMSSW containers was for specific commands or batch jobs.I could only find one way to get this to work solely by modifying
cmssw-env
in this repo: https://github.com/cms-sw/cmssw-osenv/compare/master...kpedro88:here-string-ttyHowever, this is a bit clunky, as it displays on the screen (and puts into the command history) the following:
There is an alternative: use functions instead of aliases (as most Bash experts seem to recommend in the modern era). With a few changes in
cmsset_default.sh
, everything works: https://github.com/cms-sw/cms-common/compare/master...kpedro88:use-functionTherefore, I propose changing
cmsset_default.sh
; please provide any feedback if there is a reason not to do so.