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

Make the root Makefile macOS compatible #2614

Merged
merged 2 commits into from
Apr 15, 2024
Merged

Conversation

iamluc
Copy link
Contributor

@iamluc iamluc commented Apr 4, 2024

Description

Make make install works out of the box on MacOS, like on Linux.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

config.m4 Outdated
@@ -306,7 +306,7 @@ EOT
if test "$PHP_DDTRACE_SIDECAR_MOCKGEN" != "-"; then
ddtrace_mockgen_invocation="HOST= TARGET= $PHP_DDTRACE_SIDECAR_MOCKGEN"
else
ddtrace_mockgen_invocation="cd \"$ext_srcdir/components-rs/php_sidecar_mockgen\"; HOST= TARGET= CARGO_TARGET_DIR=\$(builddir)/target/ \$(DDTRACE_CARGO) run"
ddtrace_mockgen_invocation="cd \"$ext_srcdir/components-rs/php_sidecar_mockgen\"; HOST=$(rustc -vV | sed -n 's|host: ||p') TARGET=$(rustc -vV | sed -n 's|host: ||p') CARGO_TARGET_DIR=\$(builddir)/target/ \$(DDTRACE_CARGO) run"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't rely on rustc being in PATH (that's also why we do have e.g. AC_CHECK_TOOL(DDTRACE_CARGO, cargo, [:]) for cargo).

If this is specifically a problem with our Makefile, it must be an interaction with the Makefile. After all, it works when run isolated. I'd rather fix the Makefile than changing config.m4 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the context, it seems the host & target settings require a non-empty string for non-Linux platform.
It works on macOS when run isolated because the cc crate is locked to version 1.0.83 where this restriction does not seem to exist.
The error occurs with our Makefile because the latest cc crate version is used instead (1.0.92 at the time of writing).

But to avoid the dependency on the rustc binary, I moved the detection to the sidecar mockgen code directly.
WDYT?

@iamluc iamluc force-pushed the lv/macos-makefile-compatibility branch 3 times, most recently from fadc225 to 2de75af Compare April 11, 2024 09:12
@pr-commenter
Copy link

pr-commenter bot commented Apr 11, 2024

Benchmarks

Benchmark execution time: 2024-04-15 07:36:47

Comparing candidate commit 54775b9 in PR branch lv/macos-makefile-compatibility with baseline commit e721e34 in branch master.

Found 0 performance improvements and 4 performance regressions! Performance is the same for 174 metrics, 0 unstable metrics.

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟥 execution_time [+13.076µs; +15.805µs] or [+7.520%; +9.089%]

scenario:PDOBench/benchPDOOverhead-opcache

  • 🟥 execution_time [+14.781µs; +15.883µs] or [+8.551%; +9.189%]

scenario:PDOBench/benchPDOOverheadWithDBM-opcache

  • 🟥 execution_time [+15.674µs; +18.078µs] or [+9.034%; +10.421%]

scenario:TraceSerializationBench/benchSerializeTrace

  • 🟥 execution_time [+11.887µs; +16.113µs] or [+6.571%; +8.907%]

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2024

Codecov Report

Merging #2614 (54775b9) into master (e721e34) will increase coverage by 1.57%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2614      +/-   ##
============================================
+ Coverage     77.64%   79.21%   +1.57%     
  Complexity     2226     2226              
============================================
  Files           226      200      -26     
  Lines         25942    21942    -4000     
  Branches        986        0     -986     
============================================
- Hits          20142    17382    -2760     
+ Misses         5274     4560     -714     
+ Partials        526        0     -526     
Flag Coverage Δ
appsec-extension ?
tracer-extension 78.54% <ø> (ø)
tracer-php 80.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 26 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e721e34...54775b9. Read the comment docs.

@iamluc iamluc marked this pull request as ready for review April 12, 2024 07:10
@iamluc iamluc requested review from a team as code owners April 12, 2024 07:10
Copy link
Collaborator

@bwoebi bwoebi left a comment

Choose a reason for hiding this comment

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

Okay, looks good then :-)

@iamluc iamluc force-pushed the lv/macos-makefile-compatibility branch from 2de75af to 54775b9 Compare April 15, 2024 07:10
@bwoebi bwoebi merged commit fe3066b into master Apr 15, 2024
536 of 556 checks passed
@bwoebi bwoebi deleted the lv/macos-makefile-compatibility branch April 15, 2024 14:43
@github-actions github-actions bot added this to the 0.99.0 milestone Apr 15, 2024
@bwoebi bwoebi modified the milestones: 0.99.0, 1.0.0beta1 Apr 15, 2024
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.

3 participants