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

regex in linker detection for template builds fails sometimes to recognize correct ld version #82078

Closed
cunyx opened this issue Sep 21, 2023 · 1 comment

Comments

@cunyx
Copy link

cunyx commented Sep 21, 2023

Godot version

3.5.2.stable

System information

openSUSE Tumbleweed

Issue description

While seeing in distro compiled godot 3.5.2 exports with PCK embedded working
on openSUSE Leap, it fails on Tumbleweed.

Currently i suspect the regular expression at

gnu_ld_version = re.search("^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE)

to not recognize the linker.

As code in master branch seems to be the same

gnu_ld_version = re.search("^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE)

and i see the

"Warning: Creating export template binaries enabled for PCK embedding is currently only supported with GNU ld, not gold, LLD or mold"

with godot 4.1.1 as well,
current godot has perhaps the same issue.

This seems to be introduced with
#35444
in order to detect the version as seen in
#35100 (comment)

The output of

ld --version

for example is
in openSUSE Leap 15.2

GNU ld (GNU Binutils; openSUSE Leap 15.2) 2.37.20211103-lp152.4.9
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

in openSUSE Leap 15.5

GNU ld (GNU Binutils; SUSE Linux Enterprise 15) 2.39.0.20220810-150100.7.43
Copyright (C) 2022 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

while Tumbleweed produces

GNU ld (GNU Binutils; openSUSE Tumbleweed) 2.40.0.20230412-5
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

The current regex finds these results/versions:

openSUSE Leap 15.2: 4.9
openSUSE Leap 15.5: 7.43
Tumbleweed: no match

This does seem to be correct for the used regex but might not be
what was intended.

By changing

"^GNU ld [^$]*(\d+\.\d+)$"

to

"^GNU ld \(GNU Binutils.*\) (\d+\.\d+)"

i get with a python script by parsing mentioned string output:

openSUSE Leap 15.2: 2.37
openSUSE Leap 15.5: 2.39
Tumbleweed: 2.40
linked Mageia example: 2.32

Of course i am not a regex or godot expert and may have missed many things.
It might be useful to know, how the version string looks like in other distributions.

Steps to reproduce

build engine

Minimal reproduction project

@akien-mga
Copy link
Member

Fixed by #87464.

@github-project-automation github-project-automation bot moved this from Untriaged to Done in Buildsystem Issue Triage May 11, 2024
@akien-mga akien-mga added this to the 4.3 milestone May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants