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: 8.0.5 -> 8.0.6 #130201

Merged
merged 1 commit into from
Jul 22, 2021
Merged

grafana: 8.0.5 -> 8.0.6 #130201

merged 1 commit into from
Jul 22, 2021

Conversation

LeSuisse
Copy link
Contributor

Motivation for this change
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/)
  • 21.11 Release Notes (or backporting 21.05 Relase notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Result of nixpkgs-review run on x86_64-linux 1

1 package built:
  • grafana

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Jul 14, 2021
@r-rmcgibbo
Copy link

r-rmcgibbo commented Jul 14, 2021

Result of nixpkgs-review pr 130201 at 125f4f3c run on aarch64-linux 1

1 package failed to build:
1 suggestion:
  • warning: unclear-gpl

    agpl3 is a deprecated license, please check if project uses agpl3Plus or agpl3Only and change meta.license accordingly.

    Near pkgs/servers/monitoring/grafana/default.nix:60:5:

       |
    60 |     license = licenses.agpl3;
       |     ^
    

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement. Does something look off? Please file an issue or reach out on IRC.


Result of nixpkgs-review pr 130201 at 125f4f3c run on x86_64-linux 1

1 package failed to build:
1 suggestion:
  • warning: unclear-gpl

    agpl3 is a deprecated license, please check if project uses agpl3Plus or agpl3Only and change meta.license accordingly.

    Near pkgs/servers/monitoring/grafana/default.nix:60:5:

       |
    60 |     license = licenses.agpl3;
       |     ^
    

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement. Does something look off? Please file an issue or reach out on IRC.

@Ma27
Copy link
Member

Ma27 commented Jul 15, 2021

How does this work when the tag was "last changed" two hours ago: https://github.com/grafana/grafana/releases/tag/v8.0.6 ?

@LeSuisse
Copy link
Contributor Author

It cannot. The tag 8.0.6 was published yesterday and it seems it has been moved today 😐

@Ma27
Copy link
Member

Ma27 commented Jul 15, 2021

Please update to the tag which was release a few hours ago then.

@LeSuisse LeSuisse force-pushed the grafana-8.0.6 branch 2 times, most recently from 3693c18 to e1637da Compare July 15, 2021 17:22
@LeSuisse
Copy link
Contributor Author

Hum there is something strange happening here.
The SHA-256 sets for srcStatic is the same that the one currently displayed on the Grafana download page 252a4d022f4dbd9a68d07cdd0e6762d62fa53462f294781cb53e8f3d61cd8649

Screenshot Grafana download page

If I attempt to get the archive from another endpoint I get another archive with the SHA-256 827656b523e9eed3e51cba2b8e547eaa79f7656ca8a8bf735591d1210b35627a. And that does not match what's retrieved by OfBorg (04b70a13d8e4f608bac5d59f8596646f2c764abb75b8b857914db81f67cd9cb2).

I suspect something wrong happened with the release and there are some caches at play. I will try again in a few hours.

For reference I have a diffoscope HTML report of the two archives I have retrieved can be found here: https://gist.github.com/LeSuisse/4d0f7e4a0866b42499276ed1ae2f5c20

@Ma27
Copy link
Member

Ma27 commented Jul 16, 2021

@LeSuisse in case this didn't help, I'd suggest to notify Grafana's support. This could be the same problem as in #104794.

@LeSuisse
Copy link
Contributor Author

Yeah I tried to reach out to them on Twitter without luck so far. I'm trying the contact form right now.

@LeSuisse
Copy link
Contributor Author

Just to keep this ticket updated: at this time I have not heard back from Grafana Labs.

I have created a thread in their community forum so hopefully someone will notice it https://community.grafana.com/t/grafana-oss-8-0-6-tarball-checksum-does-not-always-match/50785

@LeSuisse
Copy link
Contributor Author

I heard back from Grafana Labs, the issue should now be fixed.

Thank you for your patience, yes you are right, we’ve noticed a few issues all related to this same thing.
We’re hopeful that this has been resolved as of this afternoon as it seems our CDN cache was a bit out of whack.

I tested from different endpoints, I now get the expected tarball.
The PR has been rebased.

@Ma27 Ma27 merged commit 8489d9e into NixOS:master Jul 22, 2021
@LeSuisse LeSuisse deleted the grafana-8.0.6 branch July 22, 2021 19:24
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request Jan 23, 2024
Up until now, the frontend was taken from `srcStatic`, i.e. prebuilt
from upstream. I recall at least three cases[1][2][3] where we got a hash
mismatch eventually.

Rather than spending time finding out whether or not it's a supply-chain
attack or just a build issue, I decided to implement a source-build now
with the following benefits:

* It's now actually possible to apply patches for Grafana's frontend.
* We rely a little less on third-party build systems.

Of course, patching potential vulnerabilities in transitive frontend
dependencies is still hard (let alone discovering that this package is
affected!), but that's a fundamental issue we have in nixpkgs and I
won't invent a half-baked solution just for this package, I still
consider this a step into the right direction.

The build itself mainly orients on the `yarn` commands used in the
upstream Makefile[4]. However, we can't use `fetchYarnDeps` here because
yarn v2 (a.k.a. `berry`) is in use which is why the same was done as in
`hedgedoc`, writing a custom FoD that downloads all dependencies and
writes the offline cache into `$out`[5].

Additionally there are two more notable differences to upstream:

* We patch out every dependency to `@grafana/e2e` and `cypress`. The
  first is a dependency on the latter in another version and the latter
  downloads random blobs from the Internet in postInstall. Since it's a
  testing framework (and the `e2e` package apparently a testing
  library), I decided it's not worth the effort and patched it out
  everywhere.

* There was a `zoneinfo.zip` in `$out/share/grafana/tools` that was
  installed from `srcStatic`. This only seems to be used on Windows[6]
  and that's not supported by this package, so I decided to drop it.

[1] NixOS#251479
[2] NixOS#130201
[3] NixOS#104794
[4] https://github.com/grafana/grafana/blob/v10.3.1/Makefile
[5] NixOS#245170
[6] https://github.com/grafana/grafana/blob/v10.3.1/pkg/setting/setting.go#L1012-L1014
Ma27 added a commit to Ma27/nixpkgs that referenced this pull request May 26, 2024
Up until now, the frontend was taken from `srcStatic`, i.e. prebuilt
from upstream. I recall at least three cases[1][2][3] where we got a hash
mismatch eventually.

Rather than spending time finding out whether or not it's a supply-chain
attack or just a build issue, I decided to implement a source-build now
with the following benefits:

* It's now actually possible to apply patches for Grafana's frontend.
* We rely a little less on third-party build systems.

Of course, patching potential vulnerabilities in transitive frontend
dependencies is still hard (let alone discovering that this package is
affected!), but that's a fundamental issue we have in nixpkgs and I
won't invent a half-baked solution just for this package, I still
consider this a step into the right direction.

The build itself mainly orients on the `yarn` commands used in the
upstream Makefile[4]. However, we can't use `fetchYarnDeps` here because
yarn v2 (a.k.a. `berry`) is in use which is why the same was done as in
`hedgedoc`, writing a custom FoD that downloads all dependencies and
writes the offline cache into `$out`[5].

Additionally there are two more notable differences to upstream:

* We patch out every dependency to `@grafana/e2e` and `cypress`. The
  first is a dependency on the latter in another version and the latter
  downloads random blobs from the Internet in postInstall. Since it's a
  testing framework (and the `e2e` package apparently a testing
  library), I decided it's not worth the effort and patched it out
  everywhere.

* There was a `zoneinfo.zip` in `$out/share/grafana/tools` that was
  installed from `srcStatic`. This only seems to be used on Windows[6]
  and that's not supported by this package, so I decided to drop it.

[1] NixOS#251479
[2] NixOS#130201
[3] NixOS#104794
[4] https://github.com/grafana/grafana/blob/v10.3.1/Makefile
[5] NixOS#245170
[6] https://github.com/grafana/grafana/blob/v10.3.1/pkg/setting/setting.go#L1012-L1014

(cherry picked from commit 608db26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants