PR# 19471 ECF redirection with location containing an undefined environment variable
Problem Report Summary
Submitter: gobobe
Category: Compiler
Priority: Medium
Date: 2018/10/09
Class: Bug
Severity: Non-critical
Number: 19471
Release: 18.07
Confidential: No
Status: Closed
Responsible:
Environment: win
Synopsis: ECF redirection with location containing an undefined environment variable
Description
When I have the following: <library name="free_elks" location="$GOBO/library/free_elks/library_${GOBO_EIFFEL}.ecf"/> and the variable ${GOBO_EIFFEL} is not defined (or is defined as an empty string), it will correctly read the file library_.ecf. But when the same location appears in an ECF redirection file, the compiler will complain: ------------------------------------------------------------------------------- Error code: VD00 General configuration parsing error. What to do: fix the configuration file. Could not open file: C:\gobo\library\free_elks\library_${GOBO_EIFFEL}.ecf -------------------------------------------------------------------------------
To Reproduce
Problem Report Interactions
> By curiosity, do you rely on an undefined variable to be resolved as an empty string? Yes. If $GOBO_EIFFEL is defined to 'ge', I know that the underlying compiler is gec. If it's not defined, then I know that it's estudio. Please no warning. If the value is undefined and you are not prepared for that, you will sooner than later be told by the compiler that your path (with the environment variable replaced by an empty string) does not exist. This has worked like that for years in the location of <library>. -- Eric Bezault
Fixed by rev#102307 (for now, no warning, but we may think about it in the future.)
To be consistent with other behavior of Eiffel configuration file, we will adopt same logic for redirection. We may try to report a warning, as often when a variable is undefined, this is an environment error (user forgetting to set such variable). By curiosity, do you rely on an undefined variable to be resolved as an empty string? Probably, this is to handle default value and be flexible, am I right?