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

bazel-remote: 1.0.0 -> 2.0.1 #98983

Merged
merged 1 commit into from May 17, 2021
Merged

Conversation

uri-canva
Copy link
Contributor

@uri-canva uri-canva commented Sep 28, 2020

Motivation for this change

Upgrade bazel-remote

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.

@Profpatsch
Copy link
Member

The linux build has a wrong hash:

hash mismatch in fixed-output derivation '/nix/store/xf6vs1qd0m2yklhi4l7085y1xkx9zjzr-bazel-remote-1.2.0-deps.tar.gz':
  wanted: sha256:1b6252cz26qwc5nvd34ld3fr908bz55w136x9y27yx39z5ynnbb8
  got:    sha256:0063gdrjirh7jjrnj3sannwf5134sq40l3qk3ffa29l0ka5m5qmj
cannot build derivation '/nix/store/0w717cm8cd1s2fdp28z0lkpgbarc2ryv-bazel-remote-1.2.0.drv': 1 dependencies couldn't be built

@uri-canva
Copy link
Contributor Author

Yeah there must be some non-deterministic output in the dependencies. I'll have to diff them.

@Profpatsch
Copy link
Member

Profpatsch commented Oct 9, 2020 via email

@teto
Copy link
Member

teto commented Oct 22, 2020

I get a hash error too locally sha256-TACUGccNKVF6EyxSjNA4NDnR6BHOiR7OHughClW91Oo= .

@teto
Copy link
Member

teto commented Oct 22, 2020

sry to hijack the thread a bit but I've tried to upgrade to 1.2.0 in an overlay

  bazel-remote = super.bazel-remote.overrideAttrs(oa: rec {
    version = "1.2.0";
    name = "bazel-remote-1.2.0";
    # oa
    nativeBuildInputs = oa.nativeBuildInputs ++ [ self.python ];
    src = self.fetchFromGitHub {
      owner = "buchgr";
      repo = "bazel-remote";
      rev = "v${version}";
      sha256 = "1ycffgm5p4xx7dnx2k1bfalwn0s1468849601s4x7fbwmnyp8sjz";
    };
    # bazel deps are a derivation themselves
    deps = oa.deps.overrideAttrs(depsOa: {
      name = "${name}-deps.tar.gz";

      nativeBuildInputs = depsOa.nativeBuildInputs ++ [ self.python ];
      outputHash =   "sha256-cY9WyrnvGhY0wphC3v6JUvFf7BpnMgJ6dy5HOsCq7tQ=";
    });
    # patches = oa.patches ++ [ ./bazel-remote/force-download.patch ];
  });

but when running it I get

^M^MLoading: 0 packages loaded
    Fetching @pip_deps; fetching 7s
^M^MLoading: 0 packages loaded
    Fetching @pip_deps; fetching 8s
^M^MINFO: Repository pip_deps instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule pip_import defined at:
  /build/output/external/rules_python/python/pip.bzl:42:29: in <toplevel>
Loading: 0 packages loaded
    Fetching @pip_deps; fetching 8s
^M^MERROR: An error occurred during the fetch of repository 'pip_deps':
   pip_import failed: Collecting six==1.11.0 (from -r /build/output/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 2))
 (  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff698d2d0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/six/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff698d610>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/six/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff698d790>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/six/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff698d910>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/six/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ffff698da90>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/six/
  Could not find a version that satisfies the requirement six==1.11.0 (from -r /build/output/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 2)) (from versions: )
No matching distribution found for six==1.11.0 (from -r /build/output/external/io_bazel_rules_docker/repositories/requirements-pip.txt (line 2))

and I have no idea why. I tried callPackage on your default.nix and the build went fine. My overlay uses the same buildBazelPackage implementation and all I dont know what I am missing.

Feel free to ignore the question though, it's just that I dont get it :/

@teto
Copy link
Member

teto commented Mar 31, 2021

Nevermind my previous message, it worked. still the hash seems non deterministic. Maybe it's fixed in the 1.3.1 version ?

@uri-canva
Copy link
Contributor Author

It went up a whole major version, so I'll start again from there: https://github.com/buchgr/bazel-remote/releases

@uri-canva
Copy link
Contributor Author

Switch this to build using buildGoModule rather than buildBazelPackage. The instructions in the repo say to use bazel, but looking at the bazel files the only difference is that main.gitCommit isn't set, which we probably don't want to set anyway, since it doesn't really correspond to what upstream would consider a regular build at that commit.

Building using buildBazelPackage seems to be hard because of bazelbuild/rules_go#2377, which will require patching our own nix based go toolchain into the build.

@uri-canva uri-canva marked this pull request as ready for review May 7, 2021 02:54
@uri-canva uri-canva requested review from Profpatsch and teto May 7, 2021 02:55
@uri-canva uri-canva changed the title bazel-remote: 1.0.0 -> 1.2.0 bazel-remote: 1.0.0 -> 2.0.1 May 7, 2021
@ofborg ofborg bot requested a review from kalbasit May 7, 2021 02:58
@uri-canva
Copy link
Contributor Author

ping @kalbasit @Profpatsch

@Profpatsch
Copy link
Member

I’m not doing much with bazel anymore, but if it builds & works LGTM

@teto
Copy link
Member

teto commented May 14, 2021

it compiles and seems to work. Seems to save results in a new format too: in a cas2 subfolder.

@uri-canva uri-canva requested a review from mboes May 15, 2021 00:26
install -Dm755 bazel-bin/*_pure_stripped/bazel-remote $out/bin/bazel-remote
'';
};
doCheck = false;

meta = with lib; {
homepage = "https://github.com/buchgr/bazel-remote";
description = "A remote HTTP/1.1 cache for Bazel";
license = licenses.asl20;
maintainers = [ maintainers.uri-canva ];
platforms = platforms.darwin ++ platforms.linux;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
platforms = platforms.darwin ++ platforms.linux;

set by buildGoModule.

install -Dm755 bazel-bin/*_pure_stripped/bazel-remote $out/bin/bazel-remote
'';
};
doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why are tests disabled?

Copy link
Member

Choose a reason for hiding this comment

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

Presumably cause they don’t work? I wouldn’t give too much thought about this.

@Profpatsch Profpatsch merged commit a975c80 into NixOS:master May 17, 2021
@uri-canva uri-canva deleted the bazel-remote branch June 29, 2023 01:49
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

4 participants