fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.11k stars 140 forks source link

Support for os.name=Linux, os.arch=aarch64 #219

Closed lanmaoxinqing closed 2 years ago

lanmaoxinqing commented 2 years ago

The os.arch system variable may be aarch64 in some linux arm64 machines like below and OSInfo.java in native module doesn't recognize it.

$ uname -a
Linux xxx xxx.aarch64 #1 SMP Fri Aug 9 04:09:13 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux

caused by

    public static String getArchName() {
        String osArch = System.getProperty("os.arch");
        // For Android
        if (isAndroid()) {
            return "android-arm";
        }

        if (osArch.startsWith("arm")) {    //  <-- linux arch named `aarch64` can not go into this
            osArch = resolveArmArchType();
        } else {
            String lc = osArch.toLowerCase(Locale.US);
            if (archMapping.containsKey(lc))
                return archMapping.get(lc);
        }
        return translateArchNameToFolderName(osArch);
    }

And arm64 and aarch64 should be same according to differences-between-arm64-and-aarch64

martin-g commented 2 years ago

Thank you for fixing this, @lanmaoxinqing ! Looking forward for a new release with this improvement!