@@ -110,6 +110,35 @@ _formatjs_cli_repo = repository_rule(
110110 },
111111)
112112
113+ def _formatjs_cli_placeholder_repo_impl (rctx ):
114+ """Implementation for a placeholder repository for platforms without binaries yet."""
115+ rctx .file ("BUILD.bazel" , content = """# Placeholder repository for {platform}
116+ # Binary not yet available for this platform.
117+ # The toolchain definition exists in @formatjs_cli_toolchains but will not be selected
118+ # unless you're building on this platform (which will fail with a clear error).
119+
120+ exports_files(["README.md"])
121+ """ .format (platform = rctx .attr .platform ))
122+
123+ rctx .file ("README.md" , content = """This is a placeholder repository for the FormatJS CLI on {platform}.
124+
125+ Binaries are not yet available for this platform. If you need support for this platform,
126+ please file an issue or contribute a PR at:
127+ https://github.com/formatjs/formatjs
128+
129+ The toolchain infrastructure is ready - only the binary build is needed.
130+ """ .format (platform = rctx .attr .platform ))
131+
132+ _formatjs_cli_placeholder_repo = repository_rule (
133+ implementation = _formatjs_cli_placeholder_repo_impl ,
134+ attrs = {
135+ "platform" : attr .string (
136+ mandatory = True ,
137+ doc = "Target platform (e.g., 'darwin-x86_64', 'windows-x86_64')" ,
138+ ),
139+ },
140+ )
141+
113142def _formatjs_cli_toolchains_repo_impl (rctx ):
114143 """Implementation for the main toolchains repository that contains toolchain definitions for all platforms."""
115144
@@ -126,9 +155,18 @@ def _formatjs_cli_toolchains_repo_impl(rctx):
126155 ("darwin_arm64" , {
127156 "exec_compatible_with" : ["\" @platforms//os:osx\" " , "\" @platforms//cpu:arm64\" " ],
128157 }),
158+ ("darwin_x86_64" , {
159+ "exec_compatible_with" : ["\" @platforms//os:osx\" " , "\" @platforms//cpu:x86_64\" " ],
160+ }),
129161 ("linux_x64" , {
130162 "exec_compatible_with" : ["\" @platforms//os:linux\" " , "\" @platforms//cpu:x86_64\" " ],
131163 }),
164+ ("linux_aarch64" , {
165+ "exec_compatible_with" : ["\" @platforms//os:linux\" " , "\" @platforms//cpu:aarch64\" " ],
166+ }),
167+ ("windows_x86_64" , {
168+ "exec_compatible_with" : ["\" @platforms//os:windows\" " , "\" @platforms//cpu:x86_64\" " ],
169+ }),
132170 ]:
133171 build_content += """
134172toolchain(
@@ -184,6 +222,25 @@ def formatjs_cli_register_toolchains(name, version = DEFAULT_VERSION, register =
184222 target_compatible_with = [],
185223 )
186224
225+ # macOS Intel (darwin-x86_64) - placeholder for now
226+ repo_name = "{}_darwin_x86_64" .format (name )
227+ if "darwin-x86_64" in FORMATJS_CLI_VERSIONS [version ]:
228+ _formatjs_cli_repo (
229+ name = repo_name ,
230+ version = version ,
231+ platform = "darwin-x86_64" ,
232+ exec_compatible_with = [
233+ "@platforms//os:macos" ,
234+ "@platforms//cpu:x86_64" ,
235+ ],
236+ target_compatible_with = [],
237+ )
238+ else :
239+ _formatjs_cli_placeholder_repo (
240+ name = repo_name ,
241+ platform = "darwin-x86_64" ,
242+ )
243+
187244 # Linux x86_64
188245 if "linux-x64" in FORMATJS_CLI_VERSIONS [version ]:
189246 repo_name = "{}_linux_x64" .format (name )
@@ -198,6 +255,44 @@ def formatjs_cli_register_toolchains(name, version = DEFAULT_VERSION, register =
198255 target_compatible_with = [],
199256 )
200257
258+ # Linux aarch64 - placeholder for now
259+ repo_name = "{}_linux_aarch64" .format (name )
260+ if "linux-aarch64" in FORMATJS_CLI_VERSIONS [version ]:
261+ _formatjs_cli_repo (
262+ name = repo_name ,
263+ version = version ,
264+ platform = "linux-aarch64" ,
265+ exec_compatible_with = [
266+ "@platforms//os:linux" ,
267+ "@platforms//cpu:aarch64" ,
268+ ],
269+ target_compatible_with = [],
270+ )
271+ else :
272+ _formatjs_cli_placeholder_repo (
273+ name = repo_name ,
274+ platform = "linux-aarch64" ,
275+ )
276+
277+ # Windows x86_64 - placeholder for now
278+ repo_name = "{}_windows_x86_64" .format (name )
279+ if "windows-x86_64" in FORMATJS_CLI_VERSIONS [version ]:
280+ _formatjs_cli_repo (
281+ name = repo_name ,
282+ version = version ,
283+ platform = "windows-x86_64" ,
284+ exec_compatible_with = [
285+ "@platforms//os:windows" ,
286+ "@platforms//cpu:x86_64" ,
287+ ],
288+ target_compatible_with = [],
289+ )
290+ else :
291+ _formatjs_cli_placeholder_repo (
292+ name = repo_name ,
293+ platform = "windows-x86_64" ,
294+ )
295+
201296 # Create the main toolchains repository with definitions for all platforms
202297 _formatjs_cli_toolchains_repo (
203298 name = name ,
0 commit comments