Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JAVA config setting #15055

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion ChangeLog.md
Expand Up @@ -20,8 +20,12 @@ See docs/process.md for more on how version tagging works.

2.0.31
------
2.0.30
- The `JAVA` config settings has been removed. Today, java is not be needed
except in the rare case of using closure-compiler on a plaform where not native
version of closure-compiler is available. In this case, simply having `java`
available in the `PATH` should be sufficient.

2.0.30
------
- Bug fixes

Expand Down
13 changes: 2 additions & 11 deletions tools/building.py
Expand Up @@ -710,22 +710,12 @@ def closure_compiler(filename, pretty, advanced=True, extra_closure_args=None):
if extra_closure_args:
user_args += extra_closure_args

# Closure compiler expects JAVA_HOME to be set *and* java.exe to be in the PATH in order
# to enable use the java backend. Without this it will only try the native and JavaScript
# versions of the compiler.
java_bin = os.path.dirname(config.JAVA)
if java_bin:
def add_to_path(dirname):
env['PATH'] = env['PATH'] + os.pathsep + dirname
add_to_path(java_bin)
java_home = os.path.dirname(java_bin)
env.setdefault('JAVA_HOME', java_home)

closure_cmd = get_closure_compiler()

native_closure_compiler_works = check_closure_compiler(closure_cmd, user_args, env, allowed_to_fail=True)
if not native_closure_compiler_works and not any(a.startswith('--platform') for a in user_args):
# Run with Java Closure compiler as a fallback if the native version does not work
diagnostics.warning('closure-compiler', 'Failed to run native closure compiler. Falling back to Java version')
user_args.append('--platform=java')
check_closure_compiler(closure_cmd, user_args, env, allowed_to_fail=False)

Expand Down Expand Up @@ -819,6 +809,7 @@ def move_to_safe_7bit_ascii_filename(filename):
# 7-bit ASCII range. Therefore make sure the command line we pass does not contain any such
# input files by passing all input filenames relative to the cwd. (user temp directory might
# be in user's home directory, and user's profile name might contain unicode characters)
shared.print_compiler_stage(cmd)
proc = run_process(cmd, stderr=PIPE, check=False, env=env, cwd=tempfiles.tmpdir)

# XXX Closure bug: if Closure is invoked with --create_source_map, Closure should create a
Expand Down
8 changes: 1 addition & 7 deletions tools/config.py
Expand Up @@ -25,7 +25,6 @@
LLVM_ADD_VERSION = None
CLANG_ADD_VERSION = None
CLOSURE_COMPILER = None
JAVA = None
JS_ENGINE = None
JS_ENGINES = None
WASMER = None
Expand Down Expand Up @@ -56,7 +55,7 @@ def root_is_writable():


def normalize_config_settings():
global CACHE, PORTS, JAVA, LLVM_ADD_VERSION, CLANG_ADD_VERSION, CLOSURE_COMPILER
global CACHE, PORTS, LLVM_ADD_VERSION, CLANG_ADD_VERSION, CLOSURE_COMPILER
global NODE_JS, V8_ENGINE, JS_ENGINE, JS_ENGINES, SPIDERMONKEY_ENGINE, WASM_ENGINES

# EM_CONFIG stuff
Expand Down Expand Up @@ -91,10 +90,6 @@ def normalize_config_settings():
if not PORTS:
PORTS = os.path.join(CACHE, 'ports')

if JAVA is None:
logger.debug('JAVA not defined in ' + EM_CONFIG + ', using "java"')
JAVA = 'java'

# Tools/paths
if LLVM_ADD_VERSION is None:
LLVM_ADD_VERSION = os.getenv('LLVM_ADD_VERSION')
Expand Down Expand Up @@ -124,7 +119,6 @@ def parse_config_file():
'LLVM_ADD_VERSION',
'CLANG_ADD_VERSION',
'CLOSURE_COMPILER',
'JAVA',
'JS_ENGINE',
'JS_ENGINES',
'WASMER',
Expand Down
2 changes: 0 additions & 2 deletions tools/settings_template.py
Expand Up @@ -23,8 +23,6 @@
# This engine must exist, or nothing can be compiled.
NODE_JS = '{{{ NODE }}}' # executable

JAVA = 'java' # executable

################################################################################
#
# Test suite options:
Expand Down
1 change: 1 addition & 0 deletions tools/shared.py
Expand Up @@ -72,6 +72,7 @@
diagnostics.add_warning('map-unrecognized-libraries')
diagnostics.add_warning('unused-command-line-argument', shared=True)
diagnostics.add_warning('pthreads-mem-growth')
diagnostics.add_warning('closure-compiler')


# TODO(sbc): Investigate switching to shlex.quote
Expand Down