Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646956 - sys-apps/baselayout-java: JAVAC env variable clashes with Android build system
Summary: sys-apps/baselayout-java: JAVAC env variable clashes with Android build system
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-08 07:29 UTC by John Einar Reitan
Modified: 2023-08-13 12:15 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,6.22 KB, text/plain)
2018-02-08 07:30 UTC, John Einar Reitan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Einar Reitan 2018-02-08 07:29:18 UTC
As /etc/profile.d/java-config-2.sh exports $JAVAC, the Android build system complains as it also tries to use it:

make -j80
============================================
PLATFORM_VERSION_CODENAME=P
PLATFORM_VERSION=P
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.14.15-gentoo-x86_64-Gentoo/Linux
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=OC-MR1
OUT_DIR=out
============================================
[1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
removed old ninja-created file out/soong/.bootstrap/docs/soong_build.html because it has no rule to generate it
[57/58] glob prebuilts/ndk/stl.bp
[75/75] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
out/build-aosp_arm-cleanspec.ninja is missing, regenerating...
out/soong/make_vars-aosp_arm.mk:545: warning: JAVAC does not match between Make and Soong:
out/soong/make_vars-aosp_arm.mk:545: warning: Make : /etc/java-config-2/current-system-vm/bin/javac
out/soong/make_vars-aosp_arm.mk:545: warning: Soong: prebuilts/jdk/jdk9/linux-x86/bin/javac
out/soong/make_vars-aosp_arm.mk:837: error: Soong variable check failed.
08:16:15 ckati failed with: exit status 1
make: *** [build/make/core/main.mk:21: run_soong_ui] Error 1


If I 'unset JAVAC' then the build succeeds.
Is JAVAC a standardizes env variable?
Or is it just a too overloaded variable across various systems (I've found plenty other build systems that set JAVAC) that Gentoo should try to avoid it?
Comment 1 John Einar Reitan 2018-02-08 07:30:19 UTC
Created attachment 518544 [details]
emerge --info
Comment 2 Xavier Miller 2023-01-15 16:45:46 UTC
the LEX environment variable is also problematic.

If I 

unset JAVAC
unset JAVA_HOME
unset JDK_HOME
unset LEX


the build scripts run fine
Comment 3 John Einar Reitan 2023-01-16 19:25:26 UTC
Guess Gentoo should have established a common prefix to avoid such clashes.
Comment 4 unlord 2023-02-18 18:41:34 UTC
JAVAC is now unset by soong upstream:

https://android.googlesource.com/platform/build/soong/+/7b067fb75

Please confirm this fixes the issue for you.
Comment 5 Gabriel Marcano 2023-04-12 17:56:07 UTC
This does not fix the issue for me alone, as I also have to unset LEX for the build process to continue.
Comment 6 yongxiang 2023-08-13 12:15:03 UTC
(In reply to Xavier Miller from comment #2)
> the LEX environment variable is also problematic.
> 
> If I 
> 
> unset JAVAC
> unset JAVA_HOME
> unset JDK_HOME
> unset LEX
> 
> 
> the build scripts run fine

I tried to compile LineageOS 20.0 and had a similar problem. This solution worked for me