cms-sw / SCRAM

Software Configuration And Management - CMS internal build tool
Other
10 stars 8 forks source link

Scram messes with UTF-8 configuration #30

Closed swertz closed 2 years ago

swertz commented 6 years ago

Running scramv1 runtime -sh, I see than one of the variables exported is LANG=C. However that messes up my locale configuration, which I've set to en_GB.UTF-8. An annoying consequence is that the magic tab completion in zsh picks up all kinds of strange behaviours...

It seems C.UTF-8 is fine, so the issue is really related to the encoding.

Is it really necessary to mess with the locale/encoding when configuring the environment?

cmsbuild commented 6 years ago

A new Issue was created by @swertz Sbastien Wertz.

@davidlange6, @Dr15Jones, @smuzaffar, @fabiocos, @kpedro88 can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

smuzaffar commented 6 years ago

@swertz , this variable is set by nearly all cmssw releases and never received any complain. We had issues like https://hypernews.cern.ch/HyperNews/CMS/get/webInterfaces/562.html [a] and that is why we were setting it to C . Instead of dropping it and finding out bugs on grid sides later I would propose that we can allow some user settings (via ~/.scramrc) to override some env.

[a]

The problem was with the 'cp' statement to install wmcore binaries, the spec copies files using the WMCore/bin/[a-z]* pattern. This avoids a subdirectory HWMon.

Now, believe it or not, in some locale settings [a-z]* includes uppercase letters. This is the case for example in the UTF8 locale where [a-z] appears to mean aAbBcC..z. I fixed the reqmgr spec file to use WMCore/bin/[[:lower:]]* instead, which should work better.

Note that different shells will do different things to [a-z]*, and the results also depend on the locale (e.g. $LANG or $LC_COLLATE). So I'd recommend avoiding [a-z] to mean lowercase in future.

BTW, no, neither Diego nor I have the slightest clue why sometimes [a-z] means lower case letters and sometimes it means all letters _in the same shell, without changing $LANG_ (as far as we know). Sometimes life just is too short to figure everything out :-/
swertz commented 6 years ago

Seems reasonable; I thought this was introduced recently as I never had any issue before with the same configuration... I guess I'll have to keep digging for what's causing this behaviour. I also don't understand why this LANG=C seems to have a different effect on the various machines I'm connecting on (all SL6).

I would propose that we can allow some user settings (via ~/.scramrc) to override some env.

That would be great!

smuzaffar commented 2 years ago

cms-sw/cmsdist#7963 update should allow SCRAM V3 to not override an env variable is explicitly ignored via ~/.scramrc/runtime file. Note that this feature will only be available for SCRAM V3 based project i.e. CMSSW_12_0 and above releases.