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

Function get_target_triple

scripts/rust.py:98–118  ·  view source on GitHub ↗

Returns the target triple to be built and defined in the application manifest.

()

Source from the content-addressed store, hash-verified

96
97@cache
98def get_target_triple() -> str:
99 """
100 Returns the target triple to be built and defined in the application manifest.
101 """
102 env = environ.get("AMAZON_Q_BUILD_TARGET_TRIPLE")
103 if env:
104 return env
105 elif isDarwin():
106 return "universal-apple-darwin"
107 else:
108 match (platform.machine(), isMusl()):
109 case ("x86_64", True):
110 return "x86_64-unknown-linux-musl"
111 case ("x86_64", False):
112 return "x86_64-unknown-linux-gnu"
113 case ("aarch64", True):
114 return "aarch64-unknown-linux-musl"
115 case ("aarch64", False):
116 return "aarch64-unknown-linux-gnu"
117 case (other, _):
118 raise ValueError(f"Unsupported machine {other}")
119
120
121if __name__ == "__main__":

Callers 3

rust_envFunction · 0.85
rust_targetsFunction · 0.85
rust.pyFile · 0.85

Calls 3

isDarwinFunction · 0.90
isMuslFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected