@@ -489,7 +489,7 @@ def bin_root(self):
489
489
"""
490
490
return os .path .join (self .build_dir , self .build , "stage0" )
491
491
492
- def get_toml (self , key , section = None ):
492
+ def get_toml (self , key ):
493
493
"""Returns the value of the given key in config.toml, otherwise returns None
494
494
495
495
>>> rb = RustBuild()
@@ -501,29 +501,12 @@ def get_toml(self, key, section=None):
501
501
502
502
>>> rb.get_toml("key3") is None
503
503
True
504
-
505
- Optionally also matches the section the key appears in
506
-
507
- >>> rb.config_toml = '[a]\\ nkey = "value1"\\ n[b]\\ nkey = "value2"'
508
- >>> rb.get_toml('key', 'a')
509
- 'value1'
510
- >>> rb.get_toml('key', 'b')
511
- 'value2'
512
- >>> rb.get_toml('key', 'c') is None
513
- True
514
504
"""
515
-
516
- cur_section = None
517
505
for line in self .config_toml .splitlines ():
518
- section_match = re .match (r'^\s*\[(.*)\]\s*$' , line )
519
- if section_match is not None :
520
- cur_section = section_match .group (1 )
521
-
522
506
match = re .match (r'^{}\s*=(.*)$' .format (key ), line )
523
507
if match is not None :
524
508
value = match .group (1 )
525
- if section is None or section == cur_section :
526
- return self .get_string (value ) or value .strip ()
509
+ return self .get_string (value ) or value .strip ()
527
510
return None
528
511
529
512
def cargo (self ):
@@ -606,17 +589,7 @@ def build_bootstrap(self):
606
589
env ["LIBRARY_PATH" ] = os .path .join (self .bin_root (), "lib" ) + \
607
590
(os .pathsep + env ["LIBRARY_PATH" ]) \
608
591
if "LIBRARY_PATH" in env else ""
609
- env ["RUSTFLAGS" ] = "-Cdebuginfo=2 "
610
-
611
- build_section = "target.{}" .format (self .build_triple ())
612
- target_features = []
613
- if self .get_toml ("crt-static" , build_section ) == "true" :
614
- target_features += ["+crt-static" ]
615
- elif self .get_toml ("crt-static" , build_section ) == "false" :
616
- target_features += ["-crt-static" ]
617
- if target_features :
618
- env ["RUSTFLAGS" ] += "-C target-feature=" + ("," .join (target_features )) + " "
619
-
592
+ env ["RUSTFLAGS" ] = "-Cdebuginfo=2"
620
593
env ["PATH" ] = os .path .join (self .bin_root (), "bin" ) + \
621
594
os .pathsep + env ["PATH" ]
622
595
if not os .path .isfile (self .cargo ()):
0 commit comments