diff --git a/README.md b/README.md index bd41752..d504ceb 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Roughly can also be used as a VS Code extension. Install the extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=felix-andreas.roughly). > [!NOTE] -> The VS Code extension from the marketplace includes a bundled version of the Roughly CLI **only for Windows and Linux x64**. If you are using macOS or a different architecture, you will need to install the Roughly CLI manually. +> The VS Code extension from the marketplace includes a bundled version of the Roughly CLI for **Linux x86_64, Windows x86_64, and macOS aarch64**. If you are using a different architecture, you will need to install the Roughly CLI manually. ### Manual Installation diff --git a/editors/code/README.md b/editors/code/README.md index 5c45b40..e68d5a1 100644 --- a/editors/code/README.md +++ b/editors/code/README.md @@ -3,7 +3,7 @@ This extension provides support for the [R programming language](https://www.r-project.org/), including workspace symbol search, code formatting, and syntax diagnostics. > **Note** -> The VS Code extension from the marketplace includes a bundled version of the Roughly CLI **only for Windows and Linux x64**. If you are using macOS or a different architecture, you will need to install the Roughly CLI manually. +> The VS Code extension from the marketplace includes a bundled version of the Roughly CLI for **Linux x86_64, Windows x86_64, and macOS aarch64**. If you are using a different architecture, you will need to install the Roughly CLI manually. ## Features diff --git a/flake.lock b/flake.lock index 2529010..1e96794 100644 --- a/flake.lock +++ b/flake.lock @@ -2,7 +2,9 @@ "nodes": { "devshell": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1741473158, @@ -20,27 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1722073938, - "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1750898778, - "narHash": "sha256-DXI7+SKDlTyA+C4zp0LoIywQ+BfdH5m4nkuxbWgV4UU=", + "lastModified": 1752809442, + "narHash": "sha256-7fALxZGWDspRe79LaDwIdmkDl568Cphfvr83PGCXUUQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "322d8a3c6940039f7cff179a8b09c5d7ca06359d", + "rev": "e821e03193486359aa942372be2d9c1f377b7a18", "type": "github" }, "original": { @@ -51,7 +37,7 @@ "root": { "inputs": { "devshell": "devshell", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay", "systems": "systems" } @@ -63,11 +49,11 @@ ] }, "locked": { - "lastModified": 1750991972, - "narHash": "sha256-jzadGZL1MtqmHb5AZcjZhHpNulOdMZPxf8Wifg8e5VA=", + "lastModified": 1752806774, + "narHash": "sha256-4cHeoR2roN7d/3J6gT+l6o7J2hTrBIUiCwVdDNMeXzE=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b6509555d8ffaa0727f998af6ace901c5b78dc26", + "rev": "3c90219b3ba1c9790c45a078eae121de48a39c55", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index bd78667..281c665 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,10 @@ inputs = { systems.url = "github:nix-systems/default"; nixpkgs.url = "nixpkgs"; # local registry - devshell.url = "github:numtide/devshell"; + devshell = { + url = "github:numtide/devshell"; + inputs.nixpkgs.follows = "nixpkgs"; + }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; @@ -40,7 +43,8 @@ default = let pkgs = self.lib.makePkgs system nixpkgs; - pkgsWin64 = pkgs.pkgsCross.mingwW64; + pkgsWin = pkgs.pkgsCross.mingwW64; + pkgsMac = pkgs.pkgsCross.aarch64-darwin; in # pkgs.devshell.mkShell { # required for depsBuildBuild @@ -48,20 +52,24 @@ motd = ""; buildInputs = [ pkgs.bashInteractive ]; depsBuildBuild = [ - pkgsWin64.stdenv.cc - pkgsWin64.windows.pthreads + # pkgsMac.stdenv.libiconv + # pkgsWin.stdenv.cc + # pkgsWin.windows.pthreads + # pkgsMac.stdenv.cc ]; # TODO: we need to link R for rofy # nativeBuildInputs = [ - # (pkgsWin64.rWrapper.override { - # packages = [ pkgsWin64.R ]; - # threads = pkgsWin64.windows.pthreads; + # (pkgsWin.rWrapper.override { + # packages = [ pkgsWin.R ]; + # threads = pkgsWin.windows.pthreads; # }) # ]; # TODO: fixes issue undefined reference to `ts_node_end_byte' in tree-sitter # maybe we want a separate derivation to build for windows?? - TARGET_CC = "${pkgsWin64.stdenv.cc}/bin/${pkgsWin64.stdenv.cc.targetPrefix}cc"; + # TARGET_CC = "${pkgsWin.stdenv.cc}/bin/${pkgsWin.stdenv.cc.targetPrefix}cc"; + TARGET_CC = "${pkgsMac.stdenv.cc}/bin/${pkgsMac.stdenv.cc.targetPrefix}cc"; packages = with pkgs; [ + pkgsMac.clang just (radianWrapper.override { packages = (self.lib.rpkgs pkgs); @@ -72,7 +80,11 @@ (pkgs.rust-bin.selectLatestNightlyWith ( toolchain: toolchain.default.override { - targets = [ "x86_64-pc-windows-gnu" ]; + targets = [ + # "x86_64-unknown-linux-gnu" + # "x86_64-pc-windows-gnu" + "aarch64-apple-darwin" + ]; extensions = [ "rust-src" "rust-analyzer" diff --git a/justfile b/justfile index b4d6a7f..496ec2a 100644 --- a/justfile +++ b/justfile @@ -38,6 +38,9 @@ build-linux: build-windows: cargo build --release --target x86_64-pc-windows-gnu +build-macos: + cargo build --release --target aarch64-apple-darwin + build-extension $kind *args: #!/usr/bin/env bash set -euo pipefail @@ -91,8 +94,11 @@ build $version $kind: # build server just build-linux just build-windows - cp target/x86_64-unknown-linux-gnu/release/roughly release/$version/roughly - cp target/x86_64-pc-windows-gnu/release/roughly.exe release/$version/roughly.exe + just build-macos + mkdir linux-x86_64 windows-x86_64 macos-aarch64 + cp target/x86_64-unknown-linux-gnu/release/roughly release/$version/linux-x86_64/roughly + cp target/x86_64-pc-windows-gnu/release/roughly.exe release/$version/windows-x86_64/roughly.exe + cp target/aarch64-apple-darwin/release/roughly release/$version/macos-aarch64/roughly # build vscode extension (client only) rm -rf editors/code/bin @@ -101,14 +107,20 @@ build $version $kind: # build vscode extension (linux-x64) rm -rf editors/code/bin mkdir -p editors/code/bin - cp release/$version/roughly editors/code/bin - just build-extension $kind --target linux-x64 --out ../../release/$version/roughly-linux-x64.vsix + cp release/$version/linux-x86_64/roughly editors/code/bin + just build-extension $kind --target linux-x64 --out ../../release/$version/roughly/linux-x64.vsix # build vscode extension (win32-x64) rm -rf editors/code/bin mkdir -p editors/code/bin - cp release/$version/roughly.exe editors/code/bin - just build-extension $kind --target win32-x64 --out ../../release/$version/roughly-win32-x64.vsix + cp release/$version/windows-x86_64/roughly.exe editors/code/bin + just build-extension $kind --target win32-x64 --out ../../release/$version/roughly/win32-x64.vsix + + # build vscode extension (darwin-arm64) + rm -rf editors/code/bin + mkdir -p editors/code/bin + cp release/$version/macos-aarch64/roughly editors/code/bin + just build-extension $kind --target darwin-arm64 --out ../../release/$version/roughly/darwin-arm64.vsix publish-github $version: #!/usr/bin/env bash @@ -116,21 +128,24 @@ publish-github $version: git push gh release create $version \ - "release/$version/roughly#Roughly CLI (linux-x64)" \ - "release/$version/roughly.exe#Roughly CLI (win32-x64)" \ + "release/$version/linux-x86_64/roughly#Roughly CLI (linux-x64)" \ + "release/$version/windows-x86_64/roughly.exe#Roughly CLI (windows-x64)" \ + "release/$version/roughly.exe#Roughly CLI (macos-aarch64)" \ "release/$version/roughly.vsix#VS Code extension (client only)" \ - "release/$version/roughly-linux-x64.vsix#VS Code extension (linux-x64)" \ - "release/$version/roughly-win32-x64.vsix#VS Code extension (win32-x64)" \ + "release/$version/roughly/linux-x64.vsix#VS Code extension (linux-x64)" \ + "release/$version/roughly/win32-x64.vsix#VS Code extension (windows-x64)" \ + "release/$version/roughly/darwin-arm64.vsix#VS Code extension (macos-aarch64)" \ --notes "" \ --prerelease publish-github-update $version: gh release upload $version \ - "release/$version/roughly#Roughly CLI (linux-x64)" \ - "release/$version/roughly.exe#Roughly CLI (win32-x64)" \ + "release/$version/linux-x86_64/roughly#Roughly CLI (linux-x64)" \ + "release/$version/windows-x86_64/roughly.exe#Roughly CLI (windows-x64)" \ "release/$version/roughly.vsix#VS Code extension (client only)" \ - "release/$version/roughly-linux-x64.vsix#VS Code extension (linux-x64)" \ - "release/$version/roughly-win32-x64.vsix#VS Code extension (win32-x64)" \ + "release/$version/roughly/linux-x64.vsix#VS Code extension (linux-x64)" \ + "release/$version/roughly/win32-x64.vsix#VS Code extension (windows-x64)" \ + "release/$version/roughly/darwin-arm64.vsix#VS Code extension (macos-aarch64)" \ --clobber publish-marketplace $version $kind: @@ -139,8 +154,9 @@ publish-marketplace $version $kind: release_flag=$(just vsce-release-flag $kind) - just vsce publish $release_flag --packagePath ../../release/$version/roughly-linux-x64.vsix - just vsce publish $release_flag --packagePath ../../release/$version/roughly-win32-x64.vsix + just vsce publish $release_flag --packagePath ../../release/$version/roughly/linux-x64.vsix + just vsce publish $release_flag --packagePath ../../release/$version/roughly/win32-x64.vsix + just vsce publish $release_flag --packagePath ../../release/$version/roughly/darwin-arm64.vsix just vsce publish $release_flag --packagePath ../../release/$version/roughly.vsix #