Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1b5df99e7aef
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9ecb2c4f721b
Choose a head ref
  • 6 commits
  • 6 files changed
  • 4 contributors

Commits on Nov 19, 2019

  1. Copy the full SHA
    61c60ba View commit details
  2. vimPlugins: backoff on timeout in update.py

    Updating vim-plugins recently started timing out regularly for me. It
    may have to do with an ISP switch on my side, but I don't think that
    should cause timeouts. I guess I'm probably not the only one
    experiencing this, so in this comment I introduce exponential backoff.
    Every request will be retried up to 3 times (3 seconds, 6 seconds, 12
    seconds delay).
    timokau committed Nov 19, 2019
    Copy the full SHA
    8c757f4 View commit details

Commits on Nov 27, 2019

  1. Copy the full SHA
    d1cf282 View commit details
  2. Copy the full SHA
    3f86f21 View commit details
  3. Copy the full SHA
    6225fc5 View commit details
  4. vimPlugins: backoff on timeout in update.py (#73499)

    vimPlugins: backoff on timeout in update.py
    Mic92 authored Nov 27, 2019
    Copy the full SHA
    9ecb2c4 View commit details
18 changes: 11 additions & 7 deletions nixos/tests/nextcloud/basic.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ../make-test.nix ({ pkgs, ...}: let
import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "notproduction";
adminuser = "root";
in {
@@ -50,11 +50,15 @@ in {
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
'';
in ''
startAll();
$nextcloud->waitForUnit("multi-user.target");
$nextcloud->succeed("curl -sSf http://nextcloud/login");
$nextcloud->succeed("${withRcloneEnv} ${copySharedFile}");
$client->waitForUnit("multi-user.target");
$client->succeed("${withRcloneEnv} ${diffSharedFile}");
start_all()
nextcloud.wait_for_unit("multi-user.target")
nextcloud.succeed("curl -sSf http://nextcloud/login")
nextcloud.succeed(
"${withRcloneEnv} ${copySharedFile}"
)
client.wait_for_unit("multi-user.target")
client.succeed(
"${withRcloneEnv} ${diffSharedFile}"
)
'';
})
21 changes: 12 additions & 9 deletions nixos/tests/nextcloud/with-mysql-and-memcached.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ../make-test.nix ({ pkgs, ...}: let
import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "hunter2";
adminuser = "root";
in {
@@ -85,13 +85,16 @@ in {
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
'';
in ''
startAll();
$nextcloud->waitForUnit("multi-user.target");
$nextcloud->succeed("${configureMemcached}");
$nextcloud->succeed("curl -sSf http://nextcloud/login");
$nextcloud->succeed("${withRcloneEnv} ${copySharedFile}");
$client->waitForUnit("multi-user.target");
$client->succeed("${withRcloneEnv} ${diffSharedFile}");
start_all()
nextcloud.wait_for_unit("multi-user.target")
nextcloud.succeed("${configureMemcached}")
nextcloud.succeed("curl -sSf http://nextcloud/login")
nextcloud.succeed(
"${withRcloneEnv} ${copySharedFile}"
)
client.wait_for_unit("multi-user.target")
client.succeed(
"${withRcloneEnv} ${diffSharedFile}"
)
'';
})
20 changes: 12 additions & 8 deletions nixos/tests/nextcloud/with-postgresql-and-redis.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ../make-test.nix ({ pkgs, ...}: let
import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "hunter2";
adminuser = "custom-admin-username";
in {
@@ -85,12 +85,16 @@ in {
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
'';
in ''
startAll();
$nextcloud->waitForUnit("multi-user.target");
$nextcloud->succeed("${configureRedis}");
$nextcloud->succeed("curl -sSf http://nextcloud/login");
$nextcloud->succeed("${withRcloneEnv} ${copySharedFile}");
$client->waitForUnit("multi-user.target");
$client->succeed("${withRcloneEnv} ${diffSharedFile}");
start_all()
nextcloud.wait_for_unit("multi-user.target")
nextcloud.succeed("${configureRedis}")
nextcloud.succeed("curl -sSf http://nextcloud/login")
nextcloud.succeed(
"${withRcloneEnv} ${copySharedFile}"
)
client.wait_for_unit("multi-user.target")
client.succeed(
"${withRcloneEnv} ${diffSharedFile}"
)
'';
})
4 changes: 2 additions & 2 deletions pkgs/applications/misc/kitty/default.nix
Original file line number Diff line number Diff line change
@@ -21,14 +21,14 @@
with python3Packages;
buildPythonApplication rec {
pname = "kitty";
version = "0.14.6";
version = "0.15.0";
format = "other";

src = fetchFromGitHub {
owner = "kovidgoyal";
repo = "kitty";
rev = "v${version}";
sha256 = "1rb5ys9xsdhd2qa3kz5gqzz111c6b14za98va6hlglk69wqlmb51";
sha256 = "1gh8lcyqpkwvmjxwiq5d43sd43bg3c49fyy2x8drqdzj34gc49qg";
};

buildInputs = [
26 changes: 23 additions & 3 deletions pkgs/build-support/build-bazel-package/default.nix
Original file line number Diff line number Diff line change
@@ -4,10 +4,30 @@
, lib
}:

args@{ name, bazelFlags ? [], bazelBuildFlags ? [], bazelFetchFlags ? [], bazelTarget, buildAttrs, fetchAttrs, ... }:
args@{
name
, bazelFlags ? []
, bazelBuildFlags ? []
, bazelFetchFlags ? []
, bazelTarget
, buildAttrs
, fetchAttrs

# Newer versions of Bazel are moving away from built-in rules_cc and instead
# allow fetching it as an external dependency in a WORKSPACE file[1]. If
# removed in the fixed-output fetch phase, building will fail to download it.
# This can be seen e.g. in #73097
#
# This option allows configuring the removal of rules_cc in cases where a
# project depends on it via an external dependency.
#
# [1]: https://github.com/bazelbuild/rules_cc
, removeRulesCC ? true
, ...
}:

let
fArgs = removeAttrs args [ "buildAttrs" "fetchAttrs" ];
fArgs = removeAttrs args [ "buildAttrs" "fetchAttrs" "removeRulesCC" ];
fBuildAttrs = fArgs // buildAttrs;
fFetchAttrs = fArgs // removeAttrs fetchAttrs [ "sha256" ];

@@ -60,7 +80,7 @@ in stdenv.mkDerivation (fBuildAttrs // {
# Remove all built in external workspaces, Bazel will recreate them when building
rm -rf $bazelOut/external/{bazel_tools,\@bazel_tools.marker}
rm -rf $bazelOut/external/{rules_cc,\@rules_cc.marker}
${if removeRulesCC then "rm -rf $bazelOut/external/{rules_cc,\\@rules_cc.marker}" else ""}
rm -rf $bazelOut/external/{embedded_jdk,\@embedded_jdk.marker}
rm -rf $bazelOut/external/{local_*,\@local_*.marker}
73 changes: 55 additions & 18 deletions pkgs/misc/vim-plugins/update.py
Original file line number Diff line number Diff line change
@@ -21,18 +21,54 @@
from datetime import datetime
from multiprocessing.dummy import Pool
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union, Any
from typing import Dict, List, Optional, Tuple, Union, Any, Callable
from urllib.parse import urljoin, urlparse
from tempfile import NamedTemporaryFile

ATOM_ENTRY = "{http://www.w3.org/2005/Atom}entry"
ATOM_LINK = "{http://www.w3.org/2005/Atom}link"
ATOM_UPDATED = "{http://www.w3.org/2005/Atom}updated"
ATOM_ENTRY = "{http://www.w3.org/2005/Atom}entry" # " vim gets confused here
ATOM_LINK = "{http://www.w3.org/2005/Atom}link" # "
ATOM_UPDATED = "{http://www.w3.org/2005/Atom}updated" # "

ROOT = Path(__file__).parent
DEFAULT_IN = ROOT.joinpath("vim-plugin-names")
DEFAULT_OUT = ROOT.joinpath("generated.nix")

import time
from functools import wraps


def retry(ExceptionToCheck: Any, tries: int = 4, delay: float = 3, backoff: float = 2):
"""Retry calling the decorated function using an exponential backoff.
http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/
original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry
(BSD licensed)
:param ExceptionToCheck: the exception on which to retry
:param tries: number of times to try (not retry) before giving up
:param delay: initial delay between retries in seconds
:param backoff: backoff multiplier e.g. value of 2 will double the delay
each retry
"""

def deco_retry(f: Callable) -> Callable:
@wraps(f)
def f_retry(*args: Any, **kwargs: Any) -> Any:
mtries, mdelay = tries, delay
while mtries > 1:
try:
return f(*args, **kwargs)
except ExceptionToCheck as e:
print(f"{str(e)}, Retrying in {mdelay} seconds...")
time.sleep(mdelay)
mtries -= 1
mdelay *= backoff
return f(*args, **kwargs)

return f_retry # true decorator

return deco_retry


class Repo:
def __init__(self, owner: str, name: str) -> None:
@@ -45,18 +81,22 @@ def url(self, path: str) -> str:
def __repr__(self) -> str:
return f"Repo({self.owner}, {self.name})"

@retry(urllib.error.URLError, tries=4, delay=3, backoff=2)
def has_submodules(self) -> bool:
try:
urllib.request.urlopen(self.url("blob/master/.gitmodules")).close()
urllib.request.urlopen(
self.url("blob/master/.gitmodules"), timeout=10
).close()
except urllib.error.HTTPError as e:
if e.code == 404:
return False
else:
raise
return True

@retry(urllib.error.URLError, tries=4, delay=3, backoff=2)
def latest_commit(self) -> Tuple[str, datetime]:
with urllib.request.urlopen(self.url("commits/master.atom")) as req:
with urllib.request.urlopen(self.url("commits/master.atom"), timeout=10) as req:
xml = req.read()
root = ET.fromstring(xml)
latest_entry = root.find(ATOM_ENTRY)
@@ -69,7 +109,7 @@ def latest_commit(self) -> Tuple[str, datetime]:
updated_tag is not None and updated_tag.text is not None
), f"No updated tag found feed entry {xml}"
updated = datetime.strptime(updated_tag.text, "%Y-%m-%dT%H:%M:%SZ")
return Path(url.path).name, updated
return Path(str(url.path)).name, updated

def prefetch_git(self, ref: str) -> str:
data = subprocess.check_output(
@@ -210,20 +250,17 @@ def check_results(
sys.exit(1)


def parse_plugin_line(line: str) -> Tuple[str, str, str]:
def parse_plugin_line(line: str) -> Tuple[str, str, Optional[str]]:
name, repo = line.split("/")
try:
name, repo = line.split("/")
try:
repo, alias = repo.split(" as ")
return (name, repo, alias.strip())
except ValueError:
# no alias defined
return (name, repo.strip(), None)
repo, alias = repo.split(" as ")
return (name, repo, alias.strip())
except ValueError:
return (None, None, None)
# no alias defined
return (name, repo.strip(), None)


def load_plugin_spec(plugin_file: str) -> List[Tuple[str, str]]:
def load_plugin_spec(plugin_file: str) -> List[Tuple[str, str, Optional[str]]]:
plugins = []
with open(plugin_file) as f:
for line in f:
@@ -385,7 +422,7 @@ def main() -> None:

try:
# synchronous variant for debugging
# results = map(prefetch_with_cache, plugins)
# results = list(map(prefetch_with_cache, plugin_names))
pool = Pool(processes=30)
results = pool.map(prefetch_with_cache, plugin_names)
finally: