Skip to content
Open
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
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4.1
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install SBCL
run: |
sudo apt-get update
sudo apt-get install -y sbcl

- name: Build Lisp Files
run: |
bazel build --enable_bzlmod=false //...

- name: Run Tests
run: |
bazel test --enable_bzlmod=false --test_output=errors //...
63 changes: 41 additions & 22 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,15 @@
# more info about this package.

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@bazel_tools//tools/build_defs/license:license.bzl", "license")
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")

package(default_applicable_licenses = ["//:license"])

license(
name = "license",
package_name = "bazel",
)
load(":rules.bzl", "lisp_test")

licenses(["notice"])

exports_files([
"LICENSE",
"imagesave.lisp",
"sbcl.lisp",
])

bzl_library(
Expand All @@ -36,7 +29,8 @@ bzl_library(
visibility = ["//visibility:public"],
deps = [
"@bazel_skylib//rules:common_settings",
"@rules_cc//cc:find_cc_toolchain.bzl",
"@rules_cc//cc:find_cc_toolchain_bzl",
"@rules_cc//cc/common",
],
)

Expand Down Expand Up @@ -73,24 +67,23 @@ alias(
visibility = ["//visibility:public"],
)

genrule(
name = "make-image",
[genrule(
name = "make-lfc-" + arch,
srcs = [
"utils.lisp",
"warning.lisp",
"log.lisp",
"sbcl.lisp",
"main.lisp",
"@local_sbcl//:contrib/sb-md5",
"@local_sbcl//:contrib/sb-rotate-byte",
"@local_sbcl//:core",
"@local_sbcl//:sbcl",
],
outs = ["image"],
outs = ["lfc." + arch], # Lisp file compiler
cmd = (
"$(location @local_sbcl//:sbcl)" +
" --noinform" +
" --eval '(setf sb-ext:*evaluator-mode* :compile)'" +
""" --eval '(sb-ext:unlock-package :sb-vm)'""" +
""" --eval '(setf sb-ext:*evaluator-mode* :compile
#+x86-64 sb-vm::*eager-tls-assignment* #+x86-64 t)'""" +
" --load '$(location utils.lisp)'" +
" --load '$(location warning.lisp)'" +
" --load '$(location log.lisp)'" +
Expand All @@ -100,9 +93,37 @@ genrule(
),
executable = 1,
output_to_bindir = 1,
# tags can't involve "select" which is why this uses one rule per arch
tags = ["requires-arch:" + arch],
visibility = ["//visibility:public"],
) for arch in [
"arm",
"x86",
]]

alias(
name = "lfc",
actual = select({
"@platforms//cpu:aarch64": "lfc.arm",
"//conditions:default": "lfc.x86",
}),
visibility = ["//visibility:public"],
)

genrule(
name = "make-test-image",
srcs = [
":lfc",
"faslkludge.lisp",
],
outs = ["test-image"],
cmd = "LISP_MAIN=t $(location :lfc) --load $(location faslkludge.lisp) --eval " +
"'(bazel.main:save-image \"$@\" (quote bazel.main:main) :executable t)'",
executable = 1,
output_to_bindir = 1,
visibility = ["__subpackages__"],
)

# Elfinator reads an SBCL-native core file and produces two outputs:
# (1) an assembly-language file with a '.text' section whose contents
# are the code components from the input core file.
Expand All @@ -118,7 +139,6 @@ sh_binary(
"elfconvert.sh",
],
data = [
"@local_sbcl//:core",
"@local_sbcl//:sbcl",
"@sbcl//:tools-for-build/corefile.lisp",
"@sbcl//:tools-for-build/editcore.lisp",
Expand All @@ -127,8 +147,7 @@ sh_binary(
visibility = ["//visibility:public"],
)

bool_flag(
name = "additional_dynamic_load_outputs",
build_setting_default = False,
visibility = ["//visibility:public"],
lisp_test(
name = "mangler",
srcs = ["mangler.lisp"],
)
2 changes: 2 additions & 0 deletions BUILD.sbcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
exports_files([
"tools-for-build/corefile.lisp",
"tools-for-build/editcore.lisp",
"tools-for-build/elftool.lisp",
"contrib/sb-cover/cover.lisp",
])
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,6 @@ output
of `lisp_library`. For `lisp_binary` and `lisp_test`, the default output is the
executable (same name as the target).

If the flag `--//:additional_dynamic_load_outputs` is
passed, `OutputGroupInfo` has the following additional fields:

* `deps_manifest` additionally contains a plaintext representation of the
target's transitive Lisp features (prefixed with `feature:`) and transitive
source files (prefixed with `src:`).
* `dynamic_library` contains a shared object file with the target's transitive
C++ dependencies.

[Runfiles](https://docs.bazel.build/versions/master/skylark/rules.html#runfiles)
([`DefaultInfo.default_runfiles`](https://docs.bazel.build/versions/master/skylark/lib/DefaultInfo.html#default_runfiles))
are propagated from all dependencies that provide either runtime dependencies or
Expand Down
Loading
Loading