@@ -1941,7 +1941,7 @@ def find_used_python():
19411941
19421942
19431943def version_key (ver ):
1944- return list (map (int , re .split ('[._-]' , ver )))
1944+ return tuple (map (int , re .split ('[._-]' , ver )))
19451945
19461946
19471947# A sort function that is compatible with both Python 2 and Python 3 using a
@@ -2710,14 +2710,29 @@ def extract_bool_arg(name):
27102710
27112711 releases_info = load_releases_info ()['releases' ]
27122712
2713+ def report_upstream_by_default ():
2714+ print ('''\
2715+ ** NOTICE **: The default SDK changed from `fastcomp` to `upstream`.
2716+ If you have problems, or wish to revert back to fastcomp for some other reason
2717+ you can add `-fastcomp` to explitly install that fastcomp-based
2718+ SDK. .e.g ./emsdk install latest-fastcomp.
2719+ ''' , file = sys .stderr )
2720+
27132721 # Replace meta-packages with the real package names.
27142722 if cmd in ('update' , 'install' , 'activate' ):
27152723 for i in range (2 , len (sys .argv )):
27162724 arg = sys .argv [i ]
2717- if arg in ('latest' , 'sdk-latest' , 'latest-64bit' , 'sdk-latest-64bit' , 'latest-fastcomp' , 'latest-releases-fastcomp' ):
2725+ if arg in ('latest' , 'sdk-latest' , 'latest-64bit' , 'sdk-latest-64bit' ):
2726+ # This is effectly the default SDK
2727+ report_upstream_by_default ()
2728+ sys .argv [i ] = str (find_latest_releases_sdk ('upstream' ))
2729+ elif arg in ('latest-fastcomp' , 'latest-releases-fastcomp' ):
27182730 sys .argv [i ] = str (find_latest_releases_sdk ('fastcomp' ))
27192731 elif arg in ('latest-upstream' , 'latest-clang-upstream' , 'latest-releases-upstream' ):
27202732 sys .argv [i ] = str (find_latest_releases_sdk ('upstream' ))
2733+ elif arg in ('tot' , 'sdk-tot' ):
2734+ report_upstream_by_default ()
2735+ sys .argv [i ] = str (find_tot_sdk ('upstream' ))
27212736 elif arg == 'tot-upstream' :
27222737 sys .argv [i ] = str (find_tot_sdk ('upstream' ))
27232738 elif arg in ('tot-fastcomp' , 'sdk-nightly-latest' ):
@@ -2728,17 +2743,23 @@ def extract_bool_arg(name):
27282743 # x.y.z[-(upstream|fastcomp_])
27292744 # sdk-x.y.z[-(upstream|fastcomp_])-64bit
27302745 # TODO: support short notation for old builds too?
2731- upstream = False
2746+ backend = None
27322747 if '-upstream' in arg :
27332748 arg = arg .replace ('-upstream' , '' )
2734- upstream = True
2749+ backend = 'upstream'
27352750 elif '-fastcomp' in arg :
27362751 arg = arg .replace ('-fastcomp' , '' )
2737- upstream = False
2752+ backend = 'fastcomp'
27382753 arg = arg .replace ('sdk-' , '' ).replace ('-64bit' , '' ).replace ('tag-' , '' )
27392754 release_hash = releases_info .get (arg , None ) or releases_info .get ('sdk-' + arg + '-64bit' )
27402755 if release_hash :
2741- sys .argv [i ] = 'sdk-releases-%s-%s-64bit' % ('upstream' if upstream else 'fastcomp' , release_hash )
2756+ if backend is None :
2757+ if version_key (arg ) >= (1 , 39 , 0 ):
2758+ report_upstream_by_default ()
2759+ backend = 'upstream'
2760+ else :
2761+ backend = 'fastcomp'
2762+ sys .argv [i ] = 'sdk-releases-%s-%s-64bit' % (backend , release_hash )
27422763
27432764 if cmd == 'list' :
27442765 print ('' )
@@ -2747,12 +2768,12 @@ def extract_bool_arg(name):
27472768 print ('The *recommended* precompiled SDK download is %s (%s).' % (find_latest_releases_version (), find_latest_releases_hash ()))
27482769 print ()
27492770 print ('To install/activate it, use one of:' )
2750- print (' latest [default (fastcomp ) backend]' )
2751- print (' latest-upstream [upstream LLVM wasm backend]' )
2771+ print (' latest [default (llvm ) backend]' )
2772+ print (' latest-fastcomp [legacy (fastcomp) backend]' )
27522773 print ('' )
27532774 print ('Those are equivalent to installing/activating the following:' )
27542775 print (' %s' % find_latest_releases_version ())
2755- print (' %s-upstream ' % find_latest_releases_version ())
2776+ print (' %s-fastcomp ' % find_latest_releases_version ())
27562777 print ('' )
27572778 else :
27582779 print ('Warning: your platform does not have precompiled SDKs available.' )
@@ -2764,7 +2785,6 @@ def extract_bool_arg(name):
27642785 releases_versions .reverse ()
27652786 for ver in releases_versions :
27662787 print (' %s' % ver )
2767- print (' %s-upstream' % ver )
27682788 print ()
27692789
27702790 # Use array to work around the lack of being able to mutate from enclosing
0 commit comments