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

feat: macos m1 #558

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mssqlcli/mssqltoolsservice/externals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

install_aliases()

SQLTOOLSSERVICE_RELEASE = "v3.0.0-release.72"
SQLTOOLSSERVICE_RELEASE = "4.4.0.7"

SQLTOOLSSERVICE_BASE = os.path.join(utility.ROOT_DIR, 'sqltoolsservice/')

Expand All @@ -20,6 +20,8 @@
'Microsoft.SqlTools.ServiceLayer-rhel-x64-netcoreapp3.1.tar.gz',
'macosx_10_11_intel': SQLTOOLSSERVICE_BASE + 'macosx_10_11_intel/' +
'Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp3.1.tar.gz',
'macos_m1': SQLTOOLSSERVICE_BASE + 'macos_m1/' +
'Microsoft.SqlTools.ServiceLayer-osx-arm64-net6.0.tar.gz',
'win_amd64': SQLTOOLSSERVICE_BASE + 'win_amd64/' +
'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp3.1.zip',
'win32': SQLTOOLSSERVICE_BASE + 'win32/' +
Expand Down Expand Up @@ -53,7 +55,7 @@ def copy_sqltoolsservice(platform):
if not platform or platform not in SUPPORTED_PLATFORMS:
print('{} is not supported.'.format(platform))
print('Please provide a valid platform flag.' +
'[win32, win_amd64, manylinux1_x86_64, macosx_10_11_intel]')
'[win32, win_amd64, manylinux1_x86_64, macosx_10_11_intel, macos_m1]')
sys.exit(1)

copy_file_path = SUPPORTED_PLATFORMS[platform]
Expand Down
8 changes: 6 additions & 2 deletions utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def get_current_platform():
"""
system = platform.system()
arch = platform.architecture()[0]
processor = platform.processor()

run_time_id = None
if system == 'Windows':
Expand All @@ -76,7 +77,10 @@ def get_current_platform():
elif arch == '64bit':
run_time_id = 'win_amd64'
elif system == 'Darwin':
run_time_id = 'macosx_10_11_intel'
if processor == 'arm':
run_time_id = 'macos_m1'
elif processor == 'amd':
run_time_id = 'macosx_10_11_intel'
elif system == 'Linux':
run_time_id = 'manylinux1_x86_64'

Expand All @@ -94,7 +98,7 @@ def copy_current_platform_mssqltoolsservice():
if current_platform:
mssqltoolsservice.copy_sqltoolsservice(current_platform)
else:
print("This platform: {} does not support mssqltoolsservice.".format(platform.system()))
print("This platform: {},{},{} does not support mssqltoolsservice.".format(platform.system(), platform.architecture()[0], platform.processor()))


def random_str(size=12, chars=string.ascii_uppercase + string.digits):
Expand Down