Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code-server 4.96.1 #201715

Merged
merged 2 commits into from
Dec 21, 2024
Merged
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
52 changes: 33 additions & 19 deletions Formula/c/code-server.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
class CodeServer < Formula
desc "Access VS Code through the browser"
homepage "https://github.com/coder/code-server"
url "https://registry.npmjs.org/code-server/-/code-server-4.93.1.tgz"
sha256 "c6204fbb323f2950a42c49b88a2fc2d02b45d4cf684e88b220d9fe1fda3f9a0a"
url "https://registry.npmjs.org/code-server/-/code-server-4.96.1.tgz"
sha256 "024955288ccfd3c4b2e8737a17ee7e4ee9877ed7d493e8dc7b3f556b12dbfb1d"
license "MIT"

bottle do
sha256 arm64_sequoia: "d60aa5731fcc2e9302b5b375269bf9064580e3b9d2c69a92e7f9a1169241e609"
sha256 arm64_sonoma: "051599c8f13b38e01b6e3b8dc397135913463d046bab2cd219977ef109eb5fc3"
sha256 arm64_ventura: "0bfa49c4fcd3947473d3bd579fceae7f30dd2f155ec9097001f23d2c9c612b27"
sha256 sonoma: "7fc1f86fa5955cd58e79e021f59a38dd61a353275c9619cba48b952d573c198c"
sha256 ventura: "c5f1ed0fdd96c7c350af2ccfb0dd40796feb7867e9595330887ec67e370d7c43"
sha256 cellar: :any_skip_relocation, x86_64_linux: "37a4e616197dce8aa9ef656796411b952d9ed3a723663f46ecc0f0723041a002"
sha256 cellar: :any_skip_relocation, arm64_sequoia: "b1a0b4a60336b6e7a43d5690f77c59ec2d76aadc8664ff1ba6e503bec07046c4"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "4cd794d40e45a4c27a115d79923d6664c829875734506e75f017b4afacc2cf33"
sha256 cellar: :any_skip_relocation, arm64_ventura: "858cb31911ae6753ed1d478e7140ba0d5fd014d5f726993945a2c2c1e70445fc"
sha256 cellar: :any_skip_relocation, sonoma: "0b3df3665a71ebca33b8b74278134e9d584201b9a83f54c49eaec49cb8f5b3f8"
sha256 cellar: :any_skip_relocation, ventura: "2db7a845d02e94b0e72b83400835ded35e54a88784404d042f3b348ccfa365ef"
sha256 cellar: :any_skip_relocation, x86_64_linux: "5efb4f51fe4068b6fb796e5f7b2d6c665dd59dc6142b8b47320f2e877280cd4a"
end

depends_on "node@20"
Expand All @@ -30,17 +30,17 @@ def install
# Fix broken node-addon-api: https://github.com/nodejs/node/issues/52229
ENV.append "CXXFLAGS", "-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT"

system "npm", "install", *std_npm_args
bin.install_symlink libexec.glob("bin/*")
system "npm", "install", *std_npm_args(prefix: false), "--unsafe-perm", "--omit", "dev"

libexec.install Dir["*"]
bin.install_symlink libexec/"out/node/entry.js" => "code-server"

# Remove incompatible pre-built binaries
os = OS.kernel_name.downcase
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s
vscode = libexec/"lib/node_modules/code-server/lib/vscode"
vscode.glob("{,extensions/}node_modules/@parcel/watcher/prebuilds/*")
.each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }
vscode.glob("{,extensions/}node_modules/@parcel/watcher/prebuilds/linux-x64/*.musl.node")
.map(&:unlink)
vscode = libexec/"lib/vscode/node_modules/@parcel/watcher/prebuilds"
vscode.glob("*").each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" }
vscode.glob("linux-x64/*.musl.node").map(&:unlink)
end

def caveats
Expand All @@ -58,9 +58,23 @@ def caveats
end

test do
# See https://github.com/cdr/code-server/blob/main/ci/build/test-standalone-release.sh
system bin/"code-server", "--extensions-dir=.", "--install-extension", "wesbos.theme-cobalt2"
output = shell_output("#{bin}/code-server --extensions-dir=. --list-extensions")
assert_match "wesbos.theme-cobalt2", output
assert_match version.to_s, shell_output("#{bin}/code-server --version")

port = free_port
output = ""

PTY.spawn "#{bin}/code-server --auth none --port #{port}" do |r, _w, pid|
sleep 3
Process.kill("TERM", pid)
begin
r.each_line { |line| output += line }
rescue Errno::EIO
# GNU/Linux raises EIO when read is done on closed pty
end
ensure
Process.wait(pid)
end
assert_match "HTTP server listening on", output
assert_match "Session server listening on", output
end
end
Loading