Skip to content

FreeBSD builds #416

Closed
Closed

Description

@buraktamturk

I currently have these patches to make build work it on FreeBSD, and it works pretty well (I realize cursor_vscdb_paths patch would break functionality on other platforms but easy to fix it).

rlim_cur and rlim_max is i64 in FreeBSD unlike other platforms:

diff --git a/crates/jcode-base/src/auth/cursor.rs b/crates/jcode-base/src/auth/cursor.rs
index 31fcf357..eafcd13c 100644
--- a/crates/jcode-base/src/auth/cursor.rs
+++ b/crates/jcode-base/src/auth/cursor.rs
@@ -234,21 +234,10 @@ fn find_cursor_vscdb() -> Result<PathBuf> {

 /// Platform-specific candidate paths for Cursor's state.vscdb.
 fn cursor_vscdb_paths() -> Vec<PathBuf> {
-    #[cfg(target_os = "linux")]
     let relatives = [
         ".config/Cursor/User/globalStorage/state.vscdb",
         ".config/cursor/User/globalStorage/state.vscdb",
     ];
-    #[cfg(target_os = "macos")]
-    let relatives = [
-        "Library/Application Support/Cursor/User/globalStorage/state.vscdb",
-        "Library/Application Support/cursor/User/globalStorage/state.vscdb",
-    ];
-    #[cfg(target_os = "windows")]
-    let relatives = [
-        "AppData/Roaming/Cursor/User/globalStorage/state.vscdb",
-        "AppData/Roaming/cursor/User/globalStorage/state.vscdb",
-    ];

     relatives
         .into_iter()
diff --git a/crates/jcode-base/src/platform.rs b/crates/jcode-base/src/platform.rs
index 3d6e7f01..08f6cf7e 100644
--- a/crates/jcode-base/src/platform.rs
+++ b/crates/jcode-base/src/platform.rs
@@ -203,8 +203,8 @@ pub fn raise_nofile_limit_best_effort(minimum_soft_limit: u64) {
             return;
         }

-        let current: u64 = limit.rlim_cur;
-        let hard: u64 = limit.rlim_max;
+        let current: u64 = limit.rlim_cur as u64;
+        let hard: u64 = limit.rlim_max as u64;
         let Some(desired) = desired_nofile_soft_limit(current, hard, minimum_soft_limit) else {
             return;
         };

I would appreciate two additional features:

  1. No build errors when building on FreeBSD (the only build errors caused by the lines in the patch).
  2. Perhaps pre-build binaries for FreeBSD (could make use of https://github.com/marketplace/actions/freebsd-vm)

Kind regards,

Activity

  1. added
    enhancement
    priority: low
    triage: reproducible
    autonomous: likely
    on Jun 29, 2026
  2. 1jehuang commented on Jun 29, 2026

    @1jehuang
    Owner

    Triage: reproducible, autonomous: likely. Added proper FreeBSD support: cast rlim_cur/rlim_max to u64 (they're i64 on FreeBSD), and an XDG-style Cursor state.vscdb path fallback for non-Linux/macOS/Windows Unix. Also added a freebsd-smoke CI workflow that boots a real FreeBSD 14.2 VM (vmactions/freebsd-vm) to build + run --version + run platform unit tests, since GitHub has no native FreeBSD runner and cross-compile can't link aws-lc-sys. Verified green: https://github.com/1jehuang/jcode/actions/runs/28342275452. Fix in #417.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: likelyenhancementpriority: lowtriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions