Skip to content

Support MacOS#3174

Draft
Claude wants to merge 7 commits into
mainfrom
claude/add-macos-support
Draft

Support MacOS#3174
Claude wants to merge 7 commits into
mainfrom
claude/add-macos-support

Conversation

@Claude
Copy link
Copy Markdown
Contributor

@Claude Claude AI commented Mar 15, 2026

Original prompt

This section details on the original issue you should resolve

<issue_title>MacOS support</issue_title>
<issue_description>The release files are debs. If I download the source and run otel.sh I get

exec: Failed to execute process './usr/bin/otel.sh': The file specified the interpreter '/bin/false', which is not an executable command.

So, I'm assuming the scripts are making some Linux-specific assumptions.

A version that runs on MacOS would be great, if you're not planning that, a note about OS support in the README would be great.

If making the scripts MacOS compatible seems like it's not impossible, any notes on how to get it working would be helpful.</issue_description>

Comments on the Issue (you are @claude[agent] in this section)

@plengauer @smith it looks like you have tried to run it directly, but it needs to be sourced rather than executed. in the readme, there is a space between the `.` and the `otel.sh`. the file is not intended to run directly, therefore the `/bin/false` shebang.

that being said, i never tried to run it anything non-linux. the code itself doesnt have a lot (if any) linux specifics, but it uses a bunch of external dependencies (like cut, tr, grep, awk, sed, ...) that need to be installed (as per the debian control file at https://github.com/plengauer/opentelemetry-bash/blob/e7ff252a6026fecfc149b8a5472a4512f286e9b2/src/DEBIAN/control).
assuming the same external executables can be installed on a mac system, i dont see why it wouldnt work.

let me think about that more

PS: your point about adding a note about OS support is definitely a good one!</comment_new>
<comment_new>@plengauer
Needs
*) a dedicated build step to build whatever thr native mac package type is in build.yml
*) package meta info in meta dir
*) a mac job like the linux/windows shell jobs in test
Test_shell.yml
*) replacing all accesses to /proc with something equivalent. This should not be dynamic, but rather functions should be defined differently once. For that, check if the dir /proc exists
*) everywhere where there is something os specific, there needs to a new case. For example, where dpkg is used
*) tests that are designed for Linux envs, like debconf should be skipped on mac
*) readme needs an entry that mac is supported additional to windows and linux
Linux
*) the root level install scripts needs adjustments to handle</comment_new>

@Claude Claude AI changed the title [WIP] Add MacOS support for the release files Add macOS support for OpenTelemetry shell instrumentation Mar 15, 2026
@Claude Claude AI requested a review from plengauer March 15, 2026 09:19
Copy link
Copy Markdown
Owner

@plengauer plengauer left a comment

Choose a reason for hiding this comment

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

@claude[agent] please address requests

Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/test_shell.yml Outdated
Comment thread actions/instrument/shared/install.sh
Comment thread src/usr/share/opentelemetry_shell/agent.instrumentation.curl.sh Outdated
Comment thread src/usr/share/opentelemetry_shell/agent.instrumentation.wget.sh Outdated
Comment thread src/usr/share/opentelemetry_shell/agent.instrumentation.wget.sh Outdated
Comment thread src/usr/share/opentelemetry_shell/agent.instrumentation.wget.sh Outdated
Comment thread src/usr/share/opentelemetry_shell/api.observe.subprocesses.sh Outdated
@Claude Claude AI changed the title Add macOS support for OpenTelemetry shell instrumentation Addressing PR comments Mar 15, 2026
@Claude Claude AI requested a review from plengauer March 15, 2026 13:29
@plengauer plengauer changed the title Addressing PR comments Support MacOS Mar 15, 2026
@plengauer
Copy link
Copy Markdown
Owner

@claude[agent] rebase and resolve conflicts

- Add macOS dynamic library support (.dylib) for HTTP header injection
- Use DYLD_INSERT_LIBRARIES on macOS instead of LD_PRELOAD
- Add fallback to SHELL variable when /proc filesystem is unavailable
- Add Homebrew package formula and tap support
- Update build workflow to compile .dylib for macOS (arm64, x86_64)
- Rename build-http to build-http-linux for consistency
- Add build-http-macos job with clang compilation
- Update artifact naming with platform prefixes (http_linux_*, http_macos_*)
- Add macOS runners to test matrix (macos-latest, macos-13)
- Add Homebrew cache invalidation for instrumentation cache
- Update INSTALL.sh to support Homebrew installation on macOS
- Update GitHub Actions scripts to handle macOS platform detection
- Skip strace-based subprocess observation on macOS (not available)
- Add platform guards for /proc filesystem access throughout codebase

All changes maintain backward compatibility with Linux while enabling
full macOS support for both arm64 and x86_64 architectures.

Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
@Claude Claude AI force-pushed the claude/add-macos-support branch from 8b8be9f to af80e22 Compare April 11, 2026 15:36
@Claude
Copy link
Copy Markdown
Contributor Author

Claude AI commented Apr 11, 2026

@claude[agent] rebase and resolve conflicts

Rebase completed! The branch has been rebased onto the latest main and force-pushed. All macOS changes have been cleanly reapplied in commit af80e22.

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.

MacOS support

2 participants