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

Fix no traces getting sent on macOS #12

Merged
merged 2 commits into from
Nov 14, 2022
Merged

Fix no traces getting sent on macOS #12

merged 2 commits into from
Nov 14, 2022

Conversation

lf-
Copy link
Owner

@lf- lf- commented Nov 14, 2022

Yes, this change is absolutely baffling why it fixes the bug, but it does. I think that what happened is that even though both
/run/current-system/sw/bin/nix and the nix used by the flake are 2.11, we are still doing some kind of ABI crimes.

It seems that some kind of macOS shenanigans means that our copy of the nix::logger symbol is different than the one that Nix is using because of this, so the logger never gets overridden and we get no data.

The solution here is to ensure that the nix you call the plugin with is the same nix as it was built with, which we probably should have been doing in the first place anyway!

Yes, this change is absolutely baffling why it fixes the bug, but it does. I
think that what happened is that even though both
/run/current-system/sw/bin/nix and the nix used by the flake are 2.11, we are
still doing some kind of ABI crimes.

It seems that some kind of macOS shenanigans means that our copy of the
nix::logger symbol is different than the one that Nix is using because of this.

The solution here is to *ensure* that the nix you call the plugin with is the
same nix as it was built with, which we probably should have been doing in the
first place anyway!
@@ -33,6 +33,7 @@
# any dev tools you use in excess of the rust ones
nativeBuildInputs = old.nativeBuildInputs ++ (
with pkgs; [
nix

Choose a reason for hiding this comment

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

I think this would only fix the plugin in the context of the shell, so you probably want to also mention this restriction in the README in case the user wants to use it outside the shell (or patch in their own Nix version). However, this will be good enough for me

@lf- lf- merged commit 1d590eb into main Nov 14, 2022
@lf- lf- deleted the fix-macos-2 branch November 14, 2022 19:43
johnrichardrinehart pushed a commit to johnrichardrinehart/nix-otel that referenced this pull request Oct 29, 2023
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