Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ junit_xsd(
dev_dependency = True,
)

# Local toolchains
register_toolchains("//elisp:hermetic_toolchain")
# Local toolchains. We only register toolchains for the most recent Emacs
# release, with binary builds coming first. Source builds will be selected as a
# fallback in case none of the binary ones apply.
register_toolchains(
"//elisp:emacs_30_windows_x86_64_toolchain",
"//elisp:emacs_30_toolchain",
)

# C++-specific dependencies
bazel_dep(name = "gazelle_cc", version = "0.5.0", dev_dependency = True)
Expand Down
8 changes: 6 additions & 2 deletions check.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env pwsh

# Copyright 2021-2025 Google LLC
# Copyright 2021-2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,7 +54,11 @@ Set-Location -Path $PSScriptRoot
Run-Tests

foreach ($version in $versions) {
Run-Tests "--extra_toolchains=//elisp:emacs_${version}_toolchain"
$toolchains = @(
"//elisp:emacs_${version}_toolchain",
"//elisp:emacs_${version}_windows_x86_64_toolchain"
)
Run-Tests "--extra_toolchains=$($toolchains -join ',')"
}

Run-Bazel 'mod' 'graph' > $null
Expand Down
44 changes: 41 additions & 3 deletions elisp/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2025 Google LLC
# Copyright 2020-2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,12 +42,40 @@ toolchain(
toolchain_type = ":toolchain_type",
)

toolchain(
name = "emacs_29_windows_x86_64_toolchain",
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
target_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
toolchain = "emacs_29_windows_x86_64",
toolchain_type = ":toolchain_type",
)

toolchain(
name = "emacs_30_toolchain",
toolchain = "emacs_30",
toolchain_type = ":toolchain_type",
)

toolchain(
name = "emacs_30_windows_x86_64_toolchain",
exec_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
target_compatible_with = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
toolchain = "emacs_30_windows_x86_64",
toolchain_type = ":toolchain_type",
)

toolchain(
name = "local_toolchain",
toolchain = ":local",
Expand All @@ -67,12 +95,22 @@ elisp_toolchain(

elisp_toolchain(
name = "emacs_29",
emacs = "//emacs:emacs_29",
emacs = "@gnu_emacs_29//:emacs",
)

elisp_toolchain(
name = "emacs_29_windows_x86_64",
emacs = "@gnu_emacs_windows_29//:emacs",
)

elisp_toolchain(
name = "emacs_30",
emacs = "//emacs:emacs_30",
emacs = "@gnu_emacs_30//:emacs",
)

elisp_toolchain(
name = "emacs_30_windows_x86_64",
emacs = "@gnu_emacs_windows_30//:emacs",
)

bzl_library(
Expand Down
3 changes: 2 additions & 1 deletion elisp/private/emacs_repository.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023-2025 Google LLC
# Copyright 2023-2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,6 +31,7 @@ def _emacs_repository_impl(ctx):
{
'"[elisp_emacs_binary.bzl]"': repr(str(Label("//elisp/toolchains:elisp_emacs_binary.bzl"))),
'"[cc_library.bzl]"': repr(str(Label("@rules_cc//cc:cc_library.bzl"))),
'"[elisp_pkg]"': repr(str(Label("//elisp:__pkg__"))),
'"[emacs_pkg]"': repr(str(Label("//emacs:__pkg__"))),
'"[gazelle_pkg]"': repr(str(Label("//gazelle/elisp:__pkg__"))),
'"[type]"': repr(ctx.attr.type),
Expand Down
7 changes: 5 additions & 2 deletions elisp/private/tools/emacs.BUILD.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2022, 2024, 2025 Google LLC
# Copyright 2020-2022, 2024-2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,7 +38,10 @@ elisp_emacs_binary(
module_header = "emacs-module.h",
readme = "README",
target_compatible_with = [[compatible_with]],
visibility = ["[emacs_pkg]"],
visibility = [
"[elisp_pkg]",
"[emacs_pkg]",
],
)

cc_library(
Expand Down