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

ENH: set NDEBUG for release builds #325

Merged
merged 1 commit into from
Mar 10, 2023
Merged

Conversation

rgommers
Copy link
Contributor

NDEBUG is normally expected to be set for release builds, however for historical reasons Meson does not (yet) toggle NDEBUG for non-debug builds (which we already default to). So set this as the default. Choosing 'if-release' so that if users are explicitly asking for a debug build via config-settings, they don't see a change in behavior.

xref numpy/numpy#22546 (comment)

NDEBUG is normally expected to be set for release builds, however
for historical reasons Meson does not (yet) toggle `NDEBUG` for
non-debug builds (which we already default to). So set this as the
default. Choosing 'if-release' so that if users are explicitly
asking for a debug build via config-settings, they don't see a change
in behavior.

xref numpy/numpy#22546 (comment)
@rgommers rgommers added the enhancement New feature or request label Feb 27, 2023
@dnicolodi
Copy link
Member

I don't think this is a particularly good idea. I don't like meson-python getting into the busyness of choosing default compilation flags. I think Meson and the individual projects are much better placed for choosing defaults and setting the options they need. The b_ndebug options can be set in pyptoject.toml or in meson.setup with the default_options argument to the project() function. I already dislike that meson-python specifies the debug=false and optimization=2 by default, trampling the defaults choosen by the project maintainers in meson.build. Let's not extend on that.

@rgommers
Copy link
Contributor Author

Did you read the linked comment @dnicolodi? Not doing this but then recommending every single user of meson-python to use this default seems like quite a bit of busywork for no good reason (and it's easy to miss, it took me over a year to learn about this).

If we can get Meson to change (mesonbuild/meson#2566) then we can drop this again, but that may take longer.

I already dislike that meson-python specifies the debug=false and optimization=2 by default, trampling the defaults choosen by the project maintainers in meson.build.

This isn't a very good reason I'd say. The default in meson.build is typically chosen for development work. Having meson-python, whose main job it is to build sdists and wheels (the things that go onto PyPI for releases), set a default that's more appropriate for a release seems very natural to me. And it can still be overridden in, e.g., CI jobs of projects if they really want to.

@dnicolodi
Copy link
Member

I read the linked comment, but I don't see how you jump from @eli-schwartz position of "developers should put b_ndebug=if-release in their project default_options" to "let's override what the project developers decided to use as default in their projects" especially if this comes with exactly zero mentions in the documentation. Personally I'm very annoyed when a tool decided that it knows better and decided to override my choices.

@eli-schwartz
Copy link
Member

If it were possible to only set it when the project doesn't set it in default_options, would that make everyone happy?

Unfortunately, machine files aren't the answer here, as those still override default_options. What you can do, however, is:

meson introspect --buildoptions meson.build

and load that json into a dictionary "j". next(opt for opt in j if opt['name'] == 'b_ndebug')['value'] is the current value where default_options overrides the defaults baked into the meson source code.

@eli-schwartz
Copy link
Member

eli-schwartz commented Feb 27, 2023

And it can still be overridden in, e.g., CI jobs of projects if they really want to.

For the sake of argument, you can also override it in pyproject.toml, now, right?

(I am not sure UX-wise what the best option layering is, here, so I'm going to try to avoid being too opinionated.)

@rgommers
Copy link
Contributor Author

For the sake of argument, you can also override it in pyproject.toml, now, right?

Yes, but I'm operating entirely on the premise that both project authors and pip install ... users are very likely not aware of this option at all, and are much better off with the default in this PR.

If it were possible to only set it when the project doesn't set it in default_options, would that make everyone happy?

That sounds pretty nice.

@dnicolodi
Copy link
Member

What you can do, however, is:

meson introspect --buildoptions meson.build

and load that json into a dictionary "j". next(opt for opt in j if opt['name'] == 'b_ndebug')['value'] is the current value where default_options overrides the defaults baked into the meson source code.

Am I missing something or this only gives you the current value, not whether it the default set by Meson or the value in default_options? If default_options contains b_ndebug=false the output of this command does not change (or I am missing something in my tests). There does not seem to be a way to check whether the option has been set in default_options or is the Meson default, if the two agree.

@eli-schwartz
Copy link
Member

Ah right, if someone sets the default explicitly to the default... you cannot just say "aha, this differs from what I happen to know meson defaults to"...

You can use --ast instead of --buildoptions, but the output is a lot gnarlier:

json output

{
  "lines": [
    {
      "args": {
        "positional": [
          {
            "value": "SciPy",
            "node": "StringNode",
            "lineno": 2,
            "colno": 2,
            "end_lineno": 2,
            "end_colno": 2
          },
          {
            "value": "c",
            "node": "StringNode",
            "lineno": 3,
            "colno": 2,
            "end_lineno": 3,
            "end_colno": 2
          },
          {
            "value": "cpp",
            "node": "StringNode",
            "lineno": 3,
            "colno": 7,
            "end_lineno": 3,
            "end_colno": 7
          },
          {
            "value": "cython",
            "node": "StringNode",
            "lineno": 3,
            "colno": 14,
            "end_lineno": 3,
            "end_colno": 14
          }
        ],
        "kwargs": [
          {
            "key": {
              "value": "version",
              "node": "IdNode",
              "lineno": 7,
              "colno": 2,
              "end_lineno": 7,
              "end_colno": 2
            },
            "val": {
              "value": "1.11.0.dev0",
              "node": "StringNode",
              "lineno": 7,
              "colno": 11,
              "end_lineno": 7,
              "end_colno": 11
            }
          },
          {
            "key": {
              "value": "license",
              "node": "IdNode",
              "lineno": 8,
              "colno": 2,
              "end_lineno": 8,
              "end_colno": 2
            },
            "val": {
              "value": "BSD-3",
              "node": "StringNode",
              "lineno": 8,
              "colno": 11,
              "end_lineno": 8,
              "end_colno": 11
            }
          },
          {
            "key": {
              "value": "meson_version",
              "node": "IdNode",
              "lineno": 9,
              "colno": 2,
              "end_lineno": 9,
              "end_colno": 2
            },
            "val": {
              "value": ">= 0.64.0",
              "node": "StringNode",
              "lineno": 9,
              "colno": 17,
              "end_lineno": 9,
              "end_colno": 17
            }
          },
          {
            "key": {
              "value": "default_options",
              "node": "IdNode",
              "lineno": 10,
              "colno": 2,
              "end_lineno": 10,
              "end_colno": 2
            },
            "val": {
              "args": {
                "positional": [
                  {
                    "value": "buildtype=debugoptimized",
                    "node": "StringNode",
                    "lineno": 11,
                    "colno": 4,
                    "end_lineno": 11,
                    "end_colno": 4
                  },
                  {
                    "value": "c_std=c99",
                    "node": "StringNode",
                    "lineno": 12,
                    "colno": 4,
                    "end_lineno": 12,
                    "end_colno": 4
                  },
                  {
                    "value": "cpp_std=c++14",
                    "node": "StringNode",
                    "lineno": 13,
                    "colno": 4,
                    "end_lineno": 13,
                    "end_colno": 4
                  },
                  {
                    "value": "fortran_std=legacy",
                    "node": "StringNode",
                    "lineno": 14,
                    "colno": 4,
                    "end_lineno": 14,
                    "end_colno": 4
                  },
                  {
                    "value": "blas=openblas",
                    "node": "StringNode",
                    "lineno": 15,
                    "colno": 4,
                    "end_lineno": 15,
                    "end_colno": 4
                  },
                  {
                    "value": "lapack=openblas",
                    "node": "StringNode",
                    "lineno": 16,
                    "colno": 4,
                    "end_lineno": 16,
                    "end_colno": 4
                  }
                ],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 11,
                "colno": 30,
                "end_lineno": 11,
                "end_colno": 30
              },
              "node": "ArrayNode",
              "lineno": 10,
              "colno": 19,
              "end_lineno": 17,
              "end_colno": 3
            }
          }
        ],
        "node": "ArgumentNode",
        "lineno": 2,
        "colno": 9,
        "end_lineno": 2,
        "end_colno": 9
      },
      "name": "project",
      "node": "FunctionNode",
      "lineno": 1,
      "colno": 0,
      "end_lineno": 18,
      "end_colno": 1
    },
    {
      "value": {
        "object": {
          "value": "meson",
          "node": "IdNode",
          "lineno": 20,
          "colno": 5,
          "end_lineno": 20,
          "end_colno": 5
        },
        "args": {
          "positional": [
            {
              "value": "c",
              "node": "StringNode",
              "lineno": 20,
              "colno": 24,
              "end_lineno": 20,
              "end_colno": 24
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 20,
          "colno": 27,
          "end_lineno": 20,
          "end_colno": 27
        },
        "name": "get_compiler",
        "node": "MethodNode",
        "lineno": 20,
        "colno": 11,
        "end_lineno": 20,
        "end_colno": 11
      },
      "var_name": "cc",
      "node": "AssignmentNode",
      "lineno": 20,
      "colno": 0,
      "end_lineno": 20,
      "end_colno": 0
    },
    {
      "value": {
        "object": {
          "value": "meson",
          "node": "IdNode",
          "lineno": 21,
          "colno": 6,
          "end_lineno": 21,
          "end_colno": 6
        },
        "args": {
          "positional": [
            {
              "value": "cpp",
              "node": "StringNode",
              "lineno": 21,
              "colno": 25,
              "end_lineno": 21,
              "end_colno": 25
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 21,
          "colno": 30,
          "end_lineno": 21,
          "end_colno": 30
        },
        "name": "get_compiler",
        "node": "MethodNode",
        "lineno": 21,
        "colno": 12,
        "end_lineno": 21,
        "end_colno": 12
      },
      "var_name": "cpp",
      "node": "AssignmentNode",
      "lineno": 21,
      "colno": 0,
      "end_lineno": 21,
      "end_colno": 0
    },
    {
      "ifs": [
        {
          "condition": {
            "left": {
              "object": {
                "value": "cc",
                "node": "IdNode",
                "lineno": 24,
                "colno": 3,
                "end_lineno": 24,
                "end_colno": 3
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 24,
                "colno": 13,
                "end_lineno": 24,
                "end_colno": 13
              },
              "name": "get_id",
              "node": "MethodNode",
              "lineno": 24,
              "colno": 6,
              "end_lineno": 24,
              "end_colno": 6
            },
            "right": {
              "value": "gcc",
              "node": "StringNode",
              "lineno": 24,
              "colno": 18,
              "end_lineno": 24,
              "end_colno": 18
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 24,
            "colno": 6,
            "end_lineno": 24,
            "end_colno": 6
          },
          "block": {
            "lines": [
              {
                "ifs": [
                  {
                    "condition": {
                      "right": {
                        "object": {
                          "object": {
                            "value": "cc",
                            "node": "IdNode",
                            "lineno": 25,
                            "colno": 9,
                            "end_lineno": 25,
                            "end_colno": 9
                          },
                          "args": {
                            "positional": [],
                            "kwargs": [],
                            "node": "ArgumentNode",
                            "lineno": 25,
                            "colno": 20,
                            "end_lineno": 25,
                            "end_colno": 20
                          },
                          "name": "version",
                          "node": "MethodNode",
                          "lineno": 25,
                          "colno": 12,
                          "end_lineno": 25,
                          "end_colno": 12
                        },
                        "args": {
                          "positional": [
                            {
                              "value": ">=8.0",
                              "node": "StringNode",
                              "lineno": 25,
                              "colno": 38,
                              "end_lineno": 25,
                              "end_colno": 38
                            }
                          ],
                          "kwargs": [],
                          "node": "ArgumentNode",
                          "lineno": 25,
                          "colno": 45,
                          "end_lineno": 25,
                          "end_colno": 45
                        },
                        "name": "version_compare",
                        "node": "MethodNode",
                        "lineno": 25,
                        "colno": 22,
                        "end_lineno": 25,
                        "end_colno": 22
                      },
                      "node": "NotNode",
                      "lineno": 25,
                      "colno": 9,
                      "end_lineno": 25,
                      "end_colno": 9
                    },
                    "block": {
                      "lines": [
                        {
                          "args": {
                            "positional": [
                              {
                                "value": "SciPy requires GCC >= 8.0",
                                "node": "StringNode",
                                "lineno": 26,
                                "colno": 10,
                                "end_lineno": 26,
                                "end_colno": 10
                              }
                            ],
                            "kwargs": [],
                            "node": "ArgumentNode",
                            "lineno": 26,
                            "colno": 37,
                            "end_lineno": 26,
                            "end_colno": 37
                          },
                          "name": "error",
                          "node": "FunctionNode",
                          "lineno": 26,
                          "colno": 4,
                          "end_lineno": 26,
                          "end_colno": 38
                        }
                      ],
                      "node": "CodeBlockNode",
                      "lineno": 26,
                      "colno": 4,
                      "end_lineno": 26,
                      "end_colno": 4
                    },
                    "node": "IfNode",
                    "lineno": 25,
                    "colno": 9,
                    "end_lineno": 25,
                    "end_colno": 9
                  }
                ],
                "else": {
                  "node": "EmptyNode",
                  "lineno": 27,
                  "colno": 2,
                  "end_lineno": 27,
                  "end_colno": 2
                },
                "node": "IfClauseNode",
                "lineno": 25,
                "colno": 9,
                "end_lineno": 25,
                "end_colno": 9
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 25,
            "colno": 2,
            "end_lineno": 25,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 24,
          "colno": 6,
          "end_lineno": 24,
          "end_colno": 6
        },
        {
          "condition": {
            "left": {
              "object": {
                "value": "cc",
                "node": "IdNode",
                "lineno": 28,
                "colno": 5,
                "end_lineno": 28,
                "end_colno": 5
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 28,
                "colno": 15,
                "end_lineno": 28,
                "end_colno": 15
              },
              "name": "get_id",
              "node": "MethodNode",
              "lineno": 28,
              "colno": 8,
              "end_lineno": 28,
              "end_colno": 8
            },
            "right": {
              "value": "msvc",
              "node": "StringNode",
              "lineno": 28,
              "colno": 20,
              "end_lineno": 28,
              "end_colno": 20
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 28,
            "colno": 8,
            "end_lineno": 28,
            "end_colno": 8
          },
          "block": {
            "lines": [
              {
                "ifs": [
                  {
                    "condition": {
                      "right": {
                        "object": {
                          "object": {
                            "value": "cc",
                            "node": "IdNode",
                            "lineno": 29,
                            "colno": 9,
                            "end_lineno": 29,
                            "end_colno": 9
                          },
                          "args": {
                            "positional": [],
                            "kwargs": [],
                            "node": "ArgumentNode",
                            "lineno": 29,
                            "colno": 20,
                            "end_lineno": 29,
                            "end_colno": 20
                          },
                          "name": "version",
                          "node": "MethodNode",
                          "lineno": 29,
                          "colno": 12,
                          "end_lineno": 29,
                          "end_colno": 12
                        },
                        "args": {
                          "positional": [
                            {
                              "value": ">=19.20",
                              "node": "StringNode",
                              "lineno": 29,
                              "colno": 38,
                              "end_lineno": 29,
                              "end_colno": 38
                            }
                          ],
                          "kwargs": [],
                          "node": "ArgumentNode",
                          "lineno": 29,
                          "colno": 47,
                          "end_lineno": 29,
                          "end_colno": 47
                        },
                        "name": "version_compare",
                        "node": "MethodNode",
                        "lineno": 29,
                        "colno": 22,
                        "end_lineno": 29,
                        "end_colno": 22
                      },
                      "node": "NotNode",
                      "lineno": 29,
                      "colno": 9,
                      "end_lineno": 29,
                      "end_colno": 9
                    },
                    "block": {
                      "lines": [
                        {
                          "args": {
                            "positional": [
                              {
                                "left": {
                                  "value": "SciPy requires at least vc142 (default with Visual Studio 2019) ",
                                  "node": "StringNode",
                                  "lineno": 30,
                                  "colno": 10,
                                  "end_lineno": 30,
                                  "end_colno": 10
                                },
                                "right": {
                                  "value": "when building with MSVC",
                                  "node": "StringNode",
                                  "lineno": 31,
                                  "colno": 10,
                                  "end_lineno": 31,
                                  "end_colno": 10
                                },
                                "op": "+",
                                "node": "ArithmeticNode",
                                "lineno": 30,
                                "colno": 10,
                                "end_lineno": 30,
                                "end_colno": 10
                              }
                            ],
                            "kwargs": [],
                            "node": "ArgumentNode",
                            "lineno": 31,
                            "colno": 35,
                            "end_lineno": 31,
                            "end_colno": 35
                          },
                          "name": "error",
                          "node": "FunctionNode",
                          "lineno": 30,
                          "colno": 4,
                          "end_lineno": 31,
                          "end_colno": 36
                        }
                      ],
                      "node": "CodeBlockNode",
                      "lineno": 30,
                      "colno": 4,
                      "end_lineno": 30,
                      "end_colno": 4
                    },
                    "node": "IfNode",
                    "lineno": 29,
                    "colno": 9,
                    "end_lineno": 29,
                    "end_colno": 9
                  }
                ],
                "else": {
                  "node": "EmptyNode",
                  "lineno": 32,
                  "colno": 2,
                  "end_lineno": 32,
                  "end_colno": 2
                },
                "node": "IfClauseNode",
                "lineno": 29,
                "colno": 9,
                "end_lineno": 29,
                "end_colno": 9
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 29,
            "colno": 2,
            "end_lineno": 29,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 28,
          "colno": 8,
          "end_lineno": 28,
          "end_colno": 8
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 33,
        "colno": 0,
        "end_lineno": 33,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 24,
      "colno": 6,
      "end_lineno": 24,
      "end_colno": 6
    },
    {
      "value": {
        "object": {
          "value": "cc",
          "node": "IdNode",
          "lineno": 37,
          "colno": 17,
          "end_lineno": 37,
          "end_colno": 17
        },
        "args": {
          "positional": [
            {
              "value": "-Wno-unused-but-set-variable",
              "node": "StringNode",
              "lineno": 38,
              "colno": 2,
              "end_lineno": 38,
              "end_colno": 2
            },
            {
              "value": "-Wno-unused-function",
              "node": "StringNode",
              "lineno": 39,
              "colno": 2,
              "end_lineno": 39,
              "end_colno": 2
            },
            {
              "value": "-Wno-conversion",
              "node": "StringNode",
              "lineno": 40,
              "colno": 2,
              "end_lineno": 40,
              "end_colno": 2
            },
            {
              "value": "-Wno-misleading-indentation",
              "node": "StringNode",
              "lineno": 41,
              "colno": 2,
              "end_lineno": 41,
              "end_colno": 2
            },
            {
              "value": "-Wno-incompatible-pointer-types",
              "node": "StringNode",
              "lineno": 42,
              "colno": 2,
              "end_lineno": 42,
              "end_colno": 2
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 38,
          "colno": 32,
          "end_lineno": 38,
          "end_colno": 32
        },
        "name": "get_supported_arguments",
        "node": "MethodNode",
        "lineno": 37,
        "colno": 20,
        "end_lineno": 37,
        "end_colno": 20
      },
      "var_name": "_global_c_args",
      "node": "AssignmentNode",
      "lineno": 37,
      "colno": 0,
      "end_lineno": 37,
      "end_colno": 0
    },
    {
      "args": {
        "positional": [
          {
            "value": "_global_c_args",
            "node": "IdNode",
            "lineno": 44,
            "colno": 22,
            "end_lineno": 44,
            "end_colno": 22
          }
        ],
        "kwargs": [
          {
            "key": {
              "value": "language",
              "node": "IdNode",
              "lineno": 44,
              "colno": 38,
              "end_lineno": 44,
              "end_colno": 38
            },
            "val": {
              "value": "c",
              "node": "StringNode",
              "lineno": 44,
              "colno": 49,
              "end_lineno": 44,
              "end_colno": 49
            }
          }
        ],
        "node": "ArgumentNode",
        "lineno": 44,
        "colno": 36,
        "end_lineno": 44,
        "end_colno": 36
      },
      "name": "add_project_arguments",
      "node": "FunctionNode",
      "lineno": 44,
      "colno": 0,
      "end_lineno": 44,
      "end_colno": 53
    },
    {
      "value": {
        "object": {
          "value": "cc",
          "node": "IdNode",
          "lineno": 49,
          "colno": 8,
          "end_lineno": 49,
          "end_colno": 8
        },
        "args": {
          "positional": [
            {
              "value": "m",
              "node": "StringNode",
              "lineno": 49,
              "colno": 24,
              "end_lineno": 49,
              "end_colno": 24
            }
          ],
          "kwargs": [
            {
              "key": {
                "value": "required",
                "node": "IdNode",
                "lineno": 49,
                "colno": 29,
                "end_lineno": 49,
                "end_colno": 29
              },
              "val": {
                "value": false,
                "node": "BooleanNode",
                "lineno": 49,
                "colno": 40,
                "end_lineno": 49,
                "end_colno": 40
              }
            }
          ],
          "node": "ArgumentNode",
          "lineno": 49,
          "colno": 27,
          "end_lineno": 49,
          "end_colno": 27
        },
        "name": "find_library",
        "node": "MethodNode",
        "lineno": 49,
        "colno": 11,
        "end_lineno": 49,
        "end_colno": 11
      },
      "var_name": "m_dep",
      "node": "AssignmentNode",
      "lineno": 49,
      "colno": 0,
      "end_lineno": 49,
      "end_colno": 0
    },
    {
      "ifs": [
        {
          "condition": {
            "object": {
              "value": "m_dep",
              "node": "IdNode",
              "lineno": 50,
              "colno": 3,
              "end_lineno": 50,
              "end_colno": 3
            },
            "args": {
              "positional": [],
              "kwargs": [],
              "node": "ArgumentNode",
              "lineno": 50,
              "colno": 15,
              "end_lineno": 50,
              "end_colno": 15
            },
            "name": "found",
            "node": "MethodNode",
            "lineno": 50,
            "colno": 9,
            "end_lineno": 50,
            "end_colno": 9
          },
          "block": {
            "lines": [
              {
                "args": {
                  "positional": [
                    {
                      "value": "-lm",
                      "node": "StringNode",
                      "lineno": 51,
                      "colno": 29,
                      "end_lineno": 51,
                      "end_colno": 29
                    }
                  ],
                  "kwargs": [
                    {
                      "key": {
                        "value": "language",
                        "node": "IdNode",
                        "lineno": 51,
                        "colno": 36,
                        "end_lineno": 51,
                        "end_colno": 36
                      },
                      "val": {
                        "value": "c",
                        "node": "StringNode",
                        "lineno": 51,
                        "colno": 47,
                        "end_lineno": 51,
                        "end_colno": 47
                      }
                    }
                  ],
                  "node": "ArgumentNode",
                  "lineno": 51,
                  "colno": 34,
                  "end_lineno": 51,
                  "end_colno": 34
                },
                "name": "add_project_link_arguments",
                "node": "FunctionNode",
                "lineno": 51,
                "colno": 2,
                "end_lineno": 51,
                "end_colno": 51
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 51,
            "colno": 2,
            "end_lineno": 51,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 50,
          "colno": 9,
          "end_lineno": 50,
          "end_colno": 9
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 52,
        "colno": 0,
        "end_lineno": 52,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 50,
      "colno": 9,
      "end_lineno": 50,
      "end_colno": 9
    },
    {
      "ifs": [
        {
          "condition": {
            "left": {
              "object": {
                "value": "host_machine",
                "node": "IdNode",
                "lineno": 54,
                "colno": 3,
                "end_lineno": 54,
                "end_colno": 3
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 54,
                "colno": 23,
                "end_lineno": 54,
                "end_colno": 23
              },
              "name": "system",
              "node": "MethodNode",
              "lineno": 54,
              "colno": 16,
              "end_lineno": 54,
              "end_colno": 16
            },
            "right": {
              "value": "os400",
              "node": "StringNode",
              "lineno": 54,
              "colno": 28,
              "end_lineno": 54,
              "end_colno": 28
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 54,
            "colno": 16,
            "end_lineno": 54,
            "end_colno": 16
          },
          "block": {
            "lines": [
              {
                "args": {
                  "positional": [
                    {
                      "value": "-D__STDC_FORMAT_MACROS",
                      "node": "StringNode",
                      "lineno": 56,
                      "colno": 24,
                      "end_lineno": 56,
                      "end_colno": 24
                    }
                  ],
                  "kwargs": [
                    {
                      "key": {
                        "value": "language",
                        "node": "IdNode",
                        "lineno": 56,
                        "colno": 50,
                        "end_lineno": 56,
                        "end_colno": 50
                      },
                      "val": {
                        "value": "cpp",
                        "node": "StringNode",
                        "lineno": 56,
                        "colno": 61,
                        "end_lineno": 56,
                        "end_colno": 61
                      }
                    }
                  ],
                  "node": "ArgumentNode",
                  "lineno": 56,
                  "colno": 48,
                  "end_lineno": 56,
                  "end_colno": 48
                },
                "name": "add_project_arguments",
                "node": "FunctionNode",
                "lineno": 56,
                "colno": 2,
                "end_lineno": 56,
                "end_colno": 67
              },
              {
                "args": {
                  "positional": [
                    {
                      "value": "-Wl,-bnotextro",
                      "node": "StringNode",
                      "lineno": 57,
                      "colno": 29,
                      "end_lineno": 57,
                      "end_colno": 29
                    }
                  ],
                  "kwargs": [
                    {
                      "key": {
                        "value": "language",
                        "node": "IdNode",
                        "lineno": 57,
                        "colno": 47,
                        "end_lineno": 57,
                        "end_colno": 47
                      },
                      "val": {
                        "value": "c",
                        "node": "StringNode",
                        "lineno": 57,
                        "colno": 58,
                        "end_lineno": 57,
                        "end_colno": 58
                      }
                    }
                  ],
                  "node": "ArgumentNode",
                  "lineno": 57,
                  "colno": 45,
                  "end_lineno": 57,
                  "end_colno": 45
                },
                "name": "add_project_link_arguments",
                "node": "FunctionNode",
                "lineno": 57,
                "colno": 2,
                "end_lineno": 57,
                "end_colno": 62
              },
              {
                "args": {
                  "positional": [
                    {
                      "value": "-Wl,-bnotextro",
                      "node": "StringNode",
                      "lineno": 58,
                      "colno": 29,
                      "end_lineno": 58,
                      "end_colno": 29
                    }
                  ],
                  "kwargs": [
                    {
                      "key": {
                        "value": "language",
                        "node": "IdNode",
                        "lineno": 58,
                        "colno": 47,
                        "end_lineno": 58,
                        "end_colno": 47
                      },
                      "val": {
                        "value": "cpp",
                        "node": "StringNode",
                        "lineno": 58,
                        "colno": 58,
                        "end_lineno": 58,
                        "end_colno": 58
                      }
                    }
                  ],
                  "node": "ArgumentNode",
                  "lineno": 58,
                  "colno": 45,
                  "end_lineno": 58,
                  "end_colno": 45
                },
                "name": "add_project_link_arguments",
                "node": "FunctionNode",
                "lineno": 58,
                "colno": 2,
                "end_lineno": 58,
                "end_colno": 64
              },
              {
                "args": {
                  "positional": [
                    {
                      "value": "-Wl,-bnotextro",
                      "node": "StringNode",
                      "lineno": 59,
                      "colno": 29,
                      "end_lineno": 59,
                      "end_colno": 29
                    }
                  ],
                  "kwargs": [
                    {
                      "key": {
                        "value": "language",
                        "node": "IdNode",
                        "lineno": 59,
                        "colno": 47,
                        "end_lineno": 59,
                        "end_colno": 47
                      },
                      "val": {
                        "value": "fortran",
                        "node": "StringNode",
                        "lineno": 59,
                        "colno": 58,
                        "end_lineno": 59,
                        "end_colno": 58
                      }
                    }
                  ],
                  "node": "ArgumentNode",
                  "lineno": 59,
                  "colno": 45,
                  "end_lineno": 59,
                  "end_colno": 45
                },
                "name": "add_project_link_arguments",
                "node": "FunctionNode",
                "lineno": 59,
                "colno": 2,
                "end_lineno": 59,
                "end_colno": 68
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 55,
            "colno": 61,
            "end_lineno": 55,
            "end_colno": 61
          },
          "node": "IfNode",
          "lineno": 54,
          "colno": 16,
          "end_lineno": 54,
          "end_colno": 16
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 60,
        "colno": 0,
        "end_lineno": 60,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 54,
      "colno": 16,
      "end_lineno": 54,
      "end_colno": 16
    },
    {
      "args": {
        "positional": [
          {
            "value": "fortran",
            "node": "StringNode",
            "lineno": 63,
            "colno": 14,
            "end_lineno": 63,
            "end_colno": 14
          }
        ],
        "kwargs": [
          {
            "key": {
              "value": "native",
              "node": "IdNode",
              "lineno": 63,
              "colno": 25,
              "end_lineno": 63,
              "end_colno": 25
            },
            "val": {
              "value": false,
              "node": "BooleanNode",
              "lineno": 63,
              "colno": 33,
              "end_lineno": 63,
              "end_colno": 33
            }
          }
        ],
        "node": "ArgumentNode",
        "lineno": 63,
        "colno": 23,
        "end_lineno": 63,
        "end_colno": 23
      },
      "name": "add_languages",
      "node": "FunctionNode",
      "lineno": 63,
      "colno": 0,
      "end_lineno": 63,
      "end_colno": 39
    },
    {
      "value": {
        "object": {
          "value": "meson",
          "node": "IdNode",
          "lineno": 64,
          "colno": 5,
          "end_lineno": 64,
          "end_colno": 5
        },
        "args": {
          "positional": [
            {
              "value": "fortran",
              "node": "StringNode",
              "lineno": 64,
              "colno": 24,
              "end_lineno": 64,
              "end_colno": 24
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 64,
          "colno": 33,
          "end_lineno": 64,
          "end_colno": 33
        },
        "name": "get_compiler",
        "node": "MethodNode",
        "lineno": 64,
        "colno": 11,
        "end_lineno": 64,
        "end_colno": 11
      },
      "var_name": "ff",
      "node": "AssignmentNode",
      "lineno": 64,
      "colno": 0,
      "end_lineno": 64,
      "end_colno": 0
    },
    {
      "ifs": [
        {
          "condition": {
            "object": {
              "value": "ff",
              "node": "IdNode",
              "lineno": 65,
              "colno": 3,
              "end_lineno": 65,
              "end_colno": 3
            },
            "args": {
              "positional": [
                {
                  "value": "-Wno-conversion",
                  "node": "StringNode",
                  "lineno": 65,
                  "colno": 19,
                  "end_lineno": 65,
                  "end_colno": 19
                }
              ],
              "kwargs": [],
              "node": "ArgumentNode",
              "lineno": 65,
              "colno": 36,
              "end_lineno": 65,
              "end_colno": 36
            },
            "name": "has_argument",
            "node": "MethodNode",
            "lineno": 65,
            "colno": 6,
            "end_lineno": 65,
            "end_colno": 6
          },
          "block": {
            "lines": [
              {
                "args": {
                  "positional": [
                    {
                      "value": "-Wno-conversion",
                      "node": "StringNode",
                      "lineno": 66,
                      "colno": 24,
                      "end_lineno": 66,
                      "end_colno": 24
                    }
                  ],
                  "kwargs": [
                    {
                      "key": {
                        "value": "language",
                        "node": "IdNode",
                        "lineno": 66,
                        "colno": 43,
                        "end_lineno": 66,
                        "end_colno": 43
                      },
                      "val": {
                        "value": "fortran",
                        "node": "StringNode",
                        "lineno": 66,
                        "colno": 53,
                        "end_lineno": 66,
                        "end_colno": 53
                      }
                    }
                  ],
                  "node": "ArgumentNode",
                  "lineno": 66,
                  "colno": 41,
                  "end_lineno": 66,
                  "end_colno": 41
                },
                "name": "add_project_arguments",
                "node": "FunctionNode",
                "lineno": 66,
                "colno": 2,
                "end_lineno": 66,
                "end_colno": 63
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 66,
            "colno": 2,
            "end_lineno": 66,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 65,
          "colno": 6,
          "end_lineno": 65,
          "end_colno": 6
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 67,
        "colno": 0,
        "end_lineno": 67,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 65,
      "colno": 6,
      "end_lineno": 65,
      "end_colno": 6
    },
    {
      "value": {
        "left": {
          "object": {
            "value": "host_machine",
            "node": "IdNode",
            "lineno": 69,
            "colno": 13,
            "end_lineno": 69,
            "end_colno": 13
          },
          "args": {
            "positional": [],
            "kwargs": [],
            "node": "ArgumentNode",
            "lineno": 69,
            "colno": 33,
            "end_lineno": 69,
            "end_colno": 33
          },
          "name": "system",
          "node": "MethodNode",
          "lineno": 69,
          "colno": 26,
          "end_lineno": 69,
          "end_colno": 26
        },
        "right": {
          "value": "windows",
          "node": "StringNode",
          "lineno": 69,
          "colno": 38,
          "end_lineno": 69,
          "end_colno": 38
        },
        "ctype": "==",
        "node": "ComparisonNode",
        "lineno": 69,
        "colno": 26,
        "end_lineno": 69,
        "end_colno": 26
      },
      "var_name": "is_windows",
      "node": "AssignmentNode",
      "lineno": 69,
      "colno": 0,
      "end_lineno": 69,
      "end_colno": 0
    },
    {
      "value": {
        "args": {
          "positional": [],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 77,
          "colno": 17,
          "end_lineno": 77,
          "end_colno": 17
        },
        "node": "ArrayNode",
        "lineno": 77,
        "colno": 16,
        "end_lineno": 77,
        "end_colno": 18
      },
      "var_name": "_intel_cflags",
      "node": "AssignmentNode",
      "lineno": 77,
      "colno": 0,
      "end_lineno": 77,
      "end_colno": 0
    },
    {
      "value": {
        "args": {
          "positional": [],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 78,
          "colno": 17,
          "end_lineno": 78,
          "end_colno": 17
        },
        "node": "ArrayNode",
        "lineno": 78,
        "colno": 16,
        "end_lineno": 78,
        "end_colno": 18
      },
      "var_name": "_intel_fflags",
      "node": "AssignmentNode",
      "lineno": 78,
      "colno": 0,
      "end_lineno": 78,
      "end_colno": 0
    },
    {
      "ifs": [
        {
          "condition": {
            "left": {
              "object": {
                "value": "cc",
                "node": "IdNode",
                "lineno": 79,
                "colno": 3,
                "end_lineno": 79,
                "end_colno": 3
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 79,
                "colno": 13,
                "end_lineno": 79,
                "end_colno": 13
              },
              "name": "get_id",
              "node": "MethodNode",
              "lineno": 79,
              "colno": 6,
              "end_lineno": 79,
              "end_colno": 6
            },
            "right": {
              "value": "intel",
              "node": "StringNode",
              "lineno": 79,
              "colno": 18,
              "end_lineno": 79,
              "end_colno": 18
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 79,
            "colno": 6,
            "end_lineno": 79,
            "end_colno": 6
          },
          "block": {
            "lines": [
              {
                "value": {
                  "object": {
                    "value": "cc",
                    "node": "IdNode",
                    "lineno": 80,
                    "colno": 19,
                    "end_lineno": 80,
                    "end_colno": 19
                  },
                  "args": {
                    "positional": [
                      {
                        "value": "-fp-model=strict",
                        "node": "StringNode",
                        "lineno": 80,
                        "colno": 46,
                        "end_lineno": 80,
                        "end_colno": 46
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 80,
                    "colno": 64,
                    "end_lineno": 80,
                    "end_colno": 64
                  },
                  "name": "get_supported_arguments",
                  "node": "MethodNode",
                  "lineno": 80,
                  "colno": 22,
                  "end_lineno": 80,
                  "end_colno": 22
                },
                "var_name": "_intel_cflags",
                "node": "PlusAssignmentNode",
                "lineno": 80,
                "colno": 2,
                "end_lineno": 80,
                "end_colno": 2
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 80,
            "colno": 2,
            "end_lineno": 80,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 79,
          "colno": 6,
          "end_lineno": 79,
          "end_colno": 6
        },
        {
          "condition": {
            "left": {
              "object": {
                "value": "cc",
                "node": "IdNode",
                "lineno": 81,
                "colno": 5,
                "end_lineno": 81,
                "end_colno": 5
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 81,
                "colno": 15,
                "end_lineno": 81,
                "end_colno": 15
              },
              "name": "get_id",
              "node": "MethodNode",
              "lineno": 81,
              "colno": 8,
              "end_lineno": 81,
              "end_colno": 8
            },
            "right": {
              "value": "intel-cl",
              "node": "StringNode",
              "lineno": 81,
              "colno": 20,
              "end_lineno": 81,
              "end_colno": 20
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 81,
            "colno": 8,
            "end_lineno": 81,
            "end_colno": 8
          },
          "block": {
            "lines": [
              {
                "value": {
                  "object": {
                    "value": "cc",
                    "node": "IdNode",
                    "lineno": 82,
                    "colno": 19,
                    "end_lineno": 82,
                    "end_colno": 19
                  },
                  "args": {
                    "positional": [
                      {
                        "value": "/fp:strict",
                        "node": "StringNode",
                        "lineno": 82,
                        "colno": 46,
                        "end_lineno": 82,
                        "end_colno": 46
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 82,
                    "colno": 58,
                    "end_lineno": 82,
                    "end_colno": 58
                  },
                  "name": "get_supported_arguments",
                  "node": "MethodNode",
                  "lineno": 82,
                  "colno": 22,
                  "end_lineno": 82,
                  "end_colno": 22
                },
                "var_name": "_intel_cflags",
                "node": "PlusAssignmentNode",
                "lineno": 82,
                "colno": 2,
                "end_lineno": 82,
                "end_colno": 2
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 82,
            "colno": 2,
            "end_lineno": 82,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 81,
          "colno": 8,
          "end_lineno": 81,
          "end_colno": 8
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 83,
        "colno": 0,
        "end_lineno": 83,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 79,
      "colno": 6,
      "end_lineno": 79,
      "end_colno": 6
    },
    {
      "ifs": [
        {
          "condition": {
            "left": {
              "object": {
                "value": "ff",
                "node": "IdNode",
                "lineno": 84,
                "colno": 3,
                "end_lineno": 84,
                "end_colno": 3
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 84,
                "colno": 13,
                "end_lineno": 84,
                "end_colno": 13
              },
              "name": "get_id",
              "node": "MethodNode",
              "lineno": 84,
              "colno": 6,
              "end_lineno": 84,
              "end_colno": 6
            },
            "right": {
              "value": "intel",
              "node": "StringNode",
              "lineno": 84,
              "colno": 18,
              "end_lineno": 84,
              "end_colno": 18
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 84,
            "colno": 6,
            "end_lineno": 84,
            "end_colno": 6
          },
          "block": {
            "lines": [
              {
                "value": {
                  "object": {
                    "value": "ff",
                    "node": "IdNode",
                    "lineno": 85,
                    "colno": 18,
                    "end_lineno": 85,
                    "end_colno": 18
                  },
                  "args": {
                    "positional": [
                      {
                        "value": "-fp-model=strict",
                        "node": "StringNode",
                        "lineno": 85,
                        "colno": 45,
                        "end_lineno": 85,
                        "end_colno": 45
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 85,
                    "colno": 63,
                    "end_lineno": 85,
                    "end_colno": 63
                  },
                  "name": "get_supported_arguments",
                  "node": "MethodNode",
                  "lineno": 85,
                  "colno": 21,
                  "end_lineno": 85,
                  "end_colno": 21
                },
                "var_name": "_intel_fflags",
                "node": "AssignmentNode",
                "lineno": 85,
                "colno": 2,
                "end_lineno": 85,
                "end_colno": 2
              },
              {
                "value": {
                  "args": {
                    "positional": [
                      {
                        "value": "-assume",
                        "node": "StringNode",
                        "lineno": 86,
                        "colno": 16,
                        "end_lineno": 86,
                        "end_colno": 16
                      },
                      {
                        "value": "minus0",
                        "node": "StringNode",
                        "lineno": 86,
                        "colno": 27,
                        "end_lineno": 86,
                        "end_colno": 27
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 86,
                    "colno": 25,
                    "end_lineno": 86,
                    "end_colno": 25
                  },
                  "node": "ArrayNode",
                  "lineno": 86,
                  "colno": 15,
                  "end_lineno": 86,
                  "end_colno": 36
                },
                "var_name": "minus0_arg",
                "node": "AssignmentNode",
                "lineno": 86,
                "colno": 2,
                "end_lineno": 86,
                "end_colno": 2
              },
              {
                "ifs": [
                  {
                    "condition": {
                      "object": {
                        "value": "ff",
                        "node": "IdNode",
                        "lineno": 87,
                        "colno": 5,
                        "end_lineno": 87,
                        "end_colno": 5
                      },
                      "args": {
                        "positional": [
                          {
                            "value": "minus0_arg",
                            "node": "IdNode",
                            "lineno": 87,
                            "colno": 28,
                            "end_lineno": 87,
                            "end_colno": 28
                          }
                        ],
                        "kwargs": [],
                        "node": "ArgumentNode",
                        "lineno": 87,
                        "colno": 38,
                        "end_lineno": 87,
                        "end_colno": 38
                      },
                      "name": "has_multi_arguments",
                      "node": "MethodNode",
                      "lineno": 87,
                      "colno": 8,
                      "end_lineno": 87,
                      "end_colno": 8
                    },
                    "block": {
                      "lines": [
                        {
                          "value": {
                            "value": "minus0_arg",
                            "node": "IdNode",
                            "lineno": 88,
                            "colno": 21,
                            "end_lineno": 88,
                            "end_colno": 21
                          },
                          "var_name": "_intel_fflags",
                          "node": "PlusAssignmentNode",
                          "lineno": 88,
                          "colno": 4,
                          "end_lineno": 88,
                          "end_colno": 4
                        }
                      ],
                      "node": "CodeBlockNode",
                      "lineno": 88,
                      "colno": 4,
                      "end_lineno": 88,
                      "end_colno": 4
                    },
                    "node": "IfNode",
                    "lineno": 87,
                    "colno": 8,
                    "end_lineno": 87,
                    "end_colno": 8
                  }
                ],
                "else": {
                  "node": "EmptyNode",
                  "lineno": 89,
                  "colno": 2,
                  "end_lineno": 89,
                  "end_colno": 2
                },
                "node": "IfClauseNode",
                "lineno": 87,
                "colno": 8,
                "end_lineno": 87,
                "end_colno": 8
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 85,
            "colno": 2,
            "end_lineno": 85,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 84,
          "colno": 6,
          "end_lineno": 84,
          "end_colno": 6
        },
        {
          "condition": {
            "left": {
              "object": {
                "value": "ff",
                "node": "IdNode",
                "lineno": 90,
                "colno": 5,
                "end_lineno": 90,
                "end_colno": 5
              },
              "args": {
                "positional": [],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 90,
                "colno": 15,
                "end_lineno": 90,
                "end_colno": 15
              },
              "name": "get_id",
              "node": "MethodNode",
              "lineno": 90,
              "colno": 8,
              "end_lineno": 90,
              "end_colno": 8
            },
            "right": {
              "value": "intel-cl",
              "node": "StringNode",
              "lineno": 90,
              "colno": 20,
              "end_lineno": 90,
              "end_colno": 20
            },
            "ctype": "==",
            "node": "ComparisonNode",
            "lineno": 90,
            "colno": 8,
            "end_lineno": 90,
            "end_colno": 8
          },
          "block": {
            "lines": [
              {
                "value": {
                  "object": {
                    "value": "ff",
                    "node": "IdNode",
                    "lineno": 93,
                    "colno": 18,
                    "end_lineno": 93,
                    "end_colno": 18
                  },
                  "args": {
                    "positional": [
                      {
                        "value": "/fp:strict",
                        "node": "StringNode",
                        "lineno": 94,
                        "colno": 4,
                        "end_lineno": 94,
                        "end_colno": 4
                      },
                      {
                        "value": "/MD",
                        "node": "StringNode",
                        "lineno": 94,
                        "colno": 18,
                        "end_lineno": 94,
                        "end_colno": 18
                      },
                      {
                        "value": "/names:lowercase",
                        "node": "StringNode",
                        "lineno": 94,
                        "colno": 25,
                        "end_lineno": 94,
                        "end_colno": 25
                      },
                      {
                        "value": "/assume:underscore",
                        "node": "StringNode",
                        "lineno": 94,
                        "colno": 45,
                        "end_lineno": 94,
                        "end_colno": 45
                      },
                      {
                        "value": "/assume:minus0",
                        "node": "StringNode",
                        "lineno": 95,
                        "colno": 4,
                        "end_lineno": 95,
                        "end_colno": 4
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 94,
                    "colno": 16,
                    "end_lineno": 94,
                    "end_colno": 16
                  },
                  "name": "get_supported_arguments",
                  "node": "MethodNode",
                  "lineno": 93,
                  "colno": 21,
                  "end_lineno": 93,
                  "end_colno": 21
                },
                "var_name": "_intel_fflags",
                "node": "AssignmentNode",
                "lineno": 93,
                "colno": 2,
                "end_lineno": 93,
                "end_colno": 2
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 91,
            "colno": 71,
            "end_lineno": 91,
            "end_colno": 71
          },
          "node": "IfNode",
          "lineno": 90,
          "colno": 8,
          "end_lineno": 90,
          "end_colno": 8
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 97,
        "colno": 0,
        "end_lineno": 97,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 84,
      "colno": 6,
      "end_lineno": 84,
      "end_colno": 6
    },
    {
      "args": {
        "positional": [
          {
            "value": "_intel_cflags",
            "node": "IdNode",
            "lineno": 98,
            "colno": 22,
            "end_lineno": 98,
            "end_colno": 22
          }
        ],
        "kwargs": [
          {
            "key": {
              "value": "language",
              "node": "IdNode",
              "lineno": 98,
              "colno": 37,
              "end_lineno": 98,
              "end_colno": 37
            },
            "val": {
              "args": {
                "positional": [
                  {
                    "value": "c",
                    "node": "StringNode",
                    "lineno": 98,
                    "colno": 48,
                    "end_lineno": 98,
                    "end_colno": 48
                  },
                  {
                    "value": "cpp",
                    "node": "StringNode",
                    "lineno": 98,
                    "colno": 53,
                    "end_lineno": 98,
                    "end_colno": 53
                  }
                ],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 98,
                "colno": 51,
                "end_lineno": 98,
                "end_colno": 51
              },
              "node": "ArrayNode",
              "lineno": 98,
              "colno": 47,
              "end_lineno": 98,
              "end_colno": 59
            }
          }
        ],
        "node": "ArgumentNode",
        "lineno": 98,
        "colno": 35,
        "end_lineno": 98,
        "end_colno": 35
      },
      "name": "add_project_arguments",
      "node": "FunctionNode",
      "lineno": 98,
      "colno": 0,
      "end_lineno": 98,
      "end_colno": 60
    },
    {
      "args": {
        "positional": [
          {
            "value": "_intel_fflags",
            "node": "IdNode",
            "lineno": 99,
            "colno": 22,
            "end_lineno": 99,
            "end_colno": 22
          }
        ],
        "kwargs": [
          {
            "key": {
              "value": "language",
              "node": "IdNode",
              "lineno": 99,
              "colno": 37,
              "end_lineno": 99,
              "end_colno": 37
            },
            "val": {
              "value": "fortran",
              "node": "StringNode",
              "lineno": 99,
              "colno": 47,
              "end_lineno": 99,
              "end_colno": 47
            }
          }
        ],
        "node": "ArgumentNode",
        "lineno": 99,
        "colno": 35,
        "end_lineno": 99,
        "end_colno": 35
      },
      "name": "add_project_arguments",
      "node": "FunctionNode",
      "lineno": 99,
      "colno": 0,
      "end_lineno": 99,
      "end_colno": 57
    },
    {
      "value": {
        "left": {
          "object": {
            "value": "meson",
            "node": "IdNode",
            "lineno": 106,
            "colno": 17,
            "end_lineno": 106,
            "end_colno": 17
          },
          "args": {
            "positional": [],
            "kwargs": [],
            "node": "ArgumentNode",
            "lineno": 106,
            "colno": 43,
            "end_lineno": 106,
            "end_colno": 43
          },
          "name": "project_source_root",
          "node": "MethodNode",
          "lineno": 106,
          "colno": 23,
          "end_lineno": 106,
          "end_colno": 23
        },
        "right": {
          "value": "scipy/_build_utils/link-version-pyinit.map",
          "node": "StringNode",
          "lineno": 106,
          "colno": 47,
          "end_lineno": 106,
          "end_colno": 47
        },
        "op": "/",
        "node": "ArithmeticNode",
        "lineno": 106,
        "colno": 23,
        "end_lineno": 106,
        "end_colno": 23
      },
      "var_name": "_linker_script",
      "node": "AssignmentNode",
      "lineno": 106,
      "colno": 0,
      "end_lineno": 106,
      "end_colno": 0
    },
    {
      "value": {
        "args": {
          "positional": [
            {
              "left": {
                "value": "-Wl,--version-script=",
                "node": "StringNode",
                "lineno": 107,
                "colno": 21,
                "end_lineno": 107,
                "end_colno": 21
              },
              "right": {
                "value": "_linker_script",
                "node": "IdNode",
                "lineno": 107,
                "colno": 47,
                "end_lineno": 107,
                "end_colno": 47
              },
              "op": "+",
              "node": "ArithmeticNode",
              "lineno": 107,
              "colno": 21,
              "end_lineno": 107,
              "end_colno": 21
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 107,
          "colno": 61,
          "end_lineno": 107,
          "end_colno": 61
        },
        "node": "ArrayNode",
        "lineno": 107,
        "colno": 20,
        "end_lineno": 107,
        "end_colno": 62
      },
      "var_name": "version_link_args",
      "node": "AssignmentNode",
      "lineno": 107,
      "colno": 0,
      "end_lineno": 107,
      "end_colno": 0
    },
    {
      "ifs": [
        {
          "condition": {
            "right": {
              "object": {
                "value": "cc",
                "node": "IdNode",
                "lineno": 111,
                "colno": 7,
                "end_lineno": 111,
                "end_colno": 7
              },
              "args": {
                "positional": [
                  {
                    "value": "",
                    "node": "StringNode",
                    "lineno": 111,
                    "colno": 16,
                    "end_lineno": 111,
                    "end_colno": 16
                  }
                ],
                "kwargs": [
                  {
                    "key": {
                      "value": "name",
                      "node": "IdNode",
                      "lineno": 111,
                      "colno": 20,
                      "end_lineno": 111,
                      "end_colno": 20
                    },
                    "val": {
                      "value": "-Wl,--version-script",
                      "node": "StringNode",
                      "lineno": 111,
                      "colno": 26,
                      "end_lineno": 111,
                      "end_colno": 26
                    }
                  },
                  {
                    "key": {
                      "value": "args",
                      "node": "IdNode",
                      "lineno": 111,
                      "colno": 50,
                      "end_lineno": 111,
                      "end_colno": 50
                    },
                    "val": {
                      "args": {
                        "positional": [
                          {
                            "value": "-shared",
                            "node": "StringNode",
                            "lineno": 111,
                            "colno": 57,
                            "end_lineno": 111,
                            "end_colno": 57
                          },
                          {
                            "value": "version_link_args",
                            "node": "IdNode",
                            "lineno": 111,
                            "colno": 68,
                            "end_lineno": 111,
                            "end_colno": 68
                          }
                        ],
                        "kwargs": [],
                        "node": "ArgumentNode",
                        "lineno": 111,
                        "colno": 66,
                        "end_lineno": 111,
                        "end_colno": 66
                      },
                      "node": "ArrayNode",
                      "lineno": 111,
                      "colno": 56,
                      "end_lineno": 111,
                      "end_colno": 86
                    }
                  }
                ],
                "node": "ArgumentNode",
                "lineno": 111,
                "colno": 18,
                "end_lineno": 111,
                "end_colno": 18
              },
              "name": "links",
              "node": "MethodNode",
              "lineno": 111,
              "colno": 10,
              "end_lineno": 111,
              "end_colno": 10
            },
            "node": "NotNode",
            "lineno": 111,
            "colno": 7,
            "end_lineno": 111,
            "end_colno": 7
          },
          "block": {
            "lines": [
              {
                "value": {
                  "args": {
                    "positional": [],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 112,
                    "colno": 23,
                    "end_lineno": 112,
                    "end_colno": 23
                  },
                  "node": "ArrayNode",
                  "lineno": 112,
                  "colno": 22,
                  "end_lineno": 112,
                  "end_colno": 24
                },
                "var_name": "version_link_args",
                "node": "AssignmentNode",
                "lineno": 112,
                "colno": 2,
                "end_lineno": 112,
                "end_colno": 2
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 112,
            "colno": 2,
            "end_lineno": 112,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 111,
          "colno": 7,
          "end_lineno": 111,
          "end_colno": 7
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 113,
        "colno": 0,
        "end_lineno": 113,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 111,
      "colno": 7,
      "end_lineno": 111,
      "end_colno": 7
    },
    {
      "value": {
        "args": {
          "positional": [
            {
              "object": {
                "object": {
                  "object": {
                    "value": "meson",
                    "node": "IdNode",
                    "lineno": 116,
                    "colno": 22,
                    "end_lineno": 116,
                    "end_colno": 22
                  },
                  "args": {
                    "positional": [
                      {
                        "value": "cython",
                        "node": "StringNode",
                        "lineno": 116,
                        "colno": 41,
                        "end_lineno": 116,
                        "end_colno": 41
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 116,
                    "colno": 49,
                    "end_lineno": 116,
                    "end_colno": 49
                  },
                  "name": "get_compiler",
                  "node": "MethodNode",
                  "lineno": 116,
                  "colno": 28,
                  "end_lineno": 116,
                  "end_colno": 28
                },
                "args": {
                  "positional": [],
                  "kwargs": [],
                  "node": "ArgumentNode",
                  "lineno": 116,
                  "colno": 61,
                  "end_lineno": 116,
                  "end_colno": 61
                },
                "name": "cmd_array",
                "node": "MethodNode",
                "lineno": 116,
                "colno": 51,
                "end_lineno": 116,
                "end_colno": 51
              },
              "index": {
                "value": 0,
                "node": "NumberNode",
                "lineno": 116,
                "colno": 63,
                "end_lineno": 116,
                "end_colno": 63
              },
              "node": "IndexNode",
              "lineno": 116,
              "colno": 51,
              "end_lineno": 116,
              "end_colno": 51
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 116,
          "colno": 65,
          "end_lineno": 116,
          "end_colno": 65
        },
        "name": "find_program",
        "node": "FunctionNode",
        "lineno": 116,
        "colno": 9,
        "end_lineno": 116,
        "end_colno": 66
      },
      "var_name": "cython",
      "node": "AssignmentNode",
      "lineno": 116,
      "colno": 0,
      "end_lineno": 116,
      "end_colno": 0
    },
    {
      "value": {
        "args": {
          "positional": [
            {
              "value": "tools/generate_f2pymod.py",
              "node": "StringNode",
              "lineno": 117,
              "colno": 25,
              "end_lineno": 117,
              "end_colno": 25
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 117,
          "colno": 52,
          "end_lineno": 117,
          "end_colno": 52
        },
        "name": "files",
        "node": "FunctionNode",
        "lineno": 117,
        "colno": 19,
        "end_lineno": 117,
        "end_colno": 53
      },
      "var_name": "generate_f2pymod",
      "node": "AssignmentNode",
      "lineno": 117,
      "colno": 0,
      "end_lineno": 117,
      "end_colno": 0
    },
    {
      "value": {
        "args": {
          "positional": [
            {
              "value": "scipy/_build_utils/tempita.py",
              "node": "StringNode",
              "lineno": 118,
              "colno": 16,
              "end_lineno": 118,
              "end_colno": 16
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 118,
          "colno": 47,
          "end_lineno": 118,
          "end_colno": 47
        },
        "name": "files",
        "node": "FunctionNode",
        "lineno": 118,
        "colno": 10,
        "end_lineno": 118,
        "end_colno": 48
      },
      "var_name": "tempita",
      "node": "AssignmentNode",
      "lineno": 118,
      "colno": 0,
      "end_lineno": 118,
      "end_colno": 0
    },
    {
      "value": {
        "args": {
          "positional": [
            {
              "value": "python",
              "node": "StringNode",
              "lineno": 121,
              "colno": 16,
              "end_lineno": 121,
              "end_colno": 16
            }
          ],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 121,
          "colno": 24,
          "end_lineno": 121,
          "end_colno": 24
        },
        "name": "import",
        "node": "FunctionNode",
        "lineno": 121,
        "colno": 9,
        "end_lineno": 121,
        "end_colno": 25
      },
      "var_name": "py_mod",
      "node": "AssignmentNode",
      "lineno": 121,
      "colno": 0,
      "end_lineno": 121,
      "end_colno": 0
    },
    {
      "value": {
        "object": {
          "value": "py_mod",
          "node": "IdNode",
          "lineno": 122,
          "colno": 6,
          "end_lineno": 122,
          "end_colno": 6
        },
        "args": {
          "positional": [],
          "kwargs": [
            {
              "key": {
                "value": "pure",
                "node": "IdNode",
                "lineno": 122,
                "colno": 31,
                "end_lineno": 122,
                "end_colno": 31
              },
              "val": {
                "value": false,
                "node": "BooleanNode",
                "lineno": 122,
                "colno": 37,
                "end_lineno": 122,
                "end_colno": 37
              }
            }
          ],
          "node": "ArgumentNode",
          "lineno": 122,
          "colno": 35,
          "end_lineno": 122,
          "end_colno": 35
        },
        "name": "find_installation",
        "node": "MethodNode",
        "lineno": 122,
        "colno": 13,
        "end_lineno": 122,
        "end_colno": 13
      },
      "var_name": "py3",
      "node": "AssignmentNode",
      "lineno": 122,
      "colno": 0,
      "end_lineno": 122,
      "end_colno": 0
    },
    {
      "value": {
        "object": {
          "value": "py3",
          "node": "IdNode",
          "lineno": 123,
          "colno": 10,
          "end_lineno": 123,
          "end_colno": 10
        },
        "args": {
          "positional": [],
          "kwargs": [],
          "node": "ArgumentNode",
          "lineno": 123,
          "colno": 25,
          "end_lineno": 123,
          "end_colno": 25
        },
        "name": "dependency",
        "node": "MethodNode",
        "lineno": 123,
        "colno": 14,
        "end_lineno": 123,
        "end_colno": 14
      },
      "var_name": "py3_dep",
      "node": "AssignmentNode",
      "lineno": 123,
      "colno": 0,
      "end_lineno": 123,
      "end_colno": 0
    },
    {
      "value": {
        "left": {
          "object": {
            "object": {
              "args": {
                "positional": [
                  {
                    "value": "py3",
                    "node": "IdNode",
                    "lineno": 127,
                    "colno": 26,
                    "end_lineno": 127,
                    "end_colno": 26
                  },
                  {
                    "args": {
                      "positional": [
                        {
                          "value": "-c",
                          "node": "StringNode",
                          "lineno": 129,
                          "colno": 4,
                          "end_lineno": 129,
                          "end_colno": 4
                        },
                        {
                          "value": "import os; print(os.environ.get(\"SCIPY_USE_PYTHRAN\", 1))",
                          "node": "StringNode",
                          "lineno": 130,
                          "colno": 4,
                          "end_lineno": 130,
                          "end_colno": 4
                        }
                      ],
                      "kwargs": [],
                      "node": "ArgumentNode",
                      "lineno": 129,
                      "colno": 8,
                      "end_lineno": 129,
                      "end_colno": 8
                    },
                    "node": "ArrayNode",
                    "lineno": 128,
                    "colno": 2,
                    "end_lineno": 131,
                    "end_colno": 3
                  }
                ],
                "kwargs": [
                  {
                    "key": {
                      "value": "check",
                      "node": "IdNode",
                      "lineno": 132,
                      "colno": 2,
                      "end_lineno": 132,
                      "end_colno": 2
                    },
                    "val": {
                      "value": true,
                      "node": "BooleanNode",
                      "lineno": 132,
                      "colno": 9,
                      "end_lineno": 132,
                      "end_colno": 9
                    }
                  }
                ],
                "node": "ArgumentNode",
                "lineno": 127,
                "colno": 29,
                "end_lineno": 127,
                "end_colno": 29
              },
              "name": "run_command",
              "node": "FunctionNode",
              "lineno": 127,
              "colno": 14,
              "end_lineno": 133,
              "end_colno": 1
            },
            "args": {
              "positional": [],
              "kwargs": [],
              "node": "ArgumentNode",
              "lineno": 133,
              "colno": 9,
              "end_lineno": 133,
              "end_colno": 9
            },
            "name": "stdout",
            "node": "MethodNode",
            "lineno": 133,
            "colno": 2,
            "end_lineno": 133,
            "end_colno": 2
          },
          "args": {
            "positional": [],
            "kwargs": [],
            "node": "ArgumentNode",
            "lineno": 133,
            "colno": 17,
            "end_lineno": 133,
            "end_colno": 17
          },
          "name": "strip",
          "node": "MethodNode",
          "lineno": 133,
          "colno": 11,
          "end_lineno": 133,
          "end_colno": 11
        },
        "right": {
          "value": "1",
          "node": "StringNode",
          "lineno": 133,
          "colno": 22,
          "end_lineno": 133,
          "end_colno": 22
        },
        "ctype": "==",
        "node": "ComparisonNode",
        "lineno": 133,
        "colno": 11,
        "end_lineno": 133,
        "end_colno": 11
      },
      "var_name": "use_pythran",
      "node": "AssignmentNode",
      "lineno": 127,
      "colno": 0,
      "end_lineno": 127,
      "end_colno": 0
    },
    {
      "ifs": [
        {
          "condition": {
            "value": "use_pythran",
            "node": "IdNode",
            "lineno": 134,
            "colno": 3,
            "end_lineno": 134,
            "end_colno": 3
          },
          "block": {
            "lines": [
              {
                "value": {
                  "args": {
                    "positional": [
                      {
                        "value": "pythran",
                        "node": "StringNode",
                        "lineno": 135,
                        "colno": 25,
                        "end_lineno": 135,
                        "end_colno": 25
                      }
                    ],
                    "kwargs": [],
                    "node": "ArgumentNode",
                    "lineno": 135,
                    "colno": 34,
                    "end_lineno": 135,
                    "end_colno": 34
                  },
                  "name": "find_program",
                  "node": "FunctionNode",
                  "lineno": 135,
                  "colno": 12,
                  "end_lineno": 135,
                  "end_colno": 35
                },
                "var_name": "pythran",
                "node": "AssignmentNode",
                "lineno": 135,
                "colno": 2,
                "end_lineno": 135,
                "end_colno": 2
              }
            ],
            "node": "CodeBlockNode",
            "lineno": 135,
            "colno": 2,
            "end_lineno": 135,
            "end_colno": 2
          },
          "node": "IfNode",
          "lineno": 134,
          "colno": 3,
          "end_lineno": 134,
          "end_colno": 3
        }
      ],
      "else": {
        "node": "EmptyNode",
        "lineno": 136,
        "colno": 0,
        "end_lineno": 136,
        "end_colno": 0
      },
      "node": "IfClauseNode",
      "lineno": 134,
      "colno": 3,
      "end_lineno": 134,
      "end_colno": 3
    },
    {
      "args": {
        "positional": [
          {
            "value": "scipy",
            "node": "StringNode",
            "lineno": 138,
            "colno": 7,
            "end_lineno": 138,
            "end_colno": 7
          }
        ],
        "kwargs": [],
        "node": "ArgumentNode",
        "lineno": 138,
        "colno": 14,
        "end_lineno": 138,
        "end_colno": 14
      },
      "name": "subdir",
      "node": "FunctionNode",
      "lineno": 138,
      "colno": 0,
      "end_lineno": 138,
      "end_colno": 15
    }
  ],
  "node": "CodeBlockNode",
  "lineno": 1,
  "colno": 0,
  "end_lineno": 1,
  "end_colno": 0
}

And sure enough, buried in the middle of that is:

          {
            "key": {
              "value": "default_options",
              "node": "IdNode",
              "lineno": 10,
              "colno": 2,
              "end_lineno": 10,
              "end_colno": 2
            },
            "val": {
              "args": {
                "positional": [
                  {
                    "value": "buildtype=debugoptimized",
                    "node": "StringNode",
                    "lineno": 11,
                    "colno": 4,
                    "end_lineno": 11,
                    "end_colno": 4
                  },
                  {
                    "value": "c_std=c99",
                    "node": "StringNode",
                    "lineno": 12,
                    "colno": 4,
                    "end_lineno": 12,
                    "end_colno": 4
                  },
                  {
                    "value": "cpp_std=c++14",
                    "node": "StringNode",
                    "lineno": 13,
                    "colno": 4,
                    "end_lineno": 13,
                    "end_colno": 4
                  },
                  {
                    "value": "fortran_std=legacy",
                    "node": "StringNode",
                    "lineno": 14,
                    "colno": 4,
                    "end_lineno": 14,
                    "end_colno": 4
                  },
                  {
                    "value": "blas=openblas",
                    "node": "StringNode",
                    "lineno": 15,
                    "colno": 4,
                    "end_lineno": 15,
                    "end_colno": 4
                  },
                  {
                    "value": "lapack=openblas",
                    "node": "StringNode",
                    "lineno": 16,
                    "colno": 4,
                    "end_lineno": 16,
                    "end_colno": 4
                  }
                ],
                "kwargs": [],
                "node": "ArgumentNode",
                "lineno": 11,
                "colno": 30,
                "end_lineno": 11,
                "end_colno": 30
              },
              "node": "ArrayNode",
              "lineno": 10,
              "colno": 19,
              "end_lineno": 17,
              "end_colno": 3
            }

@dnicolodi
Copy link
Member

What are the backward and forward compatibility guarantees for the Meson's AST? Anyhow, I don't think meson-python should get into this level of analysis of the Meson build definition. My preference would be to have b_ndebug documented in the meson-python documentation (along with the default debug and optimization overridden options). Second best, would be to add the option override but document it prominently in the meson-python documentation. The thing I don't like about setting the option from meson-python is that the meson-python default can be rectified only in pyproject.toml, introducing a second place other than meson.build where the build options are recorded.

@eli-schwartz
Copy link
Member

What are the backward and forward compatibility guarantees for the Meson's AST?

I don't know if there's a formal guarantee, but that code generally does not change even at the bugfix level. We probably do NOT want to change it, though, given that it's the output of a public CLI interface.

Another option would be to export that (which options were overridden from meson's own defaults) more thoroughly in the introspection json files, I guess...

Copy link
Member

@FFY00 FFY00 left a comment

Choose a reason for hiding this comment

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

I think this is fine, users can disable it right now by just overriding it later. IMO, we should try to optimize for most users, without being too opinionated.

I opened #329 though, regarding allowing users to disable the defaults.

@FFY00
Copy link
Member

FFY00 commented Mar 10, 2023

Okay, I'll merge this. We can reconsider if we get any user feedback.

IMO overall I think it does make sense that we set defaults different than Meson, because we are optimizing for different scenarios. While in most cases when Meson is used, it'd be by an end user building some project, not releasing, so it optimizes for that situation (eg. defaults the prefix to /usr/local), but our situation is a bit different, most of the time, when using Meson in meson-python, it will be to make releases, so it makes sense that we set the right defaults for that situation.

@FFY00 FFY00 merged commit fb1761b into mesonbuild:main Mar 10, 2023
@dnicolodi
Copy link
Member

Was any documentation written about this or the users are supposed to discover this starring at the build logs?

@FFY00
Copy link
Member

FFY00 commented Mar 10, 2023

It'll be included in the changelog, but we should add a page for the default options in the docs.

@rgommers
Copy link
Contributor Author

Yes, agreed - docs should be included with this PR. I will submit a follow-up PR with detailed explanation/guidance in the docs later today - the discussion here has helped clarify a few things.

rgommers added a commit to rgommers/meson-python that referenced this pull request Mar 10, 2023
This follows up on the `n_debug` default added in mesonbuildgh-325,
documents all other default options and they are used, as well
as improves the page on using `pyproject.toml` settings.
@rgommers rgommers deleted the ndebug-ifrelease branch March 10, 2023 18:47
rgommers added a commit to rgommers/meson-python that referenced this pull request Mar 12, 2023
This follows up on the `n_debug` default added in mesonbuildgh-325,
documents all other default options and they are used, as well
as improves the page on using `pyproject.toml` settings.
rgommers added a commit to rgommers/meson-python that referenced this pull request Mar 14, 2023
This follows up on the `n_debug` default added in mesonbuildgh-325,
documents all other default options and they are used, as well
as improves the page on using `pyproject.toml` settings.
rgommers added a commit to rgommers/meson-python that referenced this pull request Mar 21, 2023
This follows up on the `n_debug` default added in mesonbuildgh-325,
documents all other default options and they are used, as well
as improves the page on using `pyproject.toml` settings.
rgommers added a commit that referenced this pull request Mar 21, 2023
This follows up on the `n_debug` default added in gh-325,
documents all other default options and they are used, as well
as improves the page on using `pyproject.toml` settings.
@dnicolodi
Copy link
Member

NDEBUG is normally expected to be set for release builds, however for historical reasons Meson does not (yet) toggle NDEBUG for non-debug builds (which we already default to). So set this as the default. Choosing 'if-release' so that if users are explicitly asking for a debug build via config-settings, they don't see a change in behavior.

Unfortunately, as things are, I don't think that adding -Db_ndebug=if-release does what it was expected it to do. The default Meson build type is debug and that does not change when specifying -Ddebug=false as meson-python does. Therefore, the default meson-python build type is still debug, contrary to what it was assumed here. Therefore, the -Db_ndebug=if-release has any effect for meson-python packages only if the users specify a buildtype different from the default.

@rgommers
Copy link
Contributor Author

rgommers commented Apr 3, 2023

Hmm, I tested this by running

$ python -m build -nxw -Cbuilddir=builddir

and verifying that -DNDEBUG is present in builddir/build.ninja. It sounds like that somehow wasn't enough and -DNDEBUG is inserted some other way - I'll need to figure that one out later.

@dnicolodi
Copy link
Member

That works for a Meson projects that use a buildtype different from the default in their default_settings. The default buildtype is debug and setting debug=false does not change it.

@dnicolodi
Copy link
Member

@rgommers the test added in #379 demonstrates that -Db_ndebug=if-release works only whren -Dbuildtype=release is also specified.

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

Successfully merging this pull request may close these issues.

4 participants