RFR: 8300099: Configuration fails to auto-detect build user through $USER in dockers

Magnus Ihse Bursie ihse at openjdk.org
Fri Jan 13 13:26:30 UTC 2023


On Fri, 13 Jan 2023 04:10:16 GMT, Jie Fu <jiefu at openjdk.org> wrote:

> Hi all,
> 
> Configuration is broken in dockers after JDK-8296478.
> This is because `$USER` is not defined in dockers [1].
> 
> The fix will check `whoami` if we get an empty `$USERNAME`.
> 
> Thanks.
> Best regards,
> Jie
> 
> [1] https://stackoverflow.com/questions/54411218/docker-why-isnt-user-environment-variable-set

The code changes itself look good.

What happens if you don't have whoami or if you have it and that fails as well? 

Hm. Looking at the code, it seems that `UTIL_CHECK_STRING_NON_EMPTY` should catch that. Can you verify that this is indeed the case? To be clear: If you are missing both $USER and `whoami`, and are not explicitly setting a user name, configure should fail. But if you are missing this and are using `--with-build-user`, then it succeeds.

-------------

Marked as reviewed by ihse (Reviewer).

PR: https://git.openjdk.org/jdk/pull/11983



More information about the build-dev mailing list