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

grafana-loki: 1.6.1 -> 2.0.0 #101986

Merged
merged 1 commit into from Oct 31, 2020
Merged

grafana-loki: 1.6.1 -> 2.0.0 #101986

merged 1 commit into from Oct 31, 2020

Conversation

mweinelt
Copy link
Member

@mweinelt mweinelt commented Oct 29, 2020

Motivation for this change

ALERTING!

Convert to use buildGoModule and add a patch (by @andir) for a test failing on
golang>=1.15.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Convert to use buildGoModule and add a patch for a test failing on
golang>=1.15.
Copy link
Member

@dasJ dasJ left a comment

Choose a reason for hiding this comment

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

That's an ALERTING change

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 101986 run on x86_64-darwin 1

1 package failed to build:
  • grafana-loki

@andir
Copy link
Member

andir commented Oct 29, 2020

Result of nixpkgs-review pr 101986 run on x86_64-darwin 1
1 package failed to build:

* grafana-loki

Did it work previously?

@mweinelt
Copy link
Member Author

Result of nixpkgs-review pr 101986 run on x86_64-darwin 1
1 package failed to build:

* grafana-loki

Can you be more specific about the failure?

@SuperSandro2000
Copy link
Member

Have a little patience. The tests are running in the background.

I am not sure which test failed and why so I just uploaded the entire log:

https://termbin.com/b1gn

@mweinelt
Copy link
Member Author

mweinelt commented Oct 29, 2020

All errors about something network related not working on Darwin. The tests cannot bind to 127.0.0.1:0 (random port) and cannot lookup localhost. 😞

=== RUN   TestPromtail
    promtail_test.go:92: error creating promtail listen tcp: lookup localhost: no such host
    promtail_test.go:79: Failed to start web server to receive logs: listen tcp: lookup localhost: no such host
--- FAIL: TestPromtail (0.00s)
--- FAIL: TestClient_Handle (0.00s)
    --- FAIL: TestClient_Handle/batch_log_entries_together_until_the_batch_size_is_reached (0.00s)
panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted [recovered]
	panic: httptest: failed to listen on a port: listen tcp6 [::1]:0: bind: operation not permitted
=== RUN   TestPushTarget
    pushtarget_test.go:37: 
        	Error Trace:	pushtarget_test.go:37
        	Error:      	Received unexpected error:
        	            	listen tcp 127.0.0.1:0: bind: operation not permitted
        	Test:       	TestPushTarget
--- FAIL: TestPushTarget (0.00s)

@marsam
Copy link
Contributor

marsam commented Oct 29, 2020

@SuperSandro2000 I think it's failing because nixpkgs-review uses --option build-use-sandbox by default, and sanboxing is not fully functional on darwin

@SuperSandro2000
Copy link
Member

Maybe we just disable the tests on Darwin? I don't want to block this update nor break darwin with updates.

@mweinelt
Copy link
Member Author

Maybe we just disable the tests on Darwin? I don't want to block this update nor break darwin with updates.

You could just retry building this without sandboxing, as @marsam indicated this could be the culprit.

@mweinelt
Copy link
Member Author

Similarly localhost is not namespaced either, if multiple builds try to listen on the same port at the same time one of them will fail. Because of this the nix sandbox needs explicit whitelisting of builds that are allowed to do this with __darwinAllowLocalNetworking = true;.

#58147 (comment)

I could try adding this one as well.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 29, 2020

Building without sandbox results in a success. Learned something again.

I am currently running a newer version of nixpkgs-review to have the platform indication. Maybe thats the culprit?

Anyway how should I handle sandbox fails on Darwin?

Copy link
Member

@WilliButz WilliButz left a comment

Choose a reason for hiding this comment

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

I think disabling the check phase on Darwin is ok, though I am not familiar enough with that ecosystem to know what the optimal solution would be. Otherwise LGTM 👍

@andir
Copy link
Member

andir commented Oct 30, 2020 via email

@WilliButz
Copy link
Member

@andir yeah that was the first thing I checked ^^. They have tarballs for darwin in their release assets (for example: https://github.com/grafana/loki/releases/tag/v2.0.0).

@marsam
Copy link
Contributor

marsam commented Oct 31, 2020

Anyway how should I handle sandbox fails on Darwin?

IMHO it's okay if a test fails wanting networking with loopback on darwin, because it's the only networking allowed within a sandboxed build.
Personally, I don't want to add __darwinAllowLocalNetworking = true; because it doesn't seem to be documented anywhere.

@marsam marsam merged commit 2faef82 into NixOS:master Oct 31, 2020
@SuperSandro2000
Copy link
Member

Personally, I don't want to add __darwinAllowLocalNetworking = true; because it doesn't seem to be documented anywhere.

And it does not need to be honored by the sandbox.

@marsam
Copy link
Contributor

marsam commented Oct 31, 2020

it's honored within sandboxed builds on Darwin NixOS/nix@4a4a009, but not documented

@mweinelt mweinelt deleted the loki2 branch October 31, 2020 21:28
@mweinelt mweinelt mentioned this pull request Dec 25, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants