Skip to content

Add Zed tasks, debug configurations, and ignore log files - #737

Merged
AltraMayor merged 3 commits into
masterfrom
zed-tasks
Sep 23, 2026
Merged

AltraMayor merged 3 commits into
masterfrom
zed-tasks

Conversation

@AltraMayor

Copy link
Copy Markdown
Owner

This pull request adds support for Zed editor workflows in Gatekeeper:

  1. Build and Clean Tasks: Adds project tasks in .zed/tasks.json to build (make -j) and clean (make clean) the project.
  2. Debugging Configurations: Adds CodeLLDB launch/attach configurations in .zed/debug.json and a helper script .zed/start-lldb-server.sh to run lldb-server with root privileges in the background, resolving DAP headless permission and ptrace attachment limitations. Also adds corresponding Zed tasks to start and stop lldb-server.
  3. Ignore Log Files: Adds gatekeeper_*.log to .gitignore to prevent generated runtime log files from cluttering the working directory.

@AltraMayor AltraMayor added this to the Version 1.3 milestone Sep 22, 2026
Zed supports executing build workflows via project tasks configured in
.zed/tasks.json.

This commit adds tasks for Gatekeeper in .zed/tasks.json:
1. 'Gatekeeper: Build' to run 'make -j' and save all modified buffers
   before building; and
2. 'Gatekeeper: Clean' to run 'make clean'.
Gatekeeper requires root privileges to access hugepages and network
hardware. When debugging in Zed via the CodeLLDB debug adapter, the
editor communicates headlessly over the Debug Adapter Protocol (DAP)
and cannot interactively prompt for sudo credentials. Additionally,
pre-debug tasks in Zed wait for commands to exit, which would cause
a persistent daemon like lldb-server to hang the launch sequence.

This commit adds debugging support for Zed:
1. adds .zed/debug.json configuring CodeLLDB launch and attach
   profiles;
2. adds helper script .zed/start-lldb-server.sh to run lldb-server
   as root in the background; and
3. adds tasks 'Gatekeeper: Start lldb-server' and 'Gatekeeper: Stop
   lldb-server' to .zed/tasks.json.

The helper script and configuration resolve several platform details:
- verify that kernel.yama.ptrace_scope is not set to 3 ('No Attach'),
  which permanently blocks ptrace(2) system-wide, even for root;
- resolve the canonical binary path with readlink(1) so the platform
  server finds its versioned worker stub (lldb-server-<version>);
- authenticate sudo(8) in the foreground terminal before spawning the
  daemon with setsid(1) so cached TTY tickets are honored; and
- disable target.auto-install-main-executable in LLDB to prevent
  unnecessary file transfers over the local platform connection.
Running Gatekeeper during testing or debugging generates timestamped
log files in the working directory named
gatekeeper_YYYY_MM_DD_HH_MM.log.

This commit adds pattern 'gatekeeper_*.log' to .gitignore to keep the
repository clean.
@AltraMayor
AltraMayor merged commit d17efe4 into master Sep 23, 2026
1 check passed
@AltraMayor
AltraMayor deleted the zed-tasks branch September 23, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant