Skip to content

Commit

Permalink
[GR-54154] Relax IO encoding check
Browse files Browse the repository at this point in the history
PullRequest: mx/1797
  • Loading branch information
msimacek committed May 22, 2024
2 parents f2d92b8 + 8351270 commit 12267ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
14 changes: 7 additions & 7 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.2+13-jvmci-23.1-b33-sulong", "platformspecific": true },
"graalvm-ee-21": {"name": "graalvm-java21", "version": "23.1.3", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+22", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-23+22-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-23+22-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-23+22-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-23+22-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-23+22-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-23+22-jvmci-b01-sulong", "platformspecific": true }
"oraclejdk-latest": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+23", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-23+23-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-23+23-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-23+23-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-23+23-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-23+23-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-23+23-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
2 changes: 1 addition & 1 deletion src/mx/_impl/mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18173,7 +18173,7 @@ def alarm_handler(signum, frame):
_CACHE_DIR = get_env('MX_CACHE_DIR', join(dot_mx_dir(), 'cache'))

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("7.25.4") # GR-54113
version = VersionSpec("7.25.5") # [GR-54154] Relax IO encoding check

_mx_start_datetime = datetime.utcnow()

Expand Down
7 changes: 6 additions & 1 deletion src/mx/_impl/support/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,21 @@

def _check_stdout_encoding():
# Importing here to avoid broken circular import
from .envvars import env_var_to_bool
from .system import is_continuous_integration

if not env_var_to_bool("MX_CHECK_IOENCODING", "1"):
return

encoding = sys.stdout.encoding

if "utf" not in encoding:
msg = (
"Python's stdout does not use a unicode encoding.\n"
"This may cause encoding errors when printing special characters.\n"
"Please set up your system or console to use a unicode encoding.\n"
"When piping mx output, you can force UTF-8 encoding with the environment variable PYTHONIOENCODING=utf-8"
"When piping mx output, you can force UTF-8 encoding with the environment variable PYTHONIOENCODING=utf-8\n"
"This check can be disabled by setting MX_CHECK_IOENCODING=0 environment variable"
)
if is_continuous_integration():
abort(msg)
Expand Down

0 comments on commit 12267ad

Please sign in to comment.