Skip to content

Commit

Permalink
fix: refine comments
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn committed Sep 29, 2024
1 parent c045e9a commit 7600208
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
27 changes: 20 additions & 7 deletions build/common/rust/rust_gen_cargo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def delete_cargo_config(root: str):
if __name__ == "__main__":
parser = argparse.ArgumentParser()

parser.add_argument("--action", type=str, required=True, help="gen|delete|print")
parser.add_argument(
"--action", type=str, required=True, help="gen|delete|print"
)
parser.add_argument("--project-root", type=str, required=False)
parser.add_argument("--compiler", type=str, required=True)
parser.add_argument("--target", type=str, required=False)
Expand All @@ -127,11 +129,16 @@ def delete_cargo_config(root: str):
try:
gen_cargo_config(args)

# Success to gen config, update the stamp file to represent this fact.
timestamp_proxy.touch_timestamp_proxy_file(args.tg_timestamp_proxy_file)
# Success to gen cargo config, update the stamp file to represent
# this fact.
timestamp_proxy.touch_timestamp_proxy_file(
args.tg_timestamp_proxy_file
)
except Exception as exc:
returncode = 1
timestamp_proxy.remove_timestamp_proxy_file(args.tg_timestamp_proxy_file)
timestamp_proxy.remove_timestamp_proxy_file(
args.tg_timestamp_proxy_file
)
print(exc)

finally:
Expand All @@ -141,15 +148,21 @@ def delete_cargo_config(root: str):
try:
delete_cargo_config(args.project_root)

# Success to delete config, update the stamp file to represent this fact.
timestamp_proxy.touch_timestamp_proxy_file(args.tg_timestamp_proxy_file)
# Success to delete cargo config, update the stamp file to represent
# this fact.
timestamp_proxy.touch_timestamp_proxy_file(
args.tg_timestamp_proxy_file
)
except Exception as exc:
returncode = 1
timestamp_proxy.remove_timestamp_proxy_file(args.tg_timestamp_proxy_file)
timestamp_proxy.remove_timestamp_proxy_file(
args.tg_timestamp_proxy_file
)
print(exc)

finally:
sys.exit(-1 if returncode != 0 else 0)

else:
flags = [
CLANG_ASAN_FLAGS[i] + CLANG_ASAN_FLAGS[i + 1]
Expand Down
2 changes: 1 addition & 1 deletion build/ten_rust/options.gni
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ declare_args() {
# x86.
enable_ten_rust = !(enable_sanitizer && target_cpu == "x86")

# Enable this option if you want to develop rust within enable_sanitizer is
# Enable this option if you want to develop rust when enable_sanitizer is
# true.
enable_cargo_config_gen = false
}

0 comments on commit 7600208

Please sign in to comment.