Bug 24493 – FreeBSD_14 version identifier missing

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
FreeBSD
Creation time
2024-04-09T17:35:01Z
Last change time
2024-04-18T11:40:27Z
Keywords
pull
Assigned to
No Owner
Creator
Jonathan M Davis

Comments

Comment #0 by issues.dlang — 2024-04-09T17:35:01Z
On FreeBSD 14, this program --- void main() { version (FreeBSD_14) pragma(msg, "14"); else version (FreeBSD_13) pragma(msg, "13"); else version (FreeBSD_12) pragma(msg, "12"); else version (FreeBSD_11) pragma(msg, "11"); else version (FreeBSD_10) pragma(msg, "10"); else version (FreeBSD_9) pragma(msg, "9"); else version (FreeBSD_8) pragma(msg, "8"); else static assert(false, "Unsupported version of FreeBSD"); } --- prints out 11, so FreeBSD_14 is not being defined correctly. Presumably, it just hasn't been added yet.
Comment #1 by dlang-bot — 2024-04-09T21:43:46Z
@jmdavis created dlang/dmd pull request #16368 "Fix bugzilla issue 24493: FreeBSD_14 version identifier missing" fixing this issue: - Fix bugzilla issue 24493: FreeBSD_14 version identifier missing Apparently, there were two problems that needed fixing. 1. The code for the FreeBSD_14 version identifier had not been added yet. 2. The build did nothing to detect the version of FreeBSD, which makes it very easy to build for the wrong version. The CI apparently sets the version - e.g. TARGET_FREEBSD13 - but unless one of those TARGET_FREEBSD* versions is set, the build defaults to FreeBSD 11, which isn't even supported any longer. So, this adds the code for the FreeBSD_14 identifier, and it makes it so that the build queries the OS version on FreeBSD if TARGET_FREEBSD* has not been set. So, anything that sets the TARGET_FREEBSD* version when building will control the target version as before, but if it's not set, then it will target whatever the current system is. https://github.com/dlang/dmd/pull/16368
Comment #2 by dlang-bot — 2024-04-18T11:40:27Z
dlang/dmd pull request #16368 "Fix bugzilla issue 24493: FreeBSD_14 version identifier missing" was merged into master: - b7b6a11a08a63ec5cbf42ad73411b69e712c39f4 by Jonathan M Davis: Fix bugzilla issue 24493: FreeBSD_14 version identifier missing Apparently, there were two problems that needed fixing. 1. The code for the FreeBSD_14 version identifier had not been added yet. 2. The build did nothing to detect the version of FreeBSD, which makes it very easy to build for the wrong version. The CI apparently sets the version - e.g. TARGET_FREEBSD13 - but unless one of those TARGET_FREEBSD* versions is set, the build defaults to FreeBSD 11, which isn't even supported any longer. So, this adds the code for the FreeBSD_14 identifier, and it makes it so that the build queries the OS version on FreeBSD if TARGET_FREEBSD* has not been set. So, anything that sets the TARGET_FREEBSD* version when building will control the target version as before, but if it's not set, then it will target whatever the current system is. https://github.com/dlang/dmd/pull/16368