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

SCons: Use r-strings for wayland-scanner builder command #88134

Merged

Conversation

akien-mga
Copy link
Member

I wonder if there's a static check we could do to spot this without this trial and error?

@Riteo
Copy link
Contributor

Riteo commented Feb 9, 2024

Uh I'm not very knowledgeable about python, but this makes sense. How did it work before?

@akien-mga
Copy link
Member Author

akien-mga commented Feb 9, 2024

It wasn't a problem in the past, but Python 3.12 made this a warning (and I think 3.13 will stop supporting this syntax and error out).

The warnings were these:

/home/akien/Godot/godot/platform/linuxbsd/wayland/SCsub:14: SyntaxWarning: invalid escape sequence '\.'
  "wayland-scanner -c client-header < ${SOURCE} | sed 's:wayland-client-core\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",
/home/akien/Godot/godot/platform/linuxbsd/wayland/SCsub:21: SyntaxWarning: invalid escape sequence '\.'
  "wayland-scanner -c private-code < ${SOURCE} | sed 's:wayland-util\.h:../dynwrappers/wayland-client-core-so_wrap\.h:' > ${TARGET}",

@Riteo
Copy link
Contributor

Riteo commented Feb 9, 2024

@akien-mga oh, I see. I think that's actually a great idea from python side, as I missed the r in the first place xD

@Riteo
Copy link
Contributor

Riteo commented Feb 9, 2024

Sorry for the double post, but I think that we should do this to the rest of the file at this point, like for example in this part:

    WAYLAND_BUILDERS = {
        "WAYLAND_API_HEADER": Builder(
            action=Action(
                "wayland-scanner -c client-header < ${SOURCE} > ${TARGET}",
                'Generating Wayland client header: "${TARGET}"',
            ),
            single_source=True,
        ),
        "WAYLAND_API_CODE": Builder(
            action=Action(
                "wayland-scanner -c private-code < ${SOURCE} > ${TARGET}",
                'Generating Wayland protocol marshaling code: "${TARGET}"',

@akien-mga
Copy link
Member Author

So far it's only been needed when there's invalid escape codes, like \. here. < and > in these other examples seem fine. But yeah I can apply it to all the wayland-scanner invocations for consistency.

@akien-mga akien-mga force-pushed the scons-wayland-py3.12-escape branch from b2d4292 to 03c8a0d Compare February 9, 2024 14:52
@akien-mga akien-mga merged commit 4e990cd into godotengine:master Feb 9, 2024
16 checks passed
@akien-mga akien-mga deleted the scons-wayland-py3.12-escape branch February 9, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants