Skip to content
Draft
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion editors/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
34 changes: 10 additions & 24 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 21 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -40,28 +43,33 @@
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
pkgs.mkShell {
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);
Expand All @@ -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"
Expand Down
48 changes: 32 additions & 16 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -101,36 +107,45 @@ 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
set -euo pipefail

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:
Expand All @@ -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

#
Expand Down