Operating System: Linux PC 5.14.0-1031-oem 34-Ubuntu SMP Fri Mar 25 08:21:05 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Python Version: Python 3.8.10
Version of catkin_tools: catkin_tools 0.8.5
ROS Distro: noetic
Build / Run Issue
Similar to 521.
Calling catkin init or catkin build in a workspace with the name /home/user@lan/catkin_ws fails with a cryptic KeyError, when the cached CMAKE_PREFIX_PATH is different from the current environment one.
[ ] Works with catkin_make
[ ] Works with catkin_make_isolated --merge
[ ] Works with catkin build
[ ] Works with catkin build -p1
[ ] I did not read this
Expected Behavior
catkin build reports a warning about current CMAKE_PREFIX_PATH being different from the one in cache.
Actual Behavior
Traceback (most recent call last):
File "/usr/bin/catkin", line 33, in <module>
sys.exit(load_entry_point('catkin-tools==0.8.5', 'console_scripts', 'catkin')())
File "/usr/lib/python3/dist-packages/catkin_tools/commands/catkin.py", line 266, in main
catkin_main(sysargs)
File "/usr/lib/python3/dist-packages/catkin_tools/commands/catkin.py", line 261, in catkin_main
sys.exit(args.main(args) or 0)
File "/usr/lib/python3/dist-packages/catkin_tools/verbs/catkin_init/cli.py", line 39, in main
ctx = Context.load(opts.workspace, strict=True)
File "/usr/lib/python3/dist-packages/catkin_tools/context.py", line 260, in load
ctx.load_env()
File "/usr/lib/python3/dist-packages/catkin_tools/context.py", line 513, in load_env
self.warnings += [clr(
File "/usr/lib/python3/dist-packages/catkin_tools/terminal_color.py", line 185, in clr
return fmt(key)
File "/usr/lib/python3/dist-packages/catkin_tools/terminal_color.py", line 133, in fmt
return t.substitute(_ansi) + (ansi('reset') if reset else '')
File "/usr/lib/python3.8/string.py", line 126, in substitute
return self.pattern.sub(convert, self.template)
File "/usr/lib/python3.8/string.py", line 119, in convert
return str(mapping[named])
KeyError: 'lan'
Steps to Reproduce the Issue
Create a catkin workspace A in a path with "@" symbol in it. Add some trivial package. Build the workspace A. Create catkin workspace B in a path with "@" in it, which extends the workspace A. Add some trivial package to B. Build the workspace B. Source both workspaces. Now building the workspace A again should reproduce the error.
The problem seems to be that the current environment's CMAKE_PREFIX_PATH is different rom the cached CMAKE_PREFIX_PATH and either of them contains a path with "@" symbols in it. Calling sanitize on the cached and new CMAKE_PREFIX_PATH variables here shows the warning and does what I expect it to, but I am unsure if this is a good solution to the issue and whether it may occur elsewhere.
System Info
noetic
Build / Run Issue
Similar to 521. Calling
catkin init
orcatkin build
in a workspace with the name/home/user@lan/catkin_ws
fails with a crypticKeyError
, when the cached CMAKE_PREFIX_PATH is different from the current environment one.catkin_make
catkin_make_isolated --merge
catkin build
catkin build -p1
read this
Expected Behavior
catkin build reports a warning about current CMAKE_PREFIX_PATH being different from the one in cache.
Actual Behavior
Steps to Reproduce the Issue
Create a catkin workspace A in a path with "@" symbol in it. Add some trivial package. Build the workspace A. Create catkin workspace B in a path with "@" in it, which extends the workspace A. Add some trivial package to B. Build the workspace B. Source both workspaces. Now building the workspace A again should reproduce the error.
The problem seems to be that the current environment's CMAKE_PREFIX_PATH is different rom the cached CMAKE_PREFIX_PATH and either of them contains a path with "@" symbols in it. Calling
sanitize
on the cached and new CMAKE_PREFIX_PATH variables here shows the warning and does what I expect it to, but I am unsure if this is a good solution to the issue and whether it may occur elsewhere.