Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URGENT: Fix broken gtkmm entry #41059

Merged
merged 2 commits into from
May 4, 2024
Merged

URGENT: Fix broken gtkmm entry #41059

merged 2 commits into from
May 4, 2024

Conversation

rhaschke
Copy link
Contributor

@rhaschke rhaschke commented May 4, 2024

#40772, merged yesterday, breaks rosdep with the following error:

ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
  while scanning a plain scalar
  in "<string>", line 3911, column 12:
      gentoo: [dev-cpp/gtkmm:3.0]
               ^
found unexpected ':'
  in "<string>", line 3911, column 25:
      gentoo: [dev-cpp/gtkmm:3.0]
                            ^

Obviously, names containing a colon should be quoted, such that they are not interpreted as a map.

@rhaschke rhaschke requested a review from a team as a code owner May 4, 2024 15:04
@github-actions github-actions bot added the rosdep Issue/PR is for a rosdep key label May 4, 2024
@cottsay
Copy link
Member

cottsay commented May 4, 2024

Obviously, names containing a colon should be quoted.

I'm actually not convinced that this is true. Keys maybe, but this is a value.

That rule works fine on my machine:

$ rosdep resolve libgtkmm3.0-dev --os gentoo:
#portage
dev-cpp/gtkmm:3.0

Also, yamllint and our CI both process the rule correctly. Under what circumstances are you seeing this error?

Separately, please use single quotes as is the convention in this file.

@cottsay
Copy link
Member

cottsay commented May 4, 2024

The oldest configuration I have handy is Python 3.6 with PyYAML 3.13, and it works there:

Python 3.6.8 (default, Nov 14 2023, 16:29:52) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml; yaml.__version__
'3.13'
>>> yaml.safe_load('foo: bar:baz')
{'foo': 'bar:baz'}

The latest version of Python 3 and PyYAML appears to work as well:

Python 3.12.2 (main, Feb 21 2024, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml; yaml.__version__
'6.0.1'
>>> yaml.safe_load('foo: bar:baz')
{'foo': 'bar:baz'}

@cottsay
Copy link
Member

cottsay commented May 4, 2024

Oh, interesting, I got the older configuration to break when the value is placed in a list.

Python 3.6.8 (default, Nov 14 2023, 16:29:52) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml; yaml.__version__
'3.13'
>>> yaml.safe_load('foo: [bar:baz]')
...
yaml.scanner.ScannerError: while scanning a plain scalar
  in "<unicode string>", line 1, column 7:
    foo: [bar:baz]
          ^
found unexpected ':'
  in "<unicode string>", line 1, column 10:
    foo: [bar:baz]
             ^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.

So maybe somewhere between 3.13 and 5.3.1 PyYAML started supporting this syntax.

Seems reasonably low-cost to just support the older PyYAML versions, let's fix the quotes though.

rosdep/base.yaml Outdated Show resolved Hide resolved
@cottsay
Copy link
Member

cottsay commented May 4, 2024

Closes: #41057

@cottsay
Copy link
Member

cottsay commented May 4, 2024

Follow-up: #41060

@cottsay cottsay merged commit ca2ec97 into ros:master May 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rosdep Issue/PR is for a rosdep key
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants