Skip to content

Commit

Permalink
Rename platname alpine.* to musl.*
Browse files Browse the repository at this point in the history
  • Loading branch information
jondy committed Jul 7, 2020
1 parent 1452b20 commit 1531d36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/change-logs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Most of the algorithm are refined to improve the security.
Refer to https://pyarmor.readthedocs.io/en/latest/performance.html
* Add platform `musl.mips32` for MIPS32 with `musl`
* Add common options `--boot` for special cross platform obfuscating
* Rename platform names `alpine.*` to `musl.*`

6.2.9
-----
Expand Down
2 changes: 1 addition & 1 deletion src/pytransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def format_platform(platid=None):
if plat == 'linux':
cname, cver = platform.libc_ver()
if cname == 'musl':
plat = 'alpine'
plat = 'musl'
elif cname == 'libc':
plat = 'android'
elif cname == 'glibc':
Expand Down
13 changes: 6 additions & 7 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,9 +999,9 @@ def _get_preferred_platid(platname, features=None):
nlist = platname.split('.')
name = '.'.join(nlist[:2])

if name in ('linux.arm', 'linux.armv6', 'linux.ppc64', 'linux.mips32',
if name in ('linux.arm', 'linux.armv6', 'linux.ppc64',
'darwin.arm64', 'freebsd.x86_64', 'android.aarch64',
'alpine.x86_64', 'alpine.arm',
'musl.x86_64', 'musl.arm', 'musl.mips32',
'poky.x86', 'vs2015.x86_64', 'vs2015.x86'):
if features and '0' not in features:
raise RuntimeError('No feature %s for platform %s', features, name)
Expand All @@ -1013,10 +1013,7 @@ def _get_preferred_platid(platname, features=None):
features = nlist[2:3]

elif features is None:
n = pytransform.version_info()[2]
features = ['21', '25'] if (n & FEATURE_VM) \
else ['3', '7'] if (n & FEATURE_JIT) \
else ['0']
features = ['7', '3', '0']

pyver = None
if '8' in features or '11' in features or '25' in features:
Expand Down Expand Up @@ -1101,7 +1098,9 @@ def compatible_platform_names(platforms):
'ppc64le': 'linux.ppc64',
'ios.arm64': 'darwin.arm64',
'freebsd': 'freebsd.x86_64',
'alpine': 'alpine.x86_64',
'alpine': 'musl.x86_64',
'alpine.arm': 'musl.arm',
'alpine.x86_64': 'musl.x86_64',
'poky-i586': 'poky.x86',
}

Expand Down

0 comments on commit 1531d36

Please sign in to comment.