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

Support lists for ObjC and ObjC++ standards #13642

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

dcbaker
Copy link
Member

@dcbaker dcbaker commented Sep 6, 2024

Also, share the implementations between the C and ObjC, and C++ and OjbC++ instance of both Clang and GNU compilers, so that we update once, and only once for each compiler.

Mostly this just ends up moving code around.

Fixes: #13639

@dcbaker dcbaker requested a review from xclaesse September 6, 2024 17:15
@dcbaker
Copy link
Member Author

dcbaker commented Sep 6, 2024

I have tested this with Clang and with GCC, but only far enough with GCC to get to the point it fails because my GCC build doesn't have ObjC[++] support.



class ClangCCompiler(_ClangCStds, ClangCompiler, CCompiler):
class ClangCCompiler(ClangCStds, ClangCompiler, CCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](5) and [Function get_pic_args](6). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](7) and [Function get_dependency_gen_args](8). Base classes have conflicting values for attribute 'get_pch_use_args': [Function get_pch_use_args](9) and [Function get_pch_use_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_coverage_link_args': [Function get_coverage_link_args](37) and [Function get_coverage_link_args](38). Base classes have conflicting values for attribute 'linker_to_compiler_args': [Function linker_to_compiler_args](39) and [Function linker_to_compiler_args](40). Base classes have conflicting values for attribute 'get_lto_link_args': [Function get_lto_link_args](41) and [Function get_lto_link_args](42). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](43) and [Function get_compiler_dirs](44). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](45) and [Function get_default_include_dirs](46). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](47) and [Function gnu_symbol_visibility_args](48). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](49) and [Function get_pie_args](50). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](51) and [Function get_profile_generate_args](52). Base classes have conflicting values for attribute 'get_profile_use_args': [Function get_profile_use_args](53) and [Function get_profile_use_args](54). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function
@@ -268,11 +235,8 @@
return []


class GnuCCompiler(GnuCompiler, CCompiler):
class GnuCCompiler(GnuCStds, GnuCompiler, CCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_prelink_args': [Function get_prelink_args](5) and [Function get_prelink_args](6). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](7) and [Function get_pic_args](8). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](9) and [Function get_dependency_gen_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](37) and [Function get_compiler_dirs](38). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](39) and [Function get_default_include_dirs](40). Base classes have conflicting values for attribute 'has_arguments': [Function has_arguments](41) and [Function has_arguments](42). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](43) and [Function gnu_symbol_visibility_args](44). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](45) and [Function get_pie_args](46). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](47) and [Function get_profile_generate_args](48). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function sanitizer_compile_args](49) and [Function sanitizer_compile_args](50). Base classes have conflicting values for attribute 'get_preprocess_to_file_args': [Function get_preprocess_to_file_args](51) and [Function get_preprocess_to_file_args](52). Base classes have conflicting values for attribute 'split_shlib_to_parts': [Function split_shlib_to_parts](53) and [Function split_shlib_to_parts](54).
mesonbuild/compilers/c.py Fixed Show fixed Hide fixed
mesonbuild/compilers/cpp.py Fixed Show fixed Hide fixed
@@ -423,7 +413,7 @@
return []


class GnuCPPCompiler(_StdCPPLibMixin, GnuCompiler, CPPCompiler):
class GnuCPPCompiler(_StdCPPLibMixin, GnuCPPStds, GnuCompiler, CPPCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_prelink_args': [Function get_prelink_args](5) and [Function get_prelink_args](6). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](7) and [Function get_pic_args](8). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](9) and [Function get_dependency_gen_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](37) and [Function get_compiler_dirs](38). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](39) and [Function get_default_include_dirs](40). Base classes have conflicting values for attribute 'has_arguments': [Function has_arguments](41) and [Function has_arguments](42). Base classes have conflicting values for attribute 'language_stdlib_only_link_flags': [_lru_cache_wrapper()](43) and [Function language_stdlib_only_link_flags](44). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](45) and [Function gnu_symbol_visibility_args](46). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](47) and [Function get_pie_args](48). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](49) and [Function get_profile_generate_args](50). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function sanitizer_compile_args](51) and [Function sanitizer_compile_args](52). Base classes have conflicting values for attribute 'get_preprocess_to_file_args': [Function get_preprocess_to_file_args](53) and [Function get_preprocess_to_file_args](54). Base classes have conflicting values for attribute 'split_shlib_to_parts':

class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
class GnuObjCCompiler(GnuCStds, GnuCompiler, ObjCCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_prelink_args': [Function get_prelink_args](5) and [Function get_prelink_args](6). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](7) and [Function get_pic_args](8). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](9) and [Function get_dependency_gen_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](37) and [Function get_compiler_dirs](38). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](39) and [Function get_default_include_dirs](40). Base classes have conflicting values for attribute 'has_arguments': [Function has_arguments](41) and [Function has_arguments](42). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](43) and [Function gnu_symbol_visibility_args](44). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](45) and [Function get_pie_args](46). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](47) and [Function get_profile_generate_args](48). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function sanitizer_compile_args](49) and [Function sanitizer_compile_args](50). Base classes have conflicting values for attribute 'get_preprocess_to_file_args': [Function get_preprocess_to_file_args](51) and [Function get_preprocess_to_file_args](52). Base classes have conflicting values for attribute 'split_shlib_to_parts': [Function split_shlib_to_parts](53) and [Function split_shlib_to_parts](54).

class ClangObjCCompiler(ClangCompiler, ObjCCompiler):
class ClangObjCCompiler(ClangCStds, ClangCompiler, ObjCCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](5) and [Function get_pic_args](6). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](7) and [Function get_dependency_gen_args](8). Base classes have conflicting values for attribute 'get_pch_use_args': [Function get_pch_use_args](9) and [Function get_pch_use_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_coverage_link_args': [Function get_coverage_link_args](37) and [Function get_coverage_link_args](38). Base classes have conflicting values for attribute 'linker_to_compiler_args': [Function linker_to_compiler_args](39) and [Function linker_to_compiler_args](40). Base classes have conflicting values for attribute 'get_lto_link_args': [Function get_lto_link_args](41) and [Function get_lto_link_args](42). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](43) and [Function get_compiler_dirs](44). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](45) and [Function get_default_include_dirs](46). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](47) and [Function gnu_symbol_visibility_args](48). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](49) and [Function get_pie_args](50). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](51) and [Function get_profile_generate_args](52). Base classes have conflicting values for attribute 'get_profile_use_args': [Function get_profile_use_args](53) and [Function get_profile_use_args](54). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function

class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):

class GnuObjCPPCompiler(GnuCPPStds, GnuCompiler, ObjCPPCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_prelink_args': [Function get_prelink_args](5) and [Function get_prelink_args](6). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](7) and [Function get_pic_args](8). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](9) and [Function get_dependency_gen_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](37) and [Function get_compiler_dirs](38). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](39) and [Function get_default_include_dirs](40). Base classes have conflicting values for attribute 'has_arguments': [Function has_arguments](41) and [Function has_arguments](42). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](43) and [Function gnu_symbol_visibility_args](44). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](45) and [Function get_pie_args](46). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](47) and [Function get_profile_generate_args](48). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function sanitizer_compile_args](49) and [Function sanitizer_compile_args](50). Base classes have conflicting values for attribute 'get_preprocess_to_file_args': [Function get_preprocess_to_file_args](51) and [Function get_preprocess_to_file_args](52). Base classes have conflicting values for attribute 'split_shlib_to_parts': [Function split_shlib_to_parts](53) and [Function split_shlib_to_parts](54).

class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler):

class ClangObjCPPCompiler(ClangCPPStds, ClangCompiler, ObjCPPCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](5) and [Function get_pic_args](6). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](7) and [Function get_dependency_gen_args](8). Base classes have conflicting values for attribute 'get_pch_use_args': [Function get_pch_use_args](9) and [Function get_pch_use_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_coverage_link_args': [Function get_coverage_link_args](37) and [Function get_coverage_link_args](38). Base classes have conflicting values for attribute 'linker_to_compiler_args': [Function linker_to_compiler_args](39) and [Function linker_to_compiler_args](40). Base classes have conflicting values for attribute 'get_lto_link_args': [Function get_lto_link_args](41) and [Function get_lto_link_args](42). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](43) and [Function get_compiler_dirs](44). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](45) and [Function get_default_include_dirs](46). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](47) and [Function gnu_symbol_visibility_args](48). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](49) and [Function get_pie_args](50). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](51) and [Function get_profile_generate_args](52). Base classes have conflicting values for attribute 'get_profile_use_args': [Function get_profile_use_args](53) and [Function get_profile_use_args](54). Base classes have conflicting values for attribute 'sanitizer_compile_args': [Function
@bruchar1
Copy link
Member

bruchar1 commented Sep 6, 2024

Should there be a test for that, to ensure every compiler supports the same syntax for std option?

@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from f8d86c3 to 5a1175a Compare September 12, 2024 16:47
@dcbaker dcbaker requested a review from jpakkane as a code owner September 12, 2024 16:47
@dcbaker
Copy link
Member Author

dcbaker commented Sep 12, 2024

It was worth writing the tests, I found some issues that weren't being caught by our existing tests.

mesonbuild/compilers/cpp.py Outdated Show resolved Hide resolved
unittests/allplatformstests.py Show resolved Hide resolved
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from 5a1175a to 76b2563 Compare September 25, 2024 16:46
@dcbaker
Copy link
Member Author

dcbaker commented Sep 25, 2024

Also in the latest version, use mixins for the Apple version overrides

@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from 76b2563 to d4bcdc8 Compare September 25, 2024 16:48
@@ -188,18 +156,14 @@
id = 'armltdclang'


class AppleClangCCompiler(AppleCompilerMixin, ClangCCompiler):
class AppleClangCCompiler(AppleCompilerMixin, AppleCStdsMixin, ClangCCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](1) and [Function openmp_flags](2). Base classes have conflicting values for attribute 'openmp_link_flags': [Function openmp_link_flags](3) and [Function openmp_link_flags](4). Base classes have conflicting values for attribute 'get_prelink_args': [Function get_prelink_args](5) and [Function get_prelink_args](6). Base classes have conflicting values for attribute '_C17_VERSION': [str u'>=10.0.0'](7) and [str u'>=6.0.0'](8). Base classes have conflicting values for attribute '_C18_VERSION': [str u'>=11.0.0'](9) and [str u'>=8.0.0'](10). Base classes have conflicting values for attribute '_C2X_VERSION': [str u'>=11.0.0'](9) and [str u'>=9.0.0'](11).

_CPP23_VERSION = '>=12.0.0'
_CPP26_VERSION = '>=17.0.0'
class ClangCPPCompiler(_StdCPPLibMixin, ClangCPPStds, ClangCompiler, CPPCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'get_include_args': [Function get_include_args](1) and [Function get_include_args](2). Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](3) and [Function openmp_flags](4). Base classes have conflicting values for attribute 'get_pic_args': [Function get_pic_args](5) and [Function get_pic_args](6). Base classes have conflicting values for attribute 'get_dependency_gen_args': [Function get_dependency_gen_args](7) and [Function get_dependency_gen_args](8). Base classes have conflicting values for attribute 'get_pch_use_args': [Function get_pch_use_args](9) and [Function get_pch_use_args](10). Base classes have conflicting values for attribute 'get_pch_suffix': [Function get_pch_suffix](11) and [Function get_pch_suffix](12). Base classes have conflicting values for attribute 'get_coverage_args': [Function get_coverage_args](13) and [Function get_coverage_args](14). Base classes have conflicting values for attribute 'get_debug_args': [Function get_debug_args](15) and [Function get_debug_args](16). Base classes have conflicting values for attribute 'compute_parameters_with_absolute_paths': [Function compute_parameters_with_absolute_paths](17) and [Function compute_parameters_with_absolute_paths](18). Base classes have conflicting values for attribute 'get_colorout_args': [Function get_colorout_args](19) and [Function get_colorout_args](20). Base classes have conflicting values for attribute 'get_output_args': [Function get_output_args](21) and [Function get_output_args](22). Base classes have conflicting values for attribute 'get_compile_only_args': [Function get_compile_only_args](23) and [Function get_compile_only_args](24). Base classes have conflicting values for attribute 'get_argument_syntax': [staticmethod()](25) and [staticmethod()](26). Base classes have conflicting values for attribute 'get_instruction_set_args': [Function get_instruction_set_args](27) and [Function get_instruction_set_args](28). Base classes have conflicting values for attribute 'has_builtin_define': [Function has_builtin_define](29) and [Function has_builtin_define](30). Base classes have conflicting values for attribute 'get_builtin_define': [Function get_builtin_define](31) and [Function get_builtin_define](32). Base classes have conflicting values for attribute 'use_linker_args': [classmethod()](33) and [classmethod()](34). Base classes have conflicting values for attribute 'get_has_func_attribute_extra_args': [Function get_has_func_attribute_extra_args](35) and [Function get_has_func_attribute_extra_args](36). Base classes have conflicting values for attribute 'get_coverage_link_args': [Function get_coverage_link_args](37) and [Function get_coverage_link_args](38). Base classes have conflicting values for attribute 'linker_to_compiler_args': [Function linker_to_compiler_args](39) and [Function linker_to_compiler_args](40). Base classes have conflicting values for attribute 'get_lto_link_args': [Function get_lto_link_args](41) and [Function get_lto_link_args](42). Base classes have conflicting values for attribute 'get_compiler_dirs': [Function get_compiler_dirs](43) and [Function get_compiler_dirs](44). Base classes have conflicting values for attribute 'get_default_include_dirs': [Function get_default_include_dirs](45) and [Function get_default_include_dirs](46). Base classes have conflicting values for attribute 'language_stdlib_only_link_flags': [_lru_cache_wrapper()](47) and [Function language_stdlib_only_link_flags](48). Base classes have conflicting values for attribute 'gnu_symbol_visibility_args': [Function gnu_symbol_visibility_args](49) and [Function gnu_symbol_visibility_args](50). Base classes have conflicting values for attribute 'get_pie_args': [Function get_pie_args](51) and [Function get_pie_args](52). Base classes have conflicting values for attribute 'get_profile_generate_args': [Function get_profile_generate_args](53) and [Function get_profile_generate_args](54). Base classes have conflicting values for attribute 'get_profile_use_args':
# TODO: We don't know which XCode version will include LLVM 17 yet, so
# use something absurd.
_CPP26_VERSION = '>=99.0.0'
class AppleClangCPPCompiler(AppleCompilerMixin, AppleCPPStdsMixin, ClangCPPCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute 'openmp_flags': [Function openmp_flags](1) and [Function openmp_flags](2). Base classes have conflicting values for attribute 'openmp_link_flags': [Function openmp_link_flags](3) and [Function openmp_link_flags](4). Base classes have conflicting values for attribute 'get_prelink_args': [Function get_prelink_args](5) and [Function get_prelink_args](6). Base classes have conflicting values for attribute '_CPP23_VERSION': [str u'>=13.0.0'](7) and [str u'>=12.0.0'](8). Base classes have conflicting values for attribute '_CPP26_VERSION': [str u'>=99.0.0'](9) and [str u'>=17.0.0'](10).
if std != 'none':
args.append('-std=' + std)
return args

class AppleClangObjCCompiler(ClangObjCCompiler):
class AppleClangObjCCompiler(AppleCStdsMixin, ClangObjCCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute '_C17_VERSION': [str u'>=10.0.0'](1) and [str u'>=6.0.0'](2). Base classes have conflicting values for attribute '_C18_VERSION': [str u'>=11.0.0'](3) and [str u'>=8.0.0'](4). Base classes have conflicting values for attribute '_C2X_VERSION': [str u'>=11.0.0'](3) and [str u'>=9.0.0'](5).
if std != 'none':
args.append('-std=' + std)
return args


class AppleClangObjCPPCompiler(ClangObjCPPCompiler):
class AppleClangObjCPPCompiler(AppleCPPStdsMixin, ClangObjCPPCompiler):

Check warning

Code scanning / CodeQL

Conflicting attributes in base classes

Base classes have conflicting values for attribute '_CPP23_VERSION': [str u'>=13.0.0'](1) and [str u'>=12.0.0'](2). Base classes have conflicting values for attribute '_CPP26_VERSION': [str u'>=99.0.0'](3) and [str u'>=17.0.0'](4).
@bgilbert
Copy link
Contributor

xref #13713: it'd be good to produce a future-feature warning if ObjC is used with a list of standards. Otherwise projects might be surprised e.g. if they use Objective C on macOS, don't CI on macOS with older Meson, and switch to c_std=gnuXX,cXX. (I tripped over this in glib, and CI caught it only because this PR hasn't shipped.)

@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch 2 times, most recently from b05ecce to acb45fe Compare September 25, 2024 19:32
@dcbaker
Copy link
Member Author

dcbaker commented Sep 25, 2024

@bgilbert given that this series is already up to 13 patches and is fixing tons of issues with ObjC, I'd prefer to handle that separately, but I assigned that to myself and I'll have a look it at.

@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch 2 times, most recently from e4810f9 to bed8bee Compare September 26, 2024 15:51
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from bed8bee to 7b81d1c Compare November 18, 2024 16:56
@@ -10,18 +11,18 @@
from .. import mlog
from ..mesonlib import MesonException, version_compare
from .c_function_attributes import C_FUNC_ATTRIBUTES
from .mixins.apple import AppleCompilerMixin
from .mixins.apple import AppleCompilerMixin, AppleCStdsMixin

Check failure

Code scanning / CodeQL

Module-level cyclic import

'AppleCompilerMixin' may not be defined if module [mesonbuild.compilers.mixins.apple](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of AppleCompilerMixin occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'AppleCompilerMixin' may not be defined if module [mesonbuild.compilers.mixins.apple](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of AppleCompilerMixin occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'AppleCompilerMixin' may not be defined if module [mesonbuild.compilers.mixins.apple](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of AppleCompilerMixin occurs after the cyclic [import](6) of mesonbuild.compilers.c.
@@ -10,18 +11,18 @@
from .. import mlog
from ..mesonlib import MesonException, version_compare
from .c_function_attributes import C_FUNC_ATTRIBUTES
from .mixins.apple import AppleCompilerMixin
from .mixins.apple import AppleCompilerMixin, AppleCStdsMixin

Check failure

Code scanning / CodeQL

Module-level cyclic import

'AppleCStdsMixin' may not be defined if module [mesonbuild.compilers.mixins.apple](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of AppleCStdsMixin occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'AppleCStdsMixin' may not be defined if module [mesonbuild.compilers.mixins.apple](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of AppleCStdsMixin occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'AppleCStdsMixin' may not be defined if module [mesonbuild.compilers.mixins.apple](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of AppleCStdsMixin occurs after the cyclic [import](6) of mesonbuild.compilers.c.
from .mixins.clike import CLikeCompiler
from .mixins.ccrx import CcrxCompiler
from .mixins.xc16 import Xc16Compiler
from .mixins.compcert import CompCertCompiler
from .mixins.ti import TICompiler
from .mixins.arm import ArmCompiler, ArmclangCompiler
from .mixins.visualstudio import MSVCCompiler, ClangClCompiler
from .mixins.gnu import GnuCompiler
from .mixins.gnu import GnuCompiler, GnuCStds

Check failure

Code scanning / CodeQL

Module-level cyclic import

'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](6) of mesonbuild.compilers.c. 'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](7) of mesonbuild.compilers.c. 'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](8) of mesonbuild.compilers.c. 'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](9) of mesonbuild.compilers.c. 'GnuCompiler' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCompiler occurs after the cyclic [import](10) of mesonbuild.compilers.c.
from .mixins.clike import CLikeCompiler
from .mixins.ccrx import CcrxCompiler
from .mixins.xc16 import Xc16Compiler
from .mixins.compcert import CompCertCompiler
from .mixins.ti import TICompiler
from .mixins.arm import ArmCompiler, ArmclangCompiler
from .mixins.visualstudio import MSVCCompiler, ClangClCompiler
from .mixins.gnu import GnuCompiler
from .mixins.gnu import GnuCompiler, GnuCStds

Check failure

Code scanning / CodeQL

Module-level cyclic import

'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](6) of mesonbuild.compilers.c. 'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](7) of mesonbuild.compilers.c. 'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](8) of mesonbuild.compilers.c. 'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](9) of mesonbuild.compilers.c. 'GnuCStds' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of GnuCStds occurs after the cyclic [import](10) of mesonbuild.compilers.c.
from .mixins.gnu import gnu_common_warning_args, gnu_c_warning_args
from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler
from .mixins.clang import ClangCompiler
from .mixins.clang import ClangCompiler, ClangCStds

Check failure

Code scanning / CodeQL

Module-level cyclic import

'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](6) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](7) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](8) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](9) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](10) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](11) of mesonbuild.compilers.c. 'ClangCompiler' may not be defined if module [mesonbuild.compilers.mixins.clang](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of ClangCompiler occurs after the cyclic [import](12) of mesonbuild.compilers.c.
from ...linkers.linkers import AppleDynamicLinker, ClangClDynamicLinker, LLVMDynamicLinker, GnuGoldDynamicLinker, \
MoldDynamicLinker, MSVCDynamicLinker
from ...options import OptionKey
from ..compilers import CompileCheckMode
from .gnu import GnuLikeCompiler

if T.TYPE_CHECKING:
from ...coredata import MutableKeyedOptionDictType

Check failure

Code scanning / CodeQL

Module-level cyclic import

'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](6) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](7) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](8) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](9) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](10) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](11) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](12) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](13) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](6) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](7) of mesonbuild.compilers.mixins.clang. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cycl
from ...environment import Environment
from ...dependencies import Dependency # noqa: F401
from ..compilers import Compiler

Check failure

Code scanning / CodeQL

Module-level cyclic import

'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](6) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](7) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](8) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](9) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](10) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](11) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](12) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](13) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](14) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](15) of mesonbuild.compilers.mixins.clang. 'Compiler' may not be defined if module [mesonbuild.compilers.compilers](1) is imported before module [mesonbuild.compilers.mixins.clang](2), as the [definition](3) of Compiler occurs after the cyclic [import](16) of mesonbuild.compilers.mixins.clang.
@@ -16,11 +16,12 @@

from ... import mesonlib
from ... import mlog
from ...options import OptionKey
from ...options import OptionKey, UserStdOption

Check failure

Code scanning / CodeQL

Module-level cyclic import

'OptionKey' may not be defined if module [mesonbuild.options](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of OptionKey occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.gnu. 'OptionKey' may not be defined if module [mesonbuild.options](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of OptionKey occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.gnu.
@@ -16,11 +16,12 @@

from ... import mesonlib
from ... import mlog
from ...options import OptionKey
from ...options import OptionKey, UserStdOption

Check failure

Code scanning / CodeQL

Module-level cyclic import

'UserStdOption' may not be defined if module [mesonbuild.options](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of UserStdOption occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.gnu. 'UserStdOption' may not be defined if module [mesonbuild.options](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of UserStdOption occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.gnu.
from mesonbuild.compilers.compilers import CompileCheckMode

if T.TYPE_CHECKING:
from ..._typing import ImmutableListProtocol
from ...coredata import MutableKeyedOptionDictType

Check failure

Code scanning / CodeQL

Module-level cyclic import

'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](6) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](7) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](8) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](9) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](10) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](11) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](12) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](3) of MutableKeyedOptionDictType occurs after the cyclic [import](13) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](4) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](5) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](6) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](7) of mesonbuild.compilers.mixins.gnu. 'MutableKeyedOptionDictType' may not be defined if module [mesonbuild.coredata](1) is imported before module [mesonbuild.compilers.mixins.gnu](2), as the [definition](14) of MutableKeyedOptionDictType occurs after the cyclic [import](8) of mesonbuild.compilers.mixins.gnu. 'Mutabl
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch 4 times, most recently from ad9ca0d to 92b11f7 Compare November 19, 2024 19:03
from .mixins.clike import CLikeCompiler
from .mixins.ccrx import CcrxCompiler
from .mixins.xc16 import Xc16Compiler
from .mixins.compcert import CompCertCompiler
from .mixins.ti import TICompiler
from .mixins.arm import ArmCompiler, ArmclangCompiler
from .mixins.visualstudio import MSVCCompiler, ClangClCompiler
from .mixins.gnu import GnuCompiler
from .mixins.gnu import GnuCompiler, GnuCStds

Check failure

Code scanning / CodeQL

Module-level cyclic import

'gnu_common_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_common_warning_args occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'gnu_common_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_common_warning_args occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'gnu_common_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_common_warning_args occurs after the cyclic [import](6) of mesonbuild.compilers.c. 'gnu_common_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_common_warning_args occurs after the cyclic [import](7) of mesonbuild.compilers.c. 'gnu_common_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_common_warning_args occurs after the cyclic [import](8) of mesonbuild.compilers.c. 'gnu_common_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_common_warning_args occurs after the cyclic [import](9) of mesonbuild.compilers.c.
from .mixins.clike import CLikeCompiler
from .mixins.ccrx import CcrxCompiler
from .mixins.xc16 import Xc16Compiler
from .mixins.compcert import CompCertCompiler
from .mixins.ti import TICompiler
from .mixins.arm import ArmCompiler, ArmclangCompiler
from .mixins.visualstudio import MSVCCompiler, ClangClCompiler
from .mixins.gnu import GnuCompiler
from .mixins.gnu import GnuCompiler, GnuCStds

Check failure

Code scanning / CodeQL

Module-level cyclic import

'gnu_c_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_c_warning_args occurs after the cyclic [import](4) of mesonbuild.compilers.c. 'gnu_c_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_c_warning_args occurs after the cyclic [import](5) of mesonbuild.compilers.c. 'gnu_c_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_c_warning_args occurs after the cyclic [import](6) of mesonbuild.compilers.c. 'gnu_c_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_c_warning_args occurs after the cyclic [import](7) of mesonbuild.compilers.c. 'gnu_c_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_c_warning_args occurs after the cyclic [import](8) of mesonbuild.compilers.c. 'gnu_c_warning_args' may not be defined if module [mesonbuild.compilers.mixins.gnu](1) is imported before module [mesonbuild.compilers.c](2), as the [definition](3) of gnu_c_warning_args occurs after the cyclic [import](9) of mesonbuild.compilers.c.
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from 92b11f7 to 9899199 Compare November 19, 2024 20:06
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from 9899199 to 8a18d07 Compare January 7, 2025 21:09
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch 2 times, most recently from d04431f to d2156bc Compare January 9, 2025 17:26
@dcbaker dcbaker modified the milestones: 1.7, 1.8 Jan 9, 2025
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from d2156bc to 68828c4 Compare January 16, 2025 15:19
When used as a class decorator VSCode can no longer see that
BasePlatformTest is a TestCase. I hate having to adapt the code to the
tools, but it's really annoying to not have completion and syntax
highlighting.
We'll want to use this for ObjC as well, so we'll make it public and put
it in a public place.
This means that the two compilers will update together, and that ObjC
has the list behavior that C does.
…mpiler

We'll want to use this for the ObjC++ compiler too.
So we can re-use it in the ObjC++ standards
To avoid duplication between C and ObjC
Check clang-cl as well as cl, and clang as well as gcc.
This tests ObjC and ObjC++ both with and without C enabled. I did this
because I ran into issues where ObjC only worked when C was enabled, and
then a later bug where C was disabled, due to the fact that C and ObjC
both use `c_std` and not `objc_std`.
Since this is optional, we should not accept that GCC is a valid ObjC or
G++ is a valid ObjC++ Compiler unless we've tested that they can
actually do a basic compile.

This requires fixing a number of tests that have broken assumptions. In
some cases I've split tests where issues with one language would hide
the other. It would be great if we had a competent test framework that
allowed subtests to skip, unfortunately we have python's unittest
instead. Because of that we can't avoid extra tests by use of subtests.
@dcbaker dcbaker force-pushed the submit/fix-objc-standards branch from 68828c4 to 1eaab02 Compare January 27, 2025 17:39
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.

c_std supports list but objc_std doesn't
5 participants