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

Meson env fixes for icc-cl and msvc #14175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gfudies
Copy link

@gfudies gfudies commented Jan 22, 2025

fix for when lib.exe is not in meson's hardcoded list of names. fix so intel cl reads linker exe from env instead of relying on hardcoded string

Copy link
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message should be 80 characters long max, with enhanced explanations in a (markdown-style reflowing at 80-characters) paragraph following it and separated by whitespace.

mesonbuild/compilers/detect.py Outdated Show resolved Hide resolved
mesonbuild/compilers/detect.py Outdated Show resolved Hide resolved
mesonbuild/linkers/linkers.py Outdated Show resolved Hide resolved
# To shut up mypy.
if isinstance(opts, dict):
raise RuntimeError('This is a transitory issue that should not happen. Please report with full backtrace.')
std_opt = opts.get_value_object(key)
std_opt = opts.get(key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it belongs in a distinct commit. We should also find out why it triggers at all, e.g. what is the backtrace it's asking for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was hoping @jpakkane could tell me why this was added in the first place. 181c349#diff-7ada83df1272b6eaaff2fea8bbbb14ff9cd6baaf7de40c532fe95acf9bf73fbcR546 . It looks like a hack to me but I don't know this code base very well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change I get

The Meson build system
Version: 1.6.1
Source dir: /build/Source-Tree/libs/fontconfig
Build dir: /build/Source-Tree/build/objects/x86_64-Windows-10/intel_msvc-2024.2/optimize/fontconfig/1.1.1.R/static
Build type: cross build
Project name: fontconfig
Project version: 2.15.0
Traceback (most recent call last):
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/mesonmain.py", line 193, in run
    return options.run_func(options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/msetup.py", line 365, in run
    app.generate()
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/msetup.py", line 188, in generate
    return self._generate(env, capture, vslite_ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/msetup.py", line 210, in _generate
    intr = interpreter.Interpreter(b, user_defined_options=user_defined_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreter/interpreter.py", line 322, in __init__
    self.parse_project()
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/interpreterbase.py", line 129, in parse_project
    self.evaluate_codeblock(self.ast, end=1)
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/interpreterbase.py", line 195, in evaluate_codeblock
    raise e
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/interpreterbase.py", line 187, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/interpreterbase.py", line 201, in evaluate_statement
    return self.function_call(cur)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/interpreterbase.py", line 528, in function_call
    res = func(node, func_args, kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/decorators.py", line 237, in wrapper
    return f(*nargs, **wrapped_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreterbase/decorators.py", line 556, in wrapper
    return f(*wrapped_args, **wrapped_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreter/interpreter.py", line 1321, in func_project
    self.add_languages(proj_langs, True, MachineChoice.HOST)
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreter/interpreter.py", line 1490, in add_languages
    success = self.add_languages_for(args, required, for_machine)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/interpreter/interpreter.py", line 1533, in add_languages_for
    comp = compilers.detect_compiler_for(self.environment, lang, for_machine, skip_sanity_check, self.subproject)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/compilers/detect.py", line 109, in detect_compiler_for
    env.coredata.process_compiler_options(lang, comp, env, subproject)
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/coredata.py", line 755, in process_compiler_options
    self.add_compiler_options(comp.get_options(), lang, comp.for_machine, env, subproject)
                              ^^^^^^^^^^^^^^^^^^
  File "/site/toolchain/buildtools/by-build/x86_64-CentOS-6/meson/1.6.1/bin/mesonbuild/compilers/c.py", line 555, in get_options
    raise RuntimeError('This is a transitory issue that should not happen. Please report with full backtrace.')
RuntimeError: This is a transitory issue that should not happen. Please report with full backtrace.

../../../../../../../../libs/fontconfig/meson.build:1:0: ERROR: Unhandled python exception

    This is a Meson bug and should be reported!```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason it was added is because the type of the thing will change when the option refactor branch lands (should happen immediately after 1.7 release). Things used to be stored in separate places so the thing could be a dictionary or a "proxy object" that pretends to be a dictionary. Those all will go away and options are stored wholly inside the OptionStore object.

IIRC I did not fix it "properly" at the time because it would have taken a lot of effort and the entire code path would get deleted fairly soon anyway.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what would you suggest I do for now then?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcbaker should I drop this and retry against some other branch then?

@@ -195,7 +195,7 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
for linker in trials:
linker_name = os.path.basename(linker[0])

if any(os.path.basename(x) in {'lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe', 'xilib', 'xilib.exe'} for x in linker):
if os.getenv('FORCE_MSVC_ARFLAGS') or any(os.path.basename(x) in {'lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe', 'xilib', 'xilib.exe'} for x in linker):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk what to name this or how to pipe it through ini files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eli-schwartz any input/suggestions on this?

@dcbaker
Copy link
Member

dcbaker commented Jan 23, 2025

That regression was spotted two weeks ago: #14089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants