From 08eaea64d20d09fc92ec66ee02568bb9368a7cd7 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sat, 27 Feb 2021 16:45:12 -0600 Subject: [PATCH] Fix up comments & messages, add Release Notes --- documentation/RELEASE_NOTES.md | 14 ++++++++++++++ modules/database/src/tools/DBD/Parser.pm | 4 ++-- .../src/tools/registerRecordDeviceDriver.pl | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index eb9ba33fa..d7f0656fa 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -18,6 +18,20 @@ should also be read to understand what has changed since earlier releases. +### Prevent default DTYPs from changing + +[Kay Kasemir reported](https://bugs.launchpad.net/epics-base/+bug/1908305) that +it is possible to change the Base record type's default DTYP if a `device()` +entry is seen before the `recordtype()` definition to which it refers. The +default DTYP is the first device loaded, which is normally the `Soft Channel` +support from Base. A warning was being displayed by dbdExpand when a `device()` +entry was see first, but that was easily missed. + +The DBD file parser in dbdExpand.pl has now been modified to make this an error, +although the registerRecordDeviceDriver.pl script will still accept `device()` +entries without having their `recordtype()` loaded since this is necessary to +compile device supports as loadable modules. + ### Priority inversion safe posix mutexes diff --git a/modules/database/src/tools/DBD/Parser.pm b/modules/database/src/tools/DBD/Parser.pm index cb046e062..b4cef4781 100644 --- a/modules/database/src/tools/DBD/Parser.pm +++ b/modules/database/src/tools/DBD/Parser.pm @@ -103,8 +103,8 @@ sub ParseDBD { unquote($1, $2, $3, $4); my $rtyp = $dbd->recordtype($record_type); if (!defined $rtyp) { - my $msg = "Device '$choice' defined for unknown record type '$record_type'."; - dieContext($msg, "DBD files must be added in the correct order.") + my $msg = "Device '$choice' refers to unknown record type '$record_type'."; + dieContext($msg, "DBD files must be combined in the correct order.") unless $allowAutoDeclarations; warn "$msg\nRecord type '$record_type' declared.\n"; $rtyp = DBD::Recordtype->new($record_type); diff --git a/modules/database/src/tools/registerRecordDeviceDriver.pl b/modules/database/src/tools/registerRecordDeviceDriver.pl index 8d6bcd1ea..49354fbd7 100644 --- a/modules/database/src/tools/registerRecordDeviceDriver.pl +++ b/modules/database/src/tools/registerRecordDeviceDriver.pl @@ -31,7 +31,7 @@ my @path = map { split /[:;]/ } @opt_I; # FIXME: Broken on Win32? my ($file, $subname, $bldTop) = @ARGV; -# Permit auto-declaration of record types for building runtime-loadable modules +# Auto-declaration of record types is needed to build loadable modules $DBD::Parser::allowAutoDeclarations = 1; my $dbd = DBD->new();