@@ -1941,7 +1941,7 @@ def find_used_python():
1941
1941
1942
1942
1943
1943
def version_key (ver ):
1944
- return list (map (int , re .split ('[._-]' , ver )))
1944
+ return tuple (map (int , re .split ('[._-]' , ver )))
1945
1945
1946
1946
1947
1947
# A sort function that is compatible with both Python 2 and Python 3 using a
@@ -2710,14 +2710,29 @@ def extract_bool_arg(name):
2710
2710
2711
2711
releases_info = load_releases_info ()['releases' ]
2712
2712
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
+
2713
2721
# Replace meta-packages with the real package names.
2714
2722
if cmd in ('update' , 'install' , 'activate' ):
2715
2723
for i in range (2 , len (sys .argv )):
2716
2724
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' ):
2718
2730
sys .argv [i ] = str (find_latest_releases_sdk ('fastcomp' ))
2719
2731
elif arg in ('latest-upstream' , 'latest-clang-upstream' , 'latest-releases-upstream' ):
2720
2732
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' ))
2721
2736
elif arg == 'tot-upstream' :
2722
2737
sys .argv [i ] = str (find_tot_sdk ('upstream' ))
2723
2738
elif arg in ('tot-fastcomp' , 'sdk-nightly-latest' ):
@@ -2728,17 +2743,23 @@ def extract_bool_arg(name):
2728
2743
# x.y.z[-(upstream|fastcomp_])
2729
2744
# sdk-x.y.z[-(upstream|fastcomp_])-64bit
2730
2745
# TODO: support short notation for old builds too?
2731
- upstream = False
2746
+ backend = None
2732
2747
if '-upstream' in arg :
2733
2748
arg = arg .replace ('-upstream' , '' )
2734
- upstream = True
2749
+ backend = 'upstream'
2735
2750
elif '-fastcomp' in arg :
2736
2751
arg = arg .replace ('-fastcomp' , '' )
2737
- upstream = False
2752
+ backend = 'fastcomp'
2738
2753
arg = arg .replace ('sdk-' , '' ).replace ('-64bit' , '' ).replace ('tag-' , '' )
2739
2754
release_hash = releases_info .get (arg , None ) or releases_info .get ('sdk-' + arg + '-64bit' )
2740
2755
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 )
2742
2763
2743
2764
if cmd == 'list' :
2744
2765
print ('' )
@@ -2747,12 +2768,12 @@ def extract_bool_arg(name):
2747
2768
print ('The *recommended* precompiled SDK download is %s (%s).' % (find_latest_releases_version (), find_latest_releases_hash ()))
2748
2769
print ()
2749
2770
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]' )
2752
2773
print ('' )
2753
2774
print ('Those are equivalent to installing/activating the following:' )
2754
2775
print (' %s' % find_latest_releases_version ())
2755
- print (' %s-upstream ' % find_latest_releases_version ())
2776
+ print (' %s-fastcomp ' % find_latest_releases_version ())
2756
2777
print ('' )
2757
2778
else :
2758
2779
print ('Warning: your platform does not have precompiled SDKs available.' )
@@ -2764,7 +2785,6 @@ def extract_bool_arg(name):
2764
2785
releases_versions .reverse ()
2765
2786
for ver in releases_versions :
2766
2787
print (' %s' % ver )
2767
- print (' %s-upstream' % ver )
2768
2788
print ()
2769
2789
2770
2790
# Use array to work around the lack of being able to mutate from enclosing
0 commit comments