forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compilers: Convert b_sanitize to a free form array option
There are a lot of sanitizers these days, and trying to keep up with them would be entirely too much work. Instead we'll do a compile check to see if the option is valid. An array makes more sense than a string, since users could just write `address,undefined` or they could write `undefined,address`. With the array we get to handle that ourselves and users writing code know that it's not safe to simply do a check like ```meson if get_option('b_sanitize') == 'address,undefined' ... endif ``` instead they need to do something like ```meson opt = get_option('b_sanitizers') if opt.contains('address') and opt.contains('undefined') ... endif ``` To ensure backwards compatibility, `get_option('b_sanitize')` is guaranteed to return a string with the values in the same order, unless a new value is added. Fixes mesonbuild#8283 Fixes mesonbuild#7761 Fixes mesonbuild#5154 Fixes mesonbuild#1582
- Loading branch information
Showing
16 changed files
with
150 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Changes to the b_sanitize option | ||
|
||
In meson <= 1.6 the b_sanitize option is a combo, which is an enumerated set of | ||
values. One picks one of the values as provided by that enumeration. In 1.6 | ||
this was changed to a free array of options, and a compiler check for the | ||
validity of those options. | ||
|
||
This solves a number of longstanding issues such as: | ||
- sanitizers may be supported by a compiler, but not on a specific platform (OpenBSD) | ||
- new sanitizers are not recognized by Meson | ||
- using sanitizers in different combinations | ||
|
||
In order to not break backwards compatibility, meson will continue to | ||
return `get_option('b_sanitize')` as a string, with a guarantee that | ||
`address,undefined` will remain ordered. Calling | ||
`get_option('b_sanitize', format : 2)` | ||
returns a free form list with no ordering guarantees. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.