···1+#!/usr/bin/env nix-shell
2+#!nix-shell -i python -p pythonFull pythonPackages.requests pythonPackages.pyquery pythonPackages.click
3+4+# To use, just execute this script with --help to display help.
5+6+import subprocess
7+import json
8+9+import click
10+import requests
11+from pyquery import PyQuery as pq
12+13+14+maintainers_json = subprocess.check_output([
15+ 'nix-instantiate',
16+ 'lib/maintainers.nix',
17+ '--eval',
18+ '--json'])
19+maintainers = json.loads(maintainers_json)
20+MAINTAINERS = {v: k for k, v in maintainers.iteritems()}
21+22+23+def get_response_text(url):
24+ return pq(requests.get(url).text) # IO
25+26+EVAL_FILE = {
27+ 'nixos': 'nixos/release.nix',
28+ 'nixpkgs': 'pkgs/top-level/release.nix',
29+}
30+31+32+def get_maintainers(attr_name):
33+ nixname = attr_name.split('.')
34+ meta_json = subprocess.check_output([
35+ 'nix-instantiate',
36+ '--eval',
37+ '--strict',
38+ '-A',
39+ '.'.join(nixname[1:]) + '.meta',
40+ EVAL_FILE[nixname[0]],
41+ '--json'])
42+ meta = json.loads(meta_json)
43+ if meta.get('maintainers'):
44+ return [MAINTAINERS[name] for name in meta['maintainers'] if MAINTAINERS.get(name)]
45+46+47+@click.command()
48+@click.option(
49+ '--jobset',
50+ default="nixos/release-16.09",
51+ help='Hydra project like nixos/release-16.09')
52+def cli(jobset):
53+ """
54+ Given a Hydra project, inspect latest evaluation
55+ and print a summary of failed builds
56+ """
57+58+ url = "http://hydra.nixos.org/jobset/{}".format(jobset)
59+60+ # get the last evaluation
61+ click.echo(click.style(
62+ 'Getting latest evaluation for {}'.format(url), fg='green'))
63+ d = get_response_text(url)
64+ evaluations = d('#tabs-evaluations').find('a[class="row-link"]')
65+ latest_eval_url = evaluations[0].get('href')
66+67+ # parse last evaluation page
68+ click.echo(click.style(
69+ 'Parsing evaluation {}'.format(latest_eval_url), fg='green'))
70+ d = get_response_text(latest_eval_url + '?full=1')
71+72+ # TODO: aborted evaluations
73+ # TODO: dependency failed without propagated builds
74+ for tr in d('img[alt="Failed"]').parents('tr'):
75+ a = pq(tr)('a')[1]
76+ print "- [ ] [{}]({})".format(a.text, a.get('href'))
77+78+ maintainers = get_maintainers(a.text)
79+ if maintainers:
80+ print " - maintainers: {}".format(", ".join(map(lambda u: '@' + u, maintainers)))
81+ # TODO: print last three persons that touched this file
82+ # TODO: pinpoint the diff that broke this build, or maybe it's transient or maybe it never worked?
83+84+85+if __name__ == "__main__":
86+ try:
87+ cli()
88+ except:
89+ import pdb;pdb.post_mortem()
+8-1
nixos/doc/manual/release-notes/rl-1703.xml
···46 for what those parameters represent.
47 </para>
48 </listitem>
49-000000050 <listitem>
51 <para>
52 <literal>gnome</literal> alias has been removed along with
···46 for what those parameters represent.
47 </para>
48 </listitem>
49+ <listitem>
50+ <para>
51+ <literal>ansible</literal> now defaults to ansible version 2 as version 1
52+ has been removed due to a serious <link
53+ xlink:href="https://www.computest.nl/advisories/CT-2017-0109_Ansible.txt">
54+ vulnerability</link> unpatched by upstream.
55+ </para>
56+ </listitem>
57 <listitem>
58 <para>
59 <literal>gnome</literal> alias has been removed along with
···1+/* `dhallToNix` is a utility function to convert expressions in the Dhall
2+ configuration language to their corresponding Nix expressions.
3+4+ Example:
5+ dhallToNix "{ foo = 1, bar = True }"
6+ => { foo = 1; bar = true; }
7+ dhallToNix "λ(x : Bool) → x == False"
8+ => x : x == false
9+ dhallToNix "λ(x : Bool) → x == False" false
10+ => true
11+12+ See https://hackage.haskell.org/package/dhall-nix/docs/Dhall-Nix.html for
13+ a longer tutorial
14+15+ Note that this uses "import from derivation", meaning that Nix will perform
16+ a build during the evaluation phase if you use this `dhallToNix` utility
17+*/
18+{ stdenv, dhall-nix }:
19+20+let
21+ dhallToNix = code :
22+ let
23+ file = builtins.toFile "dhall-expression" code;
24+25+ drv = stdenv.mkDerivation {
26+ name = "dhall-compiled.nix";
27+28+ buildCommand = ''
29+ dhall-to-nix <<< "${file}" > $out
30+ '';
31+32+ buildInputs = [ dhall-nix ];
33+ };
34+35+ in
36+ import "${drv}";
37+in
38+ dhallToNix
···1+From a0c0f32299419359b44ac0f880c1ea9073ae51e1 Mon Sep 17 00:00:00 2001
2+From: Zheng Xu <zheng.xu@linaro.org>
3+Date: Fri, 02 Sep 2016 17:40:05 +0800
4+Subject: [PATCH] Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits are clear. r=ehoogeveen
5+6+There might be 48-bit VA on arm64 depending on kernel configuration.
7+Manually mmap heap memory to align with the assumption made by JS engine.
8+9+Change-Id: Ic5d2b2fe4b758b3c87cc0688348af7e71a991146
10+---
11+12+diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
13+index 5b386a2..38101cf 100644
14+--- a/js/src/gc/Memory.cpp
15++++ b/js/src/gc/Memory.cpp
16+@@ -309,6 +309,75 @@
17+ #endif
18+ }
19+20++static inline void *
21++MapMemory(size_t length, int prot, int flags, int fd, off_t offset)
22++{
23++#if defined(__ia64__)
24++ /*
25++ * The JS engine assumes that all allocated pointers have their high 17 bits clear,
26++ * which ia64's mmap doesn't support directly. However, we can emulate it by passing
27++ * mmap an "addr" parameter with those bits clear. The mmap will return that address,
28++ * or the nearest available memory above that address, providing a near-guarantee
29++ * that those bits are clear. If they are not, we return NULL below to indicate
30++ * out-of-memory.
31++ *
32++ * The addr is chosen as 0x0000070000000000, which still allows about 120TB of virtual
33++ * address space.
34++ *
35++ * See Bug 589735 for more information.
36++ */
37++ void *region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
38++ if (region == MAP_FAILED)
39++ return MAP_FAILED;
40++ /*
41++ * If the allocated memory doesn't have its upper 17 bits clear, consider it
42++ * as out of memory.
43++ */
44++ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
45++ JS_ALWAYS_TRUE(0 == munmap(region, length));
46++ return MAP_FAILED;
47++ }
48++ return region;
49++#elif defined(__aarch64__)
50++ /*
51++ * There might be similar virtual address issue on arm64 which depends on
52++ * hardware and kernel configurations. But the work around is slightly
53++ * different due to the different mmap behavior.
54++ *
55++ * TODO: Merge with the above code block if this implementation works for
56++ * ia64 and sparc64.
57++ */
58++ const uintptr_t start = (uintptr_t)(0x0000070000000000UL);
59++ const uintptr_t end = (uintptr_t)(0x0000800000000000UL);
60++ const uintptr_t step = ChunkSize;
61++ /*
62++ * Optimization options if there are too many retries in practice:
63++ * 1. Examine /proc/self/maps to find an available address. This file is
64++ * not always available, however. In addition, even if we examine
65++ * /proc/self/maps, we may still need to retry several times due to
66++ * racing with other threads.
67++ * 2. Use a global/static variable with lock to track the addresses we have
68++ * allocated or tried.
69++ */
70++ uintptr_t hint;
71++ void* region = MAP_FAILED;
72++ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) {
73++ region = mmap((void*)hint, length, prot, flags, fd, offset);
74++ if (region != MAP_FAILED) {
75++ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
76++ if (munmap(region, length)) {
77++ MOZ_ASSERT(errno == ENOMEM);
78++ }
79++ region = MAP_FAILED;
80++ }
81++ }
82++ }
83++ return region == MAP_FAILED ? NULL : region;
84++#else
85++ return mmap(NULL, length, prot, flags, fd, offset);
86++#endif
87++}
88++
89+ void *
90+ MapAlignedPages(size_t size, size_t alignment)
91+ {
92+@@ -322,12 +391,12 @@
93+94+ /* Special case: If we want page alignment, no further work is needed. */
95+ if (alignment == PageSize) {
96+- return mmap(NULL, size, prot, flags, -1, 0);
97++ return MapMemory(size, prot, flags, -1, 0);
98+ }
99+100+ /* Overallocate and unmap the region's edges. */
101+ size_t reqSize = Min(size + 2 * alignment, 2 * size);
102+- void *region = mmap(NULL, reqSize, prot, flags, -1, 0);
103++ void *region = MapMemory(reqSize, prot, flags, -1, 0);
104+ if (region == MAP_FAILED)
105+ return NULL;
106+
···1+{ stdenv, fetchurl }:
2+3+stdenv.mkDerivation rec {
4+ name = "nuttcp-${version}";
5+ version = "8.1.4";
6+7+ src = fetchurl {
8+ urls = [
9+ "http://nuttcp.net/nuttcp/latest/${name}.c"
10+ "http://nuttcp.net/nuttcp/${name}/${name}.c"
11+ "http://nuttcp.net/nuttcp/beta/${name}.c"
12+ ];
13+ sha256 = "1mygfhwxfi6xg0iycivx98ckak2abc3vwndq74278kpd8g0yyqyh";
14+ };
15+16+ man = fetchurl {
17+ url = "http://nuttcp.net/nuttcp/${name}/nuttcp.8";
18+ sha256 = "1yang94mcdqg362qbi85b63746hk6gczxrk619hyj91v5763n4vx";
19+ };
20+21+ unpackPhase = ":";
22+23+ buildPhase = ''
24+ gcc -O2 -o nuttcp $src
25+ '';
26+27+ installPhase = ''
28+ mkdir -p $out/bin
29+ cp nuttcp $out/bin
30+ '';
31+32+ meta = with stdenv.lib; {
33+ description = "Network performance measurement tool";
34+ longDescription = ''
35+ nuttcp is a network performance measurement tool intended for use by
36+ network and system managers. Its most basic usage is to determine the raw
37+ TCP (or UDP) network layer throughput by transferring memory buffers from
38+ a source system across an interconnecting network to a destination
39+ system, either transferring data for a specified time interval, or
40+ alternatively transferring a specified number of bytes. In addition to
41+ reporting the achieved network throughput in Mbps, nuttcp also provides
42+ additional useful information related to the data transfer such as user,
43+ system, and wall-clock time, transmitter and receiver CPU utilization,
44+ and loss percentage (for UDP transfers).
45+ '';
46+ license = licenses.gpl2;
47+ homepage = http://nuttcp.net/;
48+ maintainers = with maintainers; [ viric ];
49+ platforms = platforms.unix;
50+ };
51+}