Skip to content

Commit

Permalink
Merge pull request Homebrew#205850 from Homebrew/code-cli-binary-linkage
Browse files Browse the repository at this point in the history
code-cli: use brew-provided function for checking binary linkage
  • Loading branch information
BrewTestBot authored Jan 29, 2025
2 parents 4e797c4 + 9cef17a commit 7b2f972
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Formula/c/code-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ def install
end
end

def check_binary_linkage(binary, library)
binary.dynamically_linked_libraries.any? do |dll|
next false unless dll.start_with?(HOMEBREW_PREFIX.to_s)

File.realpath(dll) == File.realpath(library)
end
end

test do
require "utils/linkage"

assert_match "Successfully removed all unused servers",
shell_output("#{bin}/code tunnel prune")
assert_match version.to_s, shell_output("#{bin}/code --version")
Expand All @@ -64,7 +58,7 @@ def check_binary_linkage(binary, library)
]

linked_libraries.each do |library|
assert check_binary_linkage(bin/"code", library),
assert Utils.binary_linked_to_library?(bin/"code", library),
"No linkage with #{library.basename}! Cargo is likely using a vendored version."
end
end
Expand Down

0 comments on commit 7b2f972

Please sign in to comment.