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

deno: use brew-provided function for checking binary linkage #205851

Merged
merged 1 commit into from
Jan 29, 2025
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
12 changes: 3 additions & 9 deletions Formula/d/deno.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,9 @@ def install
generate_completions_from_executable(bin/"deno", "completions")
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"

IO.popen("deno run -A -r https://fresh.deno.dev fresh-project", "r+") do |pipe|
pipe.puts "n"
pipe.puts "n"
Expand All @@ -170,7 +164,7 @@ def check_binary_linkage(binary, library)
]
end
linked_libraries.each do |library|
assert check_binary_linkage(bin/"deno", library),
assert Utils.binary_linked_to_library?(bin/"deno", library),
"No linkage with #{library.basename}! Cargo is likely using a vendored version."
end
end
Expand Down
Loading