···11+#!/usr/bin/env nix-shell
22+#!nix-shell -i python -p pythonFull pythonPackages.requests pythonPackages.pyquery pythonPackages.click
33+44+# To use, just execute this script with --help to display help.
55+66+import subprocess
77+import json
88+99+import click
1010+import requests
1111+from pyquery import PyQuery as pq
1212+1313+1414+maintainers_json = subprocess.check_output([
1515+ 'nix-instantiate',
1616+ 'lib/maintainers.nix',
1717+ '--eval',
1818+ '--json'])
1919+maintainers = json.loads(maintainers_json)
2020+MAINTAINERS = {v: k for k, v in maintainers.iteritems()}
2121+2222+2323+def get_response_text(url):
2424+ return pq(requests.get(url).text) # IO
2525+2626+EVAL_FILE = {
2727+ 'nixos': 'nixos/release.nix',
2828+ 'nixpkgs': 'pkgs/top-level/release.nix',
2929+}
3030+3131+3232+def get_maintainers(attr_name):
3333+ nixname = attr_name.split('.')
3434+ meta_json = subprocess.check_output([
3535+ 'nix-instantiate',
3636+ '--eval',
3737+ '--strict',
3838+ '-A',
3939+ '.'.join(nixname[1:]) + '.meta',
4040+ EVAL_FILE[nixname[0]],
4141+ '--json'])
4242+ meta = json.loads(meta_json)
4343+ if meta.get('maintainers'):
4444+ return [MAINTAINERS[name] for name in meta['maintainers'] if MAINTAINERS.get(name)]
4545+4646+4747+@click.command()
4848+@click.option(
4949+ '--jobset',
5050+ default="nixos/release-16.09",
5151+ help='Hydra project like nixos/release-16.09')
5252+def cli(jobset):
5353+ """
5454+ Given a Hydra project, inspect latest evaluation
5555+ and print a summary of failed builds
5656+ """
5757+5858+ url = "http://hydra.nixos.org/jobset/{}".format(jobset)
5959+6060+ # get the last evaluation
6161+ click.echo(click.style(
6262+ 'Getting latest evaluation for {}'.format(url), fg='green'))
6363+ d = get_response_text(url)
6464+ evaluations = d('#tabs-evaluations').find('a[class="row-link"]')
6565+ latest_eval_url = evaluations[0].get('href')
6666+6767+ # parse last evaluation page
6868+ click.echo(click.style(
6969+ 'Parsing evaluation {}'.format(latest_eval_url), fg='green'))
7070+ d = get_response_text(latest_eval_url + '?full=1')
7171+7272+ # TODO: aborted evaluations
7373+ # TODO: dependency failed without propagated builds
7474+ for tr in d('img[alt="Failed"]').parents('tr'):
7575+ a = pq(tr)('a')[1]
7676+ print "- [ ] [{}]({})".format(a.text, a.get('href'))
7777+7878+ maintainers = get_maintainers(a.text)
7979+ if maintainers:
8080+ print " - maintainers: {}".format(", ".join(map(lambda u: '@' + u, maintainers)))
8181+ # TODO: print last three persons that touched this file
8282+ # TODO: pinpoint the diff that broke this build, or maybe it's transient or maybe it never worked?
8383+8484+8585+if __name__ == "__main__":
8686+ try:
8787+ cli()
8888+ except:
8989+ import pdb;pdb.post_mortem()
+8-1
nixos/doc/manual/release-notes/rl-1703.xml
···4646 for what those parameters represent.
4747 </para>
4848 </listitem>
4949-4949+ <listitem>
5050+ <para>
5151+ <literal>ansible</literal> now defaults to ansible version 2 as version 1
5252+ has been removed due to a serious <link
5353+ xlink:href="https://www.computest.nl/advisories/CT-2017-0109_Ansible.txt">
5454+ vulnerability</link> unpatched by upstream.
5555+ </para>
5656+ </listitem>
5057 <listitem>
5158 <para>
5259 <literal>gnome</literal> alias has been removed along with
···11+/* `dhallToNix` is a utility function to convert expressions in the Dhall
22+ configuration language to their corresponding Nix expressions.
33+44+ Example:
55+ dhallToNix "{ foo = 1, bar = True }"
66+ => { foo = 1; bar = true; }
77+ dhallToNix "λ(x : Bool) → x == False"
88+ => x : x == false
99+ dhallToNix "λ(x : Bool) → x == False" false
1010+ => true
1111+1212+ See https://hackage.haskell.org/package/dhall-nix/docs/Dhall-Nix.html for
1313+ a longer tutorial
1414+1515+ Note that this uses "import from derivation", meaning that Nix will perform
1616+ a build during the evaluation phase if you use this `dhallToNix` utility
1717+*/
1818+{ stdenv, dhall-nix }:
1919+2020+let
2121+ dhallToNix = code :
2222+ let
2323+ file = builtins.toFile "dhall-expression" code;
2424+2525+ drv = stdenv.mkDerivation {
2626+ name = "dhall-compiled.nix";
2727+2828+ buildCommand = ''
2929+ dhall-to-nix <<< "${file}" > $out
3030+ '';
3131+3232+ buildInputs = [ dhall-nix ];
3333+ };
3434+3535+ in
3636+ import "${drv}";
3737+in
3838+ dhallToNix
···11+From a0c0f32299419359b44ac0f880c1ea9073ae51e1 Mon Sep 17 00:00:00 2001
22+From: Zheng Xu <zheng.xu@linaro.org>
33+Date: Fri, 02 Sep 2016 17:40:05 +0800
44+Subject: [PATCH] Bug 1143022 - Manually mmap on arm64 to ensure high 17 bits are clear. r=ehoogeveen
55+66+There might be 48-bit VA on arm64 depending on kernel configuration.
77+Manually mmap heap memory to align with the assumption made by JS engine.
88+99+Change-Id: Ic5d2b2fe4b758b3c87cc0688348af7e71a991146
1010+---
1111+1212+diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
1313+index 5b386a2..38101cf 100644
1414+--- a/js/src/gc/Memory.cpp
1515++++ b/js/src/gc/Memory.cpp
1616+@@ -309,6 +309,75 @@
1717+ #endif
1818+ }
1919+2020++static inline void *
2121++MapMemory(size_t length, int prot, int flags, int fd, off_t offset)
2222++{
2323++#if defined(__ia64__)
2424++ /*
2525++ * The JS engine assumes that all allocated pointers have their high 17 bits clear,
2626++ * which ia64's mmap doesn't support directly. However, we can emulate it by passing
2727++ * mmap an "addr" parameter with those bits clear. The mmap will return that address,
2828++ * or the nearest available memory above that address, providing a near-guarantee
2929++ * that those bits are clear. If they are not, we return NULL below to indicate
3030++ * out-of-memory.
3131++ *
3232++ * The addr is chosen as 0x0000070000000000, which still allows about 120TB of virtual
3333++ * address space.
3434++ *
3535++ * See Bug 589735 for more information.
3636++ */
3737++ void *region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
3838++ if (region == MAP_FAILED)
3939++ return MAP_FAILED;
4040++ /*
4141++ * If the allocated memory doesn't have its upper 17 bits clear, consider it
4242++ * as out of memory.
4343++ */
4444++ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
4545++ JS_ALWAYS_TRUE(0 == munmap(region, length));
4646++ return MAP_FAILED;
4747++ }
4848++ return region;
4949++#elif defined(__aarch64__)
5050++ /*
5151++ * There might be similar virtual address issue on arm64 which depends on
5252++ * hardware and kernel configurations. But the work around is slightly
5353++ * different due to the different mmap behavior.
5454++ *
5555++ * TODO: Merge with the above code block if this implementation works for
5656++ * ia64 and sparc64.
5757++ */
5858++ const uintptr_t start = (uintptr_t)(0x0000070000000000UL);
5959++ const uintptr_t end = (uintptr_t)(0x0000800000000000UL);
6060++ const uintptr_t step = ChunkSize;
6161++ /*
6262++ * Optimization options if there are too many retries in practice:
6363++ * 1. Examine /proc/self/maps to find an available address. This file is
6464++ * not always available, however. In addition, even if we examine
6565++ * /proc/self/maps, we may still need to retry several times due to
6666++ * racing with other threads.
6767++ * 2. Use a global/static variable with lock to track the addresses we have
6868++ * allocated or tried.
6969++ */
7070++ uintptr_t hint;
7171++ void* region = MAP_FAILED;
7272++ for (hint = start; region == MAP_FAILED && hint + length <= end; hint += step) {
7373++ region = mmap((void*)hint, length, prot, flags, fd, offset);
7474++ if (region != MAP_FAILED) {
7575++ if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
7676++ if (munmap(region, length)) {
7777++ MOZ_ASSERT(errno == ENOMEM);
7878++ }
7979++ region = MAP_FAILED;
8080++ }
8181++ }
8282++ }
8383++ return region == MAP_FAILED ? NULL : region;
8484++#else
8585++ return mmap(NULL, length, prot, flags, fd, offset);
8686++#endif
8787++}
8888++
8989+ void *
9090+ MapAlignedPages(size_t size, size_t alignment)
9191+ {
9292+@@ -322,12 +391,12 @@
9393+9494+ /* Special case: If we want page alignment, no further work is needed. */
9595+ if (alignment == PageSize) {
9696+- return mmap(NULL, size, prot, flags, -1, 0);
9797++ return MapMemory(size, prot, flags, -1, 0);
9898+ }
9999+100100+ /* Overallocate and unmap the region's edges. */
101101+ size_t reqSize = Min(size + 2 * alignment, 2 * size);
102102+- void *region = mmap(NULL, reqSize, prot, flags, -1, 0);
103103++ void *region = MapMemory(reqSize, prot, flags, -1, 0);
104104+ if (region == MAP_FAILED)
105105+ return NULL;
106106+
···11+{ stdenv, fetchurl }:
22+33+stdenv.mkDerivation rec {
44+ name = "nuttcp-${version}";
55+ version = "8.1.4";
66+77+ src = fetchurl {
88+ urls = [
99+ "http://nuttcp.net/nuttcp/latest/${name}.c"
1010+ "http://nuttcp.net/nuttcp/${name}/${name}.c"
1111+ "http://nuttcp.net/nuttcp/beta/${name}.c"
1212+ ];
1313+ sha256 = "1mygfhwxfi6xg0iycivx98ckak2abc3vwndq74278kpd8g0yyqyh";
1414+ };
1515+1616+ man = fetchurl {
1717+ url = "http://nuttcp.net/nuttcp/${name}/nuttcp.8";
1818+ sha256 = "1yang94mcdqg362qbi85b63746hk6gczxrk619hyj91v5763n4vx";
1919+ };
2020+2121+ unpackPhase = ":";
2222+2323+ buildPhase = ''
2424+ gcc -O2 -o nuttcp $src
2525+ '';
2626+2727+ installPhase = ''
2828+ mkdir -p $out/bin
2929+ cp nuttcp $out/bin
3030+ '';
3131+3232+ meta = with stdenv.lib; {
3333+ description = "Network performance measurement tool";
3434+ longDescription = ''
3535+ nuttcp is a network performance measurement tool intended for use by
3636+ network and system managers. Its most basic usage is to determine the raw
3737+ TCP (or UDP) network layer throughput by transferring memory buffers from
3838+ a source system across an interconnecting network to a destination
3939+ system, either transferring data for a specified time interval, or
4040+ alternatively transferring a specified number of bytes. In addition to
4141+ reporting the achieved network throughput in Mbps, nuttcp also provides
4242+ additional useful information related to the data transfer such as user,
4343+ system, and wall-clock time, transmitter and receiver CPU utilization,
4444+ and loss percentage (for UDP transfers).
4545+ '';
4646+ license = licenses.gpl2;
4747+ homepage = http://nuttcp.net/;
4848+ maintainers = with maintainers; [ viric ];
4949+ platforms = platforms.unix;
5050+ };
5151+}