Treatment of envars lazarus / 64-FPC development ---------------------------------------------------------------------- TRon · 2024-03-10 01:46 Has something changed with regards to the treatment of environmental variables wrt the compiler configuration file ? I make use of them icw the compiler option -va to verify a compiler config file but alas, using that mechanism on trunk failed as the output of -va would not substitute the environment variables (anymore). I failed to have noticed mention of this in the user changes. I did see there were some commits in trunk (around half a year ago or so) with regards to envar substitution so wondered if perhaps something has gone wrong there, the changed behaviour wasn't mentioned or if maybe something else is at play here ? Linux x86_64 trunk from today TIA ---------------------------------------------------------------------- PascalDragon · 2024-03-12 21:36 Quote from: TRon on March 10, 2024, 02:46:55 amI make use of them icw the compiler option -va to verify a compiler config file but alas, using that mechanism on trunk failed as the output of -va would not substitute the environment variables (anymore). Please provide an example. ---------------------------------------------------------------------- Thaddy · 2024-03-12 22:00 There is already a related example on the bug tracker. I will add a more general example tomorrow. (It is not related to FB) ---------------------------------------------------------------------- TRon · 2024-03-13 00:06 Quote from: PascalDragon on March 12, 2024, 10:36:50 pmPlease provide an example. create configuration file example.cfg with contents: Code: [Select]-FD$some_environment_variable$/x/y/z on the command-line enter: Code: [Select]export some_environment_variable="hello_world" invoke the compiler using the custom example.cfg file, e.g: Code: [Select]home/apps/fpc/3.2.2/bin/x86_64-linux/fpc -va -n @example.cfg and home/apps/fpc/3.3.1/bin/x86_64-linux/fpc -va -n @example.cfg output from 3.2.2: Code: [Select][0.001] Handling option "-n" [0.001] interpreting firstpass option "-n" [0.001] Macro defined: LINUX [0.001] Macro defined: UNIX [0.001] Macro defined: HASUNIX [0.001] Macro defined: FPC_HAS_WINLIKERESOURCES [0.001] Macro defined: CONSOLE [0.001] Macro defined: LINUX [0.001] Macro defined: FPC [0.002] Macro defined: VER3 [0.002] Macro defined: VER3_2 [0.002] Macro defined: VER3_2_2 [0.002] Macro defined: FPC_HAS_OPERATOR_ENUMERATOR [0.002] Macro defined: FPC_HAS_CONSTREF [0.002] Macro defined: FPC_STATICRIPFIXED [0.002] Macro defined: FPC_VARIANTCOPY_FIXED [0.002] Macro defined: FPC_DYNARRAYCOPY_FIXED [0.002] Macro defined: FPC_HAS_MEMBAR [0.002] Macro defined: FPC_SETBASE_USED [0.002] Macro defined: FPC_HAS_FEATURE_SUPPORT [0.002] Macro defined: CPUATHLON64 [0.002] Macro defined: FPUSSE64 [0.002] Macro defined: FPC_ABI_DEFAULT [0.002] Macro defined: CPUX86_64 [0.002] Macro defined: CPUAMD64 [0.002] Macro defined: CPU64 [0.002] Macro defined: CPUX64 [0.002] Macro defined: CPUINT64 [0.002] Macro defined: FPC_HAS_INTERNAL_ABS_LONG [0.002] Macro defined: FPC_HAS_INTERNAL_ABS_INT64 [0.002] Macro defined: FPC_HAS_UNICODESTRING [0.002] Macro defined: FPC_RTTI_PACKSET1 [0.002] Macro defined: FPC_HAS_CPSTRING [0.002] Macro defined: FPC_HAS_RIP_RELATIVE [0.002] Macro defined: FPC_HAS_CEXTENDED [0.002] Macro defined: FPC_HAS_RESSTRINITS [0.002] Macro defined: FPC_HAS_INTERNAL_ROX [0.002] Macro defined: FPC_HAS_INTERNAL_SAR [0.002] Macro defined: INTERNAL_BACKTRACE [0.002] Macro defined: STR_CONCAT_PROCS [0.002] Macro defined: REGCALL [0.002] Handling option "-va" [0.002] interpreting option "-va" [0.002] Handling option "-n" [0.002] interpreting option "-n" [0.002] Reading further options from example.cfg [0.002] Reading options from file example.cfg [0.002] Hint: Start of reading config file example.cfg [0.002] Handling option "-FDhello_world/x/y/z" [0.002] interpreting option "-FDhello_world/x/y/z" [0.002] Hint: End of reading config file example.cfg [0.002] Macro defined: ENDIAN_LITTLE [0.003] Macro defined: FPC_LITTLE_ENDIAN [0.003] Fatal: No source file name in command line [0.003] Fatal: Compilation aborted Error: /home/apps/fpc/3.2.2/bin/x86_64-linux/ppcx64 returned an error exitcode output from 3.3.1 (a0a57868c04981150584e046e7d075a0f120af72): Code: [Select][0.001] Handling option "-n" [0.001] Interpreting firstpass option "-n" [0.001] Macro defined: LINUX [0.001] Macro defined: UNIX [0.001] Macro defined: HASUNIX [0.001] Macro defined: FPC_HAS_WINLIKERESOURCES [0.001] Macro defined: CONSOLE [0.001] Macro defined: LINUX [0.001] Macro defined: FPC [0.001] Macro defined: VER3 [0.001] Macro defined: VER3_3 [0.001] Macro defined: VER3_3_1 [0.001] Macro defined: FPC_HAS_OPERATOR_ENUMERATOR [0.001] Macro defined: FPC_HAS_CONSTREF [0.001] Macro defined: FPC_STATICRIPFIXED [0.001] Macro defined: FPC_VARIANTCOPY_FIXED [0.001] Macro defined: FPC_DYNARRAYCOPY_FIXED [0.001] Macro defined: FPC_HAS_MEMBAR [0.001] Macro defined: FPC_SETBASE_USED [0.001] Macro defined: FPC_ALIGNED_THREADVARTABLES [0.001] Macro defined: FPC_HAS_FEATURE_SUPPORT [0.002] Macro defined: CPUX86-64-V1 [0.002] Macro defined: FPUSSE64 [0.002] Macro defined: FPC_ABI_DEFAULT [0.002] Macro defined: CPUX86_64 [0.002] Macro defined: CPUAMD64 [0.002] Macro defined: CPU64 [0.002] Macro defined: CPUX64 [0.002] Macro defined: CPUINT64 [0.002] Macro defined: FPC_HAS_INTERNAL_ABS_LONG [0.002] Macro defined: FPC_HAS_INTERNAL_ABS_INT64 [0.002] Macro defined: FPC_HAS_UNICODESTRING [0.002] Macro defined: FPC_RTTI_PACKSET1 [0.002] Macro defined: FPC_HAS_CPSTRING [0.002] Macro defined: FPC_HAS_RIP_RELATIVE [0.002] Macro defined: FPC_HAS_CEXTENDED [0.002] Macro defined: FPC_HAS_RESSTRINITS [0.002] Macro defined: FPC_HAS_INTERNAL_ROX [0.002] Macro defined: FPC_HAS_ANSICHAR_CHAR [0.002] Macro defined: FPC_HAS_INTERNAL_SAR [0.002] Macro defined: INTERNAL_BACKTRACE [0.002] Macro defined: STR_CONCAT_PROCS [0.002] Macro defined: REGCALL [0.002] Macro defined: ENDIAN_LITTLE [0.002] Macro defined: FPC_LITTLE_ENDIAN [0.002] Handling option "-va" [0.002] Interpreting option "-va" [0.002] Handling option "-n" [0.002] Interpreting option "-n" [0.002] Reading further options from example.cfg [0.002] Reading options from file example.cfg [0.002] Hint: Start of reading config file example.cfg [0.002] Handling option "-FD$some_environment_variable$/x/y/z" [0.002] Interpreting option "-FD$some_environment_variable$/x/y/z" [0.002] Hint: End of reading config file example.cfg [0.002] Fatal: No source file name in command line [0.002] Fatal: Compilation aborted Error: /home/apps/fpc/3.3.1/bin/x86_64-linux/ppcx64 returned an error exitcode I assume that this commit is reason for it ? Also note that during compilation the messages (searching for units etc) sometimes also appear unsubstituted and does not seem to "find" the actual directory. But that does not seem to be consistent e.g. normal/simple compilation seem to work as intended. Unfortunately I have been unable to find a persistent trigger. I have tried ZoltanLeo's mentioned working revision (ed8a05d6) which for me did not change the behaviour as described in this post which lead me to believe there are at least two separate issues. TIA