This reverts commit 9db293492bbbc5b8d70638bd9c59dea19d13596c. It's not OK to call `realpath` in the compiler. Reopens #12419