Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
workflow_dispatch:

env:
FORM_IGNORE_DEPRECATION: 1

jobs:
# Generate the tarball distribution, e.g., "form-v4.2.1.tar.gz" for v4.2.1.
# The tarball will be tested in the following "build-bin" job.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
workflow_dispatch:

env:
FORM_IGNORE_DEPRECATION: 1

jobs:
# Simple tests on Linux; except the ParFORM case, they probably pass unless
# the committer has forgotten running "make check".
Expand Down
3 changes: 3 additions & 0 deletions sources/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ static void print_M()
MesPrint("%d", AM.ggShortStatsMax);
MesPrint("--MARK 11");
MesPrint("%d", AM.FromStdin);
MesPrint("%d", AM.IgnoreDeprecation);
MesPrint("%%%% END M_const");
/* fflush(0); */
}
Expand Down Expand Up @@ -1503,6 +1504,7 @@ int DoRecovery(int *moduletype)
R_COPY_S(AM.Path,UBYTE *);

R_SET(AM.FromStdin, BOOL);
R_SET(AM.IgnoreDeprecation, BOOL);

#ifdef PRINTDEBUG
print_M();
Expand Down Expand Up @@ -2574,6 +2576,7 @@ static int DoSnapshot(int moduletype)
S_WRITE_S(AM.Path);

S_WRITE_B(&AM.FromStdin,sizeof(BOOL));
S_WRITE_B(&AM.IgnoreDeprecation,sizeof(BOOL));

/*#] AM :*/
/*#[ AC :*/
Expand Down
2 changes: 2 additions & 0 deletions sources/compcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ int CoOff(UBYTE *s)
AR.gzipCompress = 0;
}
else if ( StrICont(t,(UBYTE *)"checkpoint") == 0 ) {
PrintDeprecation("the checkpoint mechanism", "issues/626");
AC.CheckpointInterval = 0;
if ( AC.CheckpointRunBefore ) { free(AC.CheckpointRunBefore); AC.CheckpointRunBefore = NULL; }
if ( AC.CheckpointRunAfter ) { free(AC.CheckpointRunAfter); AC.CheckpointRunAfter = NULL; }
Expand Down Expand Up @@ -706,6 +707,7 @@ int CoOn(UBYTE *s)
}
}
else if ( StrICont(t,(UBYTE *)"checkpoint") == 0 ) {
PrintDeprecation("the checkpoint mechanism", "issues/626");
AC.CheckpointInterval = 0;
if ( AC.CheckpointRunBefore ) { free(AC.CheckpointRunBefore); AC.CheckpointRunBefore = NULL; }
if ( AC.CheckpointRunAfter ) { free(AC.CheckpointRunAfter); AC.CheckpointRunAfter = NULL; }
Expand Down
1 change: 1 addition & 0 deletions sources/declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ extern WORD Processor(VOID);
extern WORD Product(UWORD *,WORD *,WORD);
extern VOID PrtLong(UWORD *,WORD,UBYTE *);
extern VOID PrtTerms(VOID);
extern void PrintDeprecation(const char *,const char *);
extern VOID PrintRunningTime(VOID);
extern LONG GetRunningTime(VOID);
extern WORD PutBracket(PHEAD WORD *);
Expand Down
55 changes: 53 additions & 2 deletions sources/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ static void PrintHeader(int with_full_info)
AC.LineLength = oldLineLength;
}
}
#ifdef WINDOWS
PrintDeprecation("the native Windows version", "issues/623");
#endif
#ifdef ILP32
PrintDeprecation("the 32-bit version", "issues/624");
#endif
#ifdef WITHMPI
PrintDeprecation("the MPI version (ParFORM)", "issues/625");
#endif
if ( AC.CheckpointFlag ) {
PrintDeprecation("the checkpoint mechanism", "issues/626");
}
}

/*
Expand Down Expand Up @@ -261,9 +273,17 @@ int DoTail(int argc, UBYTE **argv)
AM.FileOnlyFlag = 1; AM.LogType = 1; break;
case 'h': /* For old systems: wait for key before exit */
AM.HoldFlag = 1; break;
case 'i':
if ( StrCmp(s, (UBYTE *)"ignore-deprecation") == 0 ) {
AM.IgnoreDeprecation = 1;
break;
}
#ifdef WITHINTERACTION
case 'i': /* Interactive session (not used yet) */
AM.Interact = 1; break;
/* Interactive session (not used yet) */
AM.Interact = 1;
break;
#else
goto IllegalOption;
#endif
case 'I': /* Next arg is dir for inc/prc/sub files */
TAKEPATH(AM.IncDir) break;
Expand Down Expand Up @@ -426,6 +446,7 @@ printversion:;
}
}
else {
IllegalOption:
#ifdef WITHMPI
if ( PF.me == MASTER )
#endif
Expand Down Expand Up @@ -1890,6 +1911,36 @@ VOID Terminate(int errorcode)

/*
#] Terminate :
#[ PrintDeprecation :
*/

/**
* Prints a deprecation warning for a given feature.
*
* @param feature The name of the deprecated feature.
* @param issue The associated issue, e.g., "issues/700".
*/
void PrintDeprecation(const char *feature, const char *issue) {
#ifdef WITHMPI
if ( PF.me != MASTER ) return;
#endif
if ( AM.IgnoreDeprecation ) return;

UBYTE *e = (UBYTE *)getenv("FORM_IGNORE_DEPRECATION");
if ( e && e[0] && StrCmp(e, (UBYTE *)"0") && StrICmp(e, (UBYTE *)"false") && StrICmp(e, (UBYTE *)"no") ) return;

MesPrint("DeprecationWarning: We are considering deprecating %s.", feature);
MesPrint("If you want this support to continue, leave a comment at:");
MesPrint("");
MesPrint(" https://github.com/vermaseren/form/%s", issue);
MesPrint("");
MesPrint("Otherwise, it will be discontinued in the future.");
MesPrint("To suppress this warning, use the -ignore-deprecation command line option or");
MesPrint("set the environment variable FORM_IGNORE_DEPRECATION=1.");
}

/*
#] PrintDeprecation :
#[ PrintRunningTime :
*/

Expand Down
3 changes: 2 additions & 1 deletion sources/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1600,11 +1600,12 @@ struct M_const {
WORD numpi;
WORD BracketFactors[8];
BOOL FromStdin; /* read the input from STDIN */
BOOL IgnoreDeprecation; /* ignore deprecation warning */
#ifdef WITHFLOAT
#ifdef WITHPTHREADS
PADPOSITION(17,30,62,84,(sizeof(pthread_rwlock_t)+sizeof(pthread_mutex_t)*2)+1);
#else
PADPOSITION(17,28,62,84,1);
PADPOSITION(17,28,62,84,2);
#endif
#else
#ifdef WITHPTHREADS
Expand Down
Loading