@@ -164,9 +164,16 @@ def do_run_python(args, extra_vm_args=None, env=None, jdk=None, extra_dists=None
164
164
elif check_vm_env == '0' :
165
165
check_vm ()
166
166
167
- dists = [f'{ "BOOTSTRAP_" if minimal else "" } GRAALPYTHON' , 'TRUFFLE_NFI' , 'SULONG_NATIVE' ]
167
+ if minimal :
168
+ x , * __ = * [x for x in SUITE .dists if x .name == "GRAALPYTHON" ],
169
+ dists = [dep for dep in x .deps if dep .isJavaProject () or dep .isJARDistribution ()]
170
+ else :
171
+ dists = ['GRAALPYTHON' ]
172
+ dists += ['TRUFFLE_NFI' , 'SULONG_NATIVE' ]
168
173
169
174
vm_args , graalpython_args = mx .extract_VM_args (args , useDoubleDash = True , defaultAllVMArgs = False )
175
+ if minimal :
176
+ vm_args .insert (0 , f"-Dorg.graalvm.language.python.home={ _dev_pythonhome ()} " )
170
177
graalpython_args , additional_dists = _extract_graalpython_internal_options (graalpython_args )
171
178
dists += additional_dists
172
179
@@ -1880,6 +1887,9 @@ def __str__(self):
1880
1887
return 'Building project {}' .format (self .subject .name )
1881
1888
1882
1889
def build (self ):
1890
+ if not self .args .force and not self .args .all and not self .needsBuild (None )[0 ]:
1891
+ mx .log (f"Refusing build of { self .subject .name } . Use e.g. `mx -f --only { self .subject .name } ' to force a build." )
1892
+ return True
1883
1893
args = [mx_subst .path_substitutions .substitute (a , dependency = self ) for a in self .subject .args ]
1884
1894
return self .run (args )
1885
1895
@@ -1938,7 +1948,7 @@ def needsBuild(self, newestInput):
1938
1948
if tsOldest == sys .maxsize :
1939
1949
tsOldest = 0
1940
1950
if tsOldest < tsNewest :
1941
- self .clean () # we clean here, because setuptools doesn't check timestamps
1951
+ self .clean (forBuild = "reallyForBuild" ) # we clean here, because setuptools doesn't check timestamps
1942
1952
if newestFile and oldestFile :
1943
1953
return (True , "rebuild needed, %s newer than %s" % (newestFile , oldestFile ))
1944
1954
else :
@@ -1950,12 +1960,12 @@ def newestOutput(self):
1950
1960
return None
1951
1961
1952
1962
def clean (self , forBuild = False ):
1953
- try :
1954
- shutil . rmtree ( self . subject . get_output_root ())
1955
- except BaseException :
1956
- return 1
1957
- else :
1958
- return 0
1963
+ if forBuild == "reallyForBuild" :
1964
+ try :
1965
+ shutil . rmtree ( self . subject . get_output_root ())
1966
+ except BaseException :
1967
+ return 1
1968
+ return 0
1959
1969
1960
1970
1961
1971
class GraalpythonCAPIBuildTask (GraalpythonBuildTask ):
@@ -1983,23 +1993,18 @@ def _prepare_headers(self):
1983
1993
1984
1994
def build (self ):
1985
1995
self ._prepare_headers ()
1986
-
1987
1996
# n.b.: we do the following to ensure that there's a directory when the
1988
1997
# importlib PathFinder initializes it's directory finders
1989
1998
mx .ensure_dir_exists (os .path .join (self .subject .get_output_root (), "modules" ))
1990
-
1991
- args = [
1992
- os .path .join (self .src_dir (), "setup.py" ),
1993
- self .subject .get_output_root ()
1994
- ]
1995
- return self .run (args )
1999
+ return super ().build ()
1996
2000
1997
2001
def clean (self , forBuild = False ):
1998
2002
result = 0
1999
- try :
2000
- shutil .rmtree (self ._dev_headers_dir ())
2001
- except BaseException :
2002
- result = 1
2003
+ if not forBuild :
2004
+ try :
2005
+ shutil .rmtree (self ._dev_headers_dir ())
2006
+ except BaseException :
2007
+ result = 1
2003
2008
return max (result , super ().clean (forBuild = forBuild ))
2004
2009
2005
2010
0 commit comments