Merge ~info-martin-konrad/epics-base:deprecation-warning-state-record into ~epics-core/epics-base/+git/epics-base:7.0

Proposed by Martin Konrad
Status: Merged
Approved by: Andrew Johnson
Approved revision: 94728eda0d62a777bd30417d0a728be896b6649a
Merge reported by: mdavidsaver
Merged at revision: 94728eda0d62a777bd30417d0a728be896b6649a
Proposed branch: ~info-martin-konrad/epics-base:deprecation-warning-state-record
Merge into: ~epics-core/epics-base/+git/epics-base:7.0
Diff against target: 58 lines (+21/-1)
2 files modified
documentation/RELEASE_NOTES.md (+6/-0)
modules/database/src/std/rec/stateRecord.c (+15/-1)
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+379159@code.launchpad.net

This proposal supersedes a proposal from 2020-01-31.

Description of the change

Rebased on 7.0.

To post a comment you must log in.
Revision history for this message
Andrew Johnson (anj) wrote : Posted in a previous version of this proposal

I would prefer that this go into the 7.0 branch; we aren't going to remove the state record from any 3.15 release and probably not from a 7.0 release, but I could see it going from 7.1. In any case it will need an entry in the Release Notes too.

Revision history for this message
Martin Konrad (info-martin-konrad) wrote : Posted in a previous version of this proposal

I have updated the message to say the record will be removed in 7.1 - these details might save users some research.

Note that according to https://github.com/epics-base/epics-base/blob/3.15/src/std/rec/stateRecord.dbd.pod this record is deprecated even in 3.15. As a 3.15 user I would appreciate a warning like this - rather than silently running into surprises after upgrading to 7.1. Let me know if you still prefer to merge this into the 7.0 branch.

Revision history for this message
Andrew Johnson (anj) wrote : Posted in a previous version of this proposal

That doc warning was only added at the Documentathon (last September, so not really "for a while") when we de-wikified the record reference docs, and it was more to scare people away from using the event record type in new databases than to actually flag that it was about to be deleted. I wouldn't have actually removed it until after lots of warning in the release notes. The disadvantage with putting this in 3.15 and the 3.15 release notes is that when they get merged up to 7.0 the release entries about 3.15 changes appear somewhere towards the middle of the release document, not at the top, so it will actually be less visible than if you were to make the change directly on the 7.0 branch.

Revision history for this message
Martin Konrad (info-martin-konrad) wrote :

I improved the formatting of the message as discussed during our code review earlier today.

Revision history for this message
Andrew Johnson (anj) wrote :

Group Review 2020-03-25: Approve.

review: Approve
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Cherry picked as fd5edce919ba5a24469faf28d3453086a3ac4df1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md
2index 2adeacf..4bd4297 100644
3--- a/documentation/RELEASE_NOTES.md
4+++ b/documentation/RELEASE_NOTES.md
5@@ -12,6 +12,12 @@ The external PVA submodules each have their own separate set of release notes
6 which should also be read to understand what has changed since an earlier
7 release.
8
9+### `state` record deprecated
10+
11+IOCs now emit a warning when a database file containing the `state` record is
12+loaded. This record has been deprecated for a while and will be removed
13+beginning with EPICS 7.1. Consider using the `stringin` record instead.
14+
15 ## EPICS Release 7.0.3.1
16
17 **IMPORTANT NOTE:** *Some record types in this release will not be compatible
18diff --git a/modules/database/src/std/rec/stateRecord.c b/modules/database/src/std/rec/stateRecord.c
19index fd5b9fb..78eee99 100644
20--- a/modules/database/src/std/rec/stateRecord.c
21+++ b/modules/database/src/std/rec/stateRecord.c
22@@ -28,6 +28,7 @@
23 #include "errMdef.h"
24 #include "recSup.h"
25 #include "recGbl.h"
26+#include "errlog.h"
27
28 #define GEN_SIZE_OFFSET
29 #include "stateRecord.h"
30@@ -37,7 +38,7 @@
31 /* Create RSET - Record Support Entry Table*/
32 #define report NULL
33 #define initialize NULL
34-#define init_record NULL
35+static long init_record(struct dbCommon *prec, int pass);
36 static long process(struct dbCommon *);
37 #define special NULL
38 #define get_value NULL
39@@ -77,6 +78,19 @@ epicsExportAddress(rset,stateRSET);
40
41 static void monitor(stateRecord *);
42
43
44+static long init_record(struct dbCommon *prec, int pass)
45+{
46+ if(pass == 0) {
47+ errlogPrintf(
48+ "WARNING: Using deprecated record type \"state\" for record "
49+ "\"%s\".\nThis record type will be removed beginning with EPICS "
50+ "7.1. Please replace it\nby a stringin record.\n",
51+ prec->name
52+ );
53+ }
54+ return 0;
55+}
56+
57 static long process(struct dbCommon *pcommon)
58 {
59 struct stateRecord *prec = (struct stateRecord *)pcommon;

Subscribers

People subscribed via source and target branches