Open Bug 974060 Opened 10 years ago Updated 2 years ago

Error out when accessing non-existing keys from sandbox dictionary variables

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect

Tracking

(Not tracked)

People

(Reporter: ehsan.akhgari, Unassigned)

Details

Using CONFIG['VARIABLE_WHICH_DOESNT_EXIST'] should fail the build.  See bug 973143 comment 13 for an example of what this can prevent.
The reason we don't do this is because not every variable is defined in every build configuration.

To fix this, we'll need to add missing AC_SUBST() to configure.in and support .m4 files.

A good first step would be to emit a warning when an unknown variable is accessed. We should be able to iteratively ratchet this down until it passed on automation. Even then, I fear we'll have a long-tail of one-offs in local configurations. Auditing 10,000+ lines of m4 ain't exactly my idea of fun.
A lesser reason is this matches the behavior of make.

Everyone agrees that in the ideal world configuration variables are well-defined. Nobody has wanted to invest the effort into fixing this.
AC_SUBST is unconditional. That is, something like this in configure.in:
  if foo; then
     AC_SUBST(bar)
  fi

*always* makes bar appear as a CONFIG variable.
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.