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

Stop using shell #74

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Stop using shell #74

merged 1 commit into from
Mar 1, 2024

Conversation

noahsmartin
Copy link
Member

No description provided.

@@ -153,11 +153,7 @@ public class StackSymbolicator {
let strs = addrsArray.map { String($0 + addition, radix: 16) }
try! strs.joined(separator: "\n").write(toFile: addrsFile, atomically: true, encoding: .utf8)

let arch = try? safeShellWithOutput("/usr/bin/file \"\(binary)\"").contains("arm64e") ? "arm64e" : "arm64"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arch flag doesn't seem to be needed as long as it isn't a universal binary, and this wasn't making an effort to pick the right arch from a universal binary anyways

@@ -153,11 +153,7 @@ public class StackSymbolicator {
let strs = addrsArray.map { String($0 + addition, radix: 16) }
try! strs.joined(separator: "\n").write(toFile: addrsFile, atomically: true, encoding: .utf8)

let arch = try? safeShellWithOutput("/usr/bin/file \"\(binary)\"").contains("arm64e") ? "arm64e" : "arm64"

try! strs.joined(separator: "\n").write(toFile: addrsFile, atomically: true, encoding: .utf8)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was already written on line 154

task.executableURL = URL(fileURLWithPath: executable)
task.standardInput = nil

let group = DispatchGroup()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you share the pipe processing logic with safeShellWithOutput()?

@noahsmartin noahsmartin merged commit 1bf6918 into main Mar 1, 2024
1 check passed
@noahsmartin noahsmartin deleted the stopUsingShell branch March 1, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants