DUNE-DAQ / daq-buildtools

Make life for developers easier through a collection of CMake functions and scripts
0 stars 1 forks source link

`dbt-setup-release` not working on Spack branch #193

Closed jcfreeman2 closed 2 years ago

jcfreeman2 commented 2 years ago

I run into a problem if I do the following on either np04-srv-019 or mu2edaq13:

source `realpath /cvmfs/dunedaq.opensciencegrid.org/spack-externals/spack-installation/share/spack/setup-env.sh`
spack load python@3.8.3%gcc@8.2.0
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest-spack
dbt-setup-release dunedaq-v2.11.0  # And likewise for dunedaq-v2.10.2

as this yields:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fc6b2aea240 (most recent call first):
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f16a064d240 (most recent call first):
ERROR: [04/22/22 21:49:56] [dbt-setup-tools.sh:182]:  There was a problem running "spack env activate dunedaq-v2.10.2"  
jcfreeman2 commented 2 years ago

If I replace

source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest-spack

with

. daq-buildtools/env.sh  # 56faff84b, head of johnfreeman/issue161_spack

...then things work fine.

jcfreeman2 commented 2 years ago

Commenting out the UPS-related calls in setup_dbt.sh makes things work again:

#cvmfs_products="/cvmfs/dunedaq.opensciencegrid.org/products"                                                                                   
        #source ${cvmfs_products}/setup                                                                                                                 
        ## gcc is required is running "dbt-create.py" without "-c" option                                                                               
        #setup -B gcc v8_2_0                                                                                                                            
        ## python 3 is required for running "dbt-create.py"                                                                                             
        #setup -B python          
dingp commented 2 years ago

Modified the function to setup UPS products (python and gcc) only for non spack-enabled dbt.

Encapsulate the UPS related lines with if [[ $tag != *"spack" ]].

The fix has been published to cvmfs. My test was successful with the fix.