MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / rust_env

Function rust_env

scripts/rust.py:47–81  ·  view source on GitHub ↗
(release: bool, variant: Optional[Variant] = None, linker=None)

Source from the content-addressed store, hash-verified

45
46
47def rust_env(release: bool, variant: Optional[Variant] = None, linker=None) -> Dict[str, str]:
48 env = {
49 "CARGO_NET_GIT_FETCH_WITH_CLI": "true",
50 }
51
52 if release:
53 rustflags = [
54 "-C force-frame-pointers=yes",
55 ]
56
57 if linker:
58 rustflags.append(f"-C link-arg=-fuse-ld={linker}")
59
60 if isLinux():
61 rustflags.append("-C link-arg=-Wl,--compress-debug-sections=zlib")
62
63 env["CARGO_INCREMENTAL"] = "0"
64 env["CARGO_PROFILE_RELEASE_LTO"] = "thin"
65 env["RUSTFLAGS"] = " ".join(rustflags)
66
67 if isDarwin():
68 env["MACOSX_DEPLOYMENT_TARGET"] = "10.13"
69
70 env["AMAZON_Q_BUILD_TARGET_TRIPLE"] = get_target_triple()
71 env["AMAZON_Q_BUILD_HASH"] = build_hash()
72 env["AMAZON_Q_BUILD_DATETIME"] = build_datetime()
73 if variant:
74 env["AMAZON_Q_BUILD_VARIANT"] = variant.name
75
76 # Test related env vars:
77 env["Q_TELEMETRY_CLIENT_ID"] = "ffffffff-ffff-ffff-ffff-ffffffffffff"
78 if skip_fish_tests():
79 env["AMAZON_Q_BUILD_SKIP_FISH_TESTS"] = "1"
80
81 return env
82
83
84def rust_targets() -> List[str]:

Callers 5

run_clippyFunction · 0.90
run_cargo_testsFunction · 0.90
run_cargo_testsFunction · 0.90
run_clippyFunction · 0.90
build_chat_binFunction · 0.90

Calls 8

isLinuxFunction · 0.90
isDarwinFunction · 0.90
get_target_tripleFunction · 0.85
build_hashFunction · 0.85
build_datetimeFunction · 0.85
skip_fish_testsFunction · 0.85
appendMethod · 0.80
joinMethod · 0.80

Tested by 2

run_clippyFunction · 0.72
run_cargo_testsFunction · 0.72