Closed smuzaffar closed 2 years ago
A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for branch master.
@cmsbuild, @smuzaffar, @iarspider, @ddaina can you please review it and eventually sign? Thanks. @perrotta, @dpiparo, @qliphy you are the release manager for this. cms-bot commands are listed here
Pull request #120 was updated.
But it will fail with an error. Is it intended ?
yes it should fail. If env points to a non-existing dev area then it should fail.
This is to avoid the issues like the following
cd /tmp/$(whoami)`
scram p CMSSW_12_0_1_pre4
cd CMSSW_12_0_1_pre4
cmsenv
# CMSSW_BASe points to /tmp/$(whoami)/CMSSW_12_0_1_pre4
cd ..
rm -rf CMSSW_12_0_1_pre4
scram p CMSSW_12_0_1_pre3
cd CMSSW_12_0_1_pre3
git cms-addpkg FWCore
Currently this does not fail and user assumes that package has been checked out in his current project area but instead actually git-cms-init
has created /tmp/$(whoami)CMSSW_12_0_1_pre4/src
again
Mhm, I see.
However it would catch something very simple like
cd /tmp/$(whoami)`
scram p CMSSW_12_0_1_pre4
cd CMSSW_12_0_1_pre4
cmsenv
# CMSSW_BASe points to /tmp/$(whoami)/CMSSW_12_0_1_pre4
cd ..
scram p CMSSW_12_0_1_pre3
cd CMSSW_12_0_1_pre3
git cms-addpkg FWCore
Maybe we could (also) add a check to the git cms-...
commands that they are being run inside $CMSSW_BASE/src
?
yes it will not catch the issue if you set env from one area and then go to another and run git cms-
. Correct fix would be to run cmsenv
in the git cms-
commands
Correct fix would be to run
cmsenv
in thegit cms-
commands
Mhm, ok, that would make sense, and it's consistent with how scram
itself work:
cd /tmp/$(whoami)`
scram p CMSSW_12_0_1_pre4
cd CMSSW_12_0_1_pre4
cmsenv
# $CMSSW_BASE points to /tmp/$(whoami)/CMSSW_12_0_1_pre4
cd /tmp/$(whoami)`
scram p CMSSW_12_0_1_pre3
cd CMSSW_12_0_1_pre3
...
scram b
will build in /tmp/$(whoami)/CMSSW_12_0_1_pre3
, even is $CMSSW_BASE
points to a different area.
git cms-init
is always creating$CMSSW_BASE/src
. This means if one has deleted the CMSSW_BASE after setting the env and rungit cms-init
then it will create$CMSSW_BASE/src
again. This PR proposes to create$CMSSW_BASE/src
if not exists and only createsrc
if$CMSSW_BASE
already exists.