diff --git a/lib/default.nix b/lib/default.nix index e919509e724a..22eb5440c282 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -11,6 +11,9 @@ let callLibs = file: import file { lib = self; }; in { + # interacting with flakes + flakes = callLibs ./flakes.nix; + # often used, or depending on very little trivial = callLibs ./trivial.nix; fixedPoints = callLibs ./fixed-points.nix; @@ -59,6 +62,7 @@ let # linux kernel configuration kernel = callLibs ./kernel.nix; + inherit (self.flakes) callLocklessFlake; inherit (builtins) add addErrorContext attrNames concatLists deepSeq elem elemAt filter genericClosure genList getAttr hasAttr head isAttrs isBool isInt isList isString length diff --git a/lib/flakes.nix b/lib/flakes.nix new file mode 100644 index 000000000000..4dc027b6c9b3 --- /dev/null +++ b/lib/flakes.nix @@ -0,0 +1,22 @@ +{ lib }: + +rec { + + /* imports a flake.nix without acknowledging its lock file, useful for + referencing subflakes from a parent flake. The second argument allows + specifying the inputs of this flake. + + Example: + callLocklessFlake { + path = ./directoryContainingFlake; + inputs = { inherit nixpkgs; }; + } + */ + callLocklessFlake = { path, inputs ? { } }: + let + self = { outPath = path; } // + ((import (path + "/flake.nix")).outputs (inputs // { self = self; })); + in + self; + +} diff --git a/lib/tests/flakes/subflakeTest/flake.nix b/lib/tests/flakes/subflakeTest/flake.nix new file mode 100644 index 000000000000..3a8edd5e8c50 --- /dev/null +++ b/lib/tests/flakes/subflakeTest/flake.nix @@ -0,0 +1,8 @@ +{ + outputs = { self, subflake, callLocklessFlake }: rec { + x = (callLocklessFlake { + path = subflake; + inputs = {}; + }).subflakeOutput; + }; +} diff --git a/lib/tests/flakes/subflakeTest/subflake/flake.nix b/lib/tests/flakes/subflakeTest/subflake/flake.nix new file mode 100644 index 000000000000..41566b52090c --- /dev/null +++ b/lib/tests/flakes/subflakeTest/subflake/flake.nix @@ -0,0 +1,5 @@ +{ + outputs = { self }: { + subflakeOutput = 1; + }; +} diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix index c5d1d431677a..f7e62a71eee1 100644 --- a/lib/tests/misc.nix +++ b/lib/tests/misc.nix @@ -22,6 +22,15 @@ in runTests { +# FLAKES + + testCallLocklessFlake = { + expr = callLocklessFlake { + path = ./flakes/subflakeTest; + inputs = { subflake = ./flakes/subflakeTest/subflake; inherit callLocklessFlake; }; + }; + expected = { x = 1; outPath = ./flakes/subflakeTest; }; + }; # TRIVIAL diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index bdda8020a3da..c8c8fb233d59 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -52,7 +52,7 @@ luadbi-postgresql,,,,,, luadbi-sqlite3,,,,,, luaepnf,,,,,, luaevent,,,,,, -luaexpat,,,,1.3.0-1,,arobyn flosse +luaexpat,,,,1.4.1-1,,arobyn flosse luaffi,,,http://luarocks.org/dev,,, luafilesystem,,,,1.7.0-2,,flosse lualogging,,,,,, diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py index 3cfdb1387053..b24d75a6b4d0 100644 --- a/maintainers/scripts/pluginupdate.py +++ b/maintainers/scripts/pluginupdate.py @@ -87,7 +87,8 @@ def make_request(url: str, token=None) -> urllib.request.Request: return urllib.request.Request(url, headers=headers) -Redirects = Dict['Repo', 'Repo'] +# a dictionary of plugins and their new repositories +Redirects = Dict['PluginDesc', 'Repo'] class Repo: def __init__( @@ -96,8 +97,8 @@ class Repo: self.uri = uri '''Url to the repo''' self._branch = branch - # {old_uri: new_uri} - self.redirect: Redirects = {} + # Redirect is the new Repo to use + self.redirect: Optional['Repo'] = None self.token = "dummy_token" @property @@ -207,7 +208,7 @@ class RepoGitHub(Repo): ) new_repo = RepoGitHub(owner=new_owner, repo=new_name, branch=self.branch) - self.redirect[self] = new_repo + self.redirect = new_repo def prefetch(self, commit: str) -> str: @@ -237,7 +238,7 @@ class RepoGitHub(Repo): }}''' -@dataclass +@dataclass(frozen=True) class PluginDesc: repo: Repo branch: str @@ -332,9 +333,19 @@ class Editor: self.deprecated = deprecated or root.joinpath("deprecated.json") self.cache_file = cache_file or f"{name}-plugin-cache.json" - def get_current_plugins(self): + def get_current_plugins(editor) -> List[Plugin]: """To fill the cache""" - return get_current_plugins(self) + with CleanEnvironment(): + cmd = ["nix", "eval", "--extra-experimental-features", "nix-command", "--impure", "--json", "--expr", editor.get_plugins] + log.debug("Running command %s", cmd) + out = subprocess.check_output(cmd) + data = json.loads(out) + plugins = [] + for name, attr in data.items(): + print("get_current_plugins: name %s" % name) + p = Plugin(name, attr["rev"], attr["submodules"], attr["sha256"]) + plugins.append(p) + return plugins def load_plugin_spec(self, config: FetchConfig, plugin_file) -> List[PluginDesc]: '''CSV spec''' @@ -448,24 +459,10 @@ class CleanEnvironment(object): self.empty_config.close() -def get_current_plugins(editor: Editor) -> List[Plugin]: - with CleanEnvironment(): - cmd = ["nix", "eval", "--extra-experimental-features", "nix-command", "--impure", "--json", "--expr", editor.get_plugins] - log.debug("Running command %s", cmd) - out = subprocess.check_output(cmd) - data = json.loads(out) - plugins = [] - for name, attr in data.items(): - print("get_current_plugins: name %s" % name) - p = Plugin(name, attr["rev"], attr["submodules"], attr["sha256"]) - plugins.append(p) - return plugins - - def prefetch_plugin( p: PluginDesc, cache: "Optional[Cache]" = None, -) -> Tuple[Plugin, Redirects]: +) -> Tuple[Plugin, Optional[Repo]]: repo, branch, alias = p.repo, p.branch, p.alias name = alias or p.repo.name commit = None @@ -479,7 +476,7 @@ def prefetch_plugin( return cached_plugin, repo.redirect has_submodules = repo.has_submodules() - print(f"prefetch {name}") + log.debug(f"prefetch {name}") sha256 = repo.prefetch(commit) return ( @@ -488,7 +485,7 @@ def prefetch_plugin( ) -def print_download_error(plugin: str, ex: Exception): +def print_download_error(plugin: PluginDesc, ex: Exception): print(f"{plugin}: {ex}", file=sys.stderr) ex_traceback = ex.__traceback__ tb_lines = [ @@ -498,19 +495,21 @@ def print_download_error(plugin: str, ex: Exception): print("\n".join(tb_lines)) def check_results( - results: List[Tuple[PluginDesc, Union[Exception, Plugin], Redirects]] + results: List[Tuple[PluginDesc, Union[Exception, Plugin], Optional[Repo]]] ) -> Tuple[List[Tuple[PluginDesc, Plugin]], Redirects]: ''' ''' - failures: List[Tuple[str, Exception]] = [] + failures: List[Tuple[PluginDesc, Exception]] = [] plugins = [] - # {old: new} plugindesc - redirects: Dict[Repo, Repo] = {} + redirects: Redirects = {} for (pdesc, result, redirect) in results: if isinstance(result, Exception): - failures.append((pdesc.name, result)) + failures.append((pdesc, result)) else: - plugins.append((pdesc, result)) - redirects.update(redirect) + new_pdesc = pdesc + if redirect is not None: + redirects.update({pdesc: redirect}) + new_pdesc = PluginDesc(redirect, pdesc.branch, pdesc.alias) + plugins.append((new_pdesc, result)) print(f"{len(results) - len(failures)} plugins were checked", end="") if len(failures) == 0: @@ -591,13 +590,13 @@ class Cache: def prefetch( pluginDesc: PluginDesc, cache: Cache -) -> Tuple[PluginDesc, Union[Exception, Plugin], dict]: +) -> Tuple[PluginDesc, Union[Exception, Plugin], Optional[Repo]]: try: plugin, redirect = prefetch_plugin(pluginDesc, cache) cache[plugin.commit] = plugin return (pluginDesc, plugin, redirect) except Exception as e: - return (pluginDesc, e, {}) + return (pluginDesc, e, None) @@ -606,7 +605,7 @@ def rewrite_input( input_file: Path, deprecated: Path, # old pluginDesc and the new - redirects: Dict[PluginDesc, PluginDesc] = {}, + redirects: Redirects = {}, append: List[PluginDesc] = [], ): plugins = load_plugins_from_csv(config, input_file,) @@ -618,9 +617,10 @@ def rewrite_input( cur_date_iso = datetime.now().strftime("%Y-%m-%d") with open(deprecated, "r") as f: deprecations = json.load(f) - for old, new in redirects.items(): - old_plugin, _ = prefetch_plugin(old) - new_plugin, _ = prefetch_plugin(new) + for pdesc, new_repo in redirects.items(): + new_pdesc = PluginDesc(new_repo, pdesc.branch, pdesc.alias) + old_plugin, _ = prefetch_plugin(pdesc) + new_plugin, _ = prefetch_plugin(new_pdesc) if old_plugin.normalized_name != new_plugin.normalized_name: deprecations[old_plugin.normalized_name] = { "new": new_plugin.normalized_name, diff --git a/pkgs/applications/blockchains/namecoin/default.nix b/pkgs/applications/blockchains/namecoin/default.nix index d5c739e00f4a..e9b9d1044107 100644 --- a/pkgs/applications/blockchains/namecoin/default.nix +++ b/pkgs/applications/blockchains/namecoin/default.nix @@ -1,15 +1,14 @@ { lib, stdenv, fetchFromGitHub, openssl, boost, libevent, autoreconfHook, db4, miniupnpc, eject, pkg-config, qt4, protobuf, qrencode, hexdump , withGui }: -with lib; stdenv.mkDerivation rec { - pname = "namecoin" + optionalString (!withGui) "d"; - version = "nc22.0"; + pname = "namecoin" + lib.optionalString (!withGui) "d"; + version = "22.0"; src = fetchFromGitHub { owner = "namecoin"; repo = "namecoin-core"; - rev = version; + rev = "nc${version}"; sha256 = "sha256-Z3CLDe0c4IpFPPTie8yoh0kcuvGmiegSgl4ITNSDkgY="; }; @@ -26,7 +25,7 @@ stdenv.mkDerivation rec { db4 miniupnpc eject - ] ++ optionals withGui [ + ] ++ lib.optionals withGui [ qt4 protobuf qrencode @@ -38,7 +37,7 @@ stdenv.mkDerivation rec { "--with-boost-libdir=${boost.out}/lib" ]; - meta = { + meta = with lib; { description = "Decentralized open source information registration and transfer system based on the Bitcoin cryptocurrency"; homepage = "https://namecoin.org"; license = licenses.mit; diff --git a/pkgs/applications/misc/moonlight-qt/default.nix b/pkgs/applications/misc/moonlight-qt/default.nix index c29813517496..c486b25c44cd 100644 --- a/pkgs/applications/misc/moonlight-qt/default.nix +++ b/pkgs/applications/misc/moonlight-qt/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { pname = "moonlight-qt"; - version = "3.2.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "moonlight-stream"; repo = pname; rev = "v${version}"; - sha256 = "sha256-nvVBjBcuHKSn66Q7iTzslGOCkH6zMFf62zx5dDXSosI="; + sha256 = "sha256-CfOphr8QILCZg+UrImp5JO/1DTqoan5EwiQeTKR15Fo="; fetchSubmodules = true; }; diff --git a/pkgs/applications/misc/sqls/default.nix b/pkgs/applications/misc/sqls/default.nix index 2c89d31df35a..6ac9275570a3 100644 --- a/pkgs/applications/misc/sqls/default.nix +++ b/pkgs/applications/misc/sqls/default.nix @@ -2,19 +2,21 @@ buildGoModule rec { pname = "sqls"; - version = "0.2.20"; + version = "0.2.22"; src = fetchFromGitHub { owner = "lighttiger2505"; repo = pname; rev = "v${version}"; - sha256 = "sha256-QYxiWxgzuD+JymlXlVmzZOtex70JC93VmWljAFQJMPQ="; + sha256 = "sha256-xtvm/NVL98dRzQL1id/WwT/NdsnB7qTRVR7jfrRsabY="; }; - vendorSha256 = "sha256-fo5g6anMcKqdzLG8KCJ/T4uTOp1Z5Du4EtCHYkLgUpo="; + vendorSha256 = "sha256-sowzyhvNr7Ek3ex4BP415HhHSKnqPHy5EbnECDVZOGw="; ldflags = [ "-s" "-w" "-X main.version=${version}" "-X main.revision=${src.rev}" ]; + doCheck = false; + meta = with lib; { homepage = "https://github.com/lighttiger2505/sqls"; description = "SQL language server written in Go"; diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix index bd96562d9e5d..77dffd20595b 100644 --- a/pkgs/development/interpreters/racket/default.nix +++ b/pkgs/development/interpreters/racket/default.nix @@ -49,7 +49,7 @@ in stdenv.mkDerivation rec { pname = "racket"; - version = "8.4"; # always change at once with ./minimal.nix + version = "8.5"; # always change at once with ./minimal.nix src = (lib.makeOverridable ({ name, sha256 }: fetchurl { @@ -58,7 +58,7 @@ stdenv.mkDerivation rec { } )) { name = "${pname}-${version}"; - sha256 = "sha256-uJ+vL+FtBNILkFbwi7qZ6yBA1Rcr7o886zmZ/tFuatM="; + sha256 = "sha256-dWnOnpxh5zmou9eqVdcfhuCr8ts1CTqqEF1j/dk0jhs="; }; FONTCONFIG_FILE = fontsConf; diff --git a/pkgs/development/interpreters/racket/minimal.nix b/pkgs/development/interpreters/racket/minimal.nix index b73cdaff5d3e..a5ddab67c416 100644 --- a/pkgs/development/interpreters/racket/minimal.nix +++ b/pkgs/development/interpreters/racket/minimal.nix @@ -6,7 +6,7 @@ racket.overrideAttrs (oldAttrs: rec { version = oldAttrs.version; src = oldAttrs.src.override { name = "${pname}-${version}"; - sha256 = "sha256-FZlUWvjtioe4S8gPetj7vdneVX6jEFguJo4j2wJsKAw="; + sha256 = "sha256-VdWF46yfuqz76ECm7HTOPnvun+heMiE/Gz5Pb1k8rjk="; }; meta = oldAttrs.meta // { diff --git a/pkgs/development/libraries/proj/default.nix b/pkgs/development/libraries/proj/default.nix index a8e42fb6fb17..a5a19dc9db2e 100644 --- a/pkgs/development/libraries/proj/default.nix +++ b/pkgs/development/libraries/proj/default.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , cmake , pkg-config +, buildPackages , sqlite , libtiff , curl @@ -33,6 +34,7 @@ stdenv.mkDerivation rec { "-DUSE_EXTERNAL_GTEST=ON" "-DRUN_NETWORK_DEPENDENT_TESTS=OFF" "-DNLOHMANN_JSON_ORIGIN=external" + "-DEXE_SQLITE3=${buildPackages.sqlite}/bin/sqlite3" ]; preCheck = diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 4269d7eb0d7e..8fd6543b27d5 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -1602,25 +1602,33 @@ buildLuarocksPackage { }) {}; luaexpat = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast -, fetchurl, lua +, fetchgit, lua }: buildLuarocksPackage { pname = "luaexpat"; - version = "1.3.0-1"; + version = "1.4.1-1"; knownRockspec = (fetchurl { - url = "https://luarocks.org/luaexpat-1.3.0-1.rockspec"; - sha256 = "14f7y2acycbgrx95w3darx5l1qm52a09f7njkqmhyk10w615lrw4"; + url = "https://luarocks.org/luaexpat-1.4.1-1.rockspec"; + sha256 = "1abwd385x7wnza7qqz5s4aj6m2l1c23pjmbgnpq73q0s17pn1h0c"; }).outPath; - src = fetchurl { - url = "http://matthewwild.co.uk/projects/luaexpat/luaexpat-1.3.0.tar.gz"; - sha256 = "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h"; - }; + src = fetchgit ( removeAttrs (builtins.fromJSON ''{ + "url": "https://github.com/lunarmodules/luaexpat.git", + "rev": "7d99eec9685087e6b3a57a09d672591c2aa0f4f6", + "date": "2022-04-01T17:08:05+02:00", + "path": "/nix/store/b6jyh79ggjdqgizk9amzh74lq4lwm3nm-luaexpat", + "sha256": "0yia3xpf6pwmy10yg2dnyfg3v774jay24qfyvm9pj21h2ad7ckm1", + "fetchLFS": false, + "fetchSubmodules": true, + "deepClone": false, + "leaveDotGit": false +} + '') ["date" "path"]) ; disabled = with lua; (luaOlder "5.1"); propagatedBuildInputs = [ lua ]; meta = { - homepage = "http://www.keplerproject.org/luaexpat/"; + homepage = "https://lunarmodules.github.io/luaexpat"; description = "XML Expat parsing"; maintainers = with lib.maintainers; [ arobyn flosse ]; license.fullName = "MIT/X11"; diff --git a/pkgs/development/lua-modules/luaexpat.patch b/pkgs/development/lua-modules/luaexpat.patch deleted file mode 100644 index 3dd609108426..000000000000 --- a/pkgs/development/lua-modules/luaexpat.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/src/lxplib.c b/src/lxplib.c -index 1c972db..5712611 100644 ---- a/src/lxplib.c -+++ b/src/lxplib.c -@@ -590,7 +590,7 @@ static void set_info (lua_State *L) { - /* - ** Adapted from Lua 5.2.0 - */ --static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { -+static void compat_luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { - luaL_checkstack(L, nup, "too many upvalues"); - for (; l->name != NULL; l++) { /* fill the table with given functions */ - int i; -@@ -602,6 +602,8 @@ static void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { - } - lua_pop(L, nup); /* remove upvalues */ - } -+#else -+#define compat_luaL_setfuncs(L, reg, nup) luaL_setfuncs(L, reg, nup) - #endif - - -@@ -612,11 +614,11 @@ int luaopen_lxp (lua_State *L) { - lua_pushvalue(L, -2); - lua_rawset(L, -3); - -- luaL_setfuncs (L, lxp_meths, 0); -+ compat_luaL_setfuncs (L, lxp_meths, 0); - lua_pop (L, 1); /* remove metatable */ - - lua_newtable (L); -- luaL_setfuncs (L, lxp_funcs, 0); -+ compat_luaL_setfuncs (L, lxp_funcs, 0); - set_info (L); - return 1; - } diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index b659bd9382ad..1411038e0c7f 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -206,9 +206,6 @@ with prev; externalDeps = [ { name = "EXPAT"; dep = pkgs.expat; } ]; - patches = [ - ./luaexpat.patch - ]; }); # TODO Somehow automatically amend buildInputs for things that need luaffi diff --git a/pkgs/development/python-modules/elkm1-lib/default.nix b/pkgs/development/python-modules/elkm1-lib/default.nix index 41a6436c3bc9..57c51964fc8d 100644 --- a/pkgs/development/python-modules/elkm1-lib/default.nix +++ b/pkgs/development/python-modules/elkm1-lib/default.nix @@ -11,7 +11,7 @@ buildPythonPackage rec { pname = "elkm1-lib"; - version = "1.3.5"; + version = "1.3.6"; format = "pyproject"; disabled = pythonOlder "3.6"; @@ -20,7 +20,7 @@ buildPythonPackage rec { owner = "gwww"; repo = "elkm1"; rev = version; - hash = "sha256-sYE7bZcMXsf+4r9Rs4d0XaUqdWVZfDU9/xPqIiiJkUQ="; + hash = "sha256-aIqwb2YHw/kYHBqydelTRs2+75WimgJ+4X0BYcwogh8="; }; nativeBuildInputs = [ diff --git a/pkgs/development/python-modules/fastjsonschema/default.nix b/pkgs/development/python-modules/fastjsonschema/default.nix index 415f226b783c..23a552a9b4cd 100644 --- a/pkgs/development/python-modules/fastjsonschema/default.nix +++ b/pkgs/development/python-modules/fastjsonschema/default.nix @@ -1,24 +1,23 @@ { lib , buildPythonPackage , fetchFromGitHub -, fetchpatch , pytestCheckHook , pythonOlder }: buildPythonPackage rec { pname = "fastjsonschema"; - version = "2.15.2"; + version = "2.15.3"; format = "setuptools"; - disabled = pythonOlder "3.3"; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "horejsek"; repo = "python-fastjsonschema"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-zrdQVFfLZxZRr9qvss4CI3LJK97xl+bY+AcPzcweYeU="; + sha256 = "sha256-WKnjSlKtMGpWKPbPr7hpS6Dg0+9i/nWVYmar0N3Q9Pc="; }; checkInputs = [ @@ -27,16 +26,6 @@ buildPythonPackage rec { dontUseSetuptoolsCheck = true; - patches = [ - # Can be removed with the next release, https://github.com/horejsek/python-fastjsonschema/pull/134 - (fetchpatch { - name = "fix-exception-name.patch"; - url = "https://github.com/horejsek/python-fastjsonschema/commit/f639dcba0299926d688e1d8d08a6a91bfe70ce8b.patch"; - sha256 = "sha256-yPV5ZNeyAobLrYf5QHanPsEomBPJ/7ZN2148R8NO4/U="; - }) - ]; - - disabledTests = [ "benchmark" # these tests require network access diff --git a/pkgs/development/python-modules/pysensibo/default.nix b/pkgs/development/python-modules/pysensibo/default.nix index a4973efe5049..98cf9444b0e6 100644 --- a/pkgs/development/python-modules/pysensibo/default.nix +++ b/pkgs/development/python-modules/pysensibo/default.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { pname = "pysensibo"; - version = "1.0.12"; + version = "1.0.14"; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "andrey-git"; repo = pname; rev = version; - hash = "sha256-gXdyVEBcYCUOo8PHzsJLkjtnX1B1iRS/DAxdQDU3HaY="; + hash = "sha256-r2YIQ6JPyRWzfXprj3tFwrsAR0NtmVLncWZAsLkAzSA="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/tern/default.nix b/pkgs/development/python-modules/tern/default.nix index 2e7aa7086291..c0bceca72b80 100644 --- a/pkgs/development/python-modules/tern/default.nix +++ b/pkgs/development/python-modules/tern/default.nix @@ -17,11 +17,11 @@ buildPythonPackage rec { pname = "tern"; - version = "2.9.1"; + version = "2.10.0"; src = fetchPypi { inherit pname version; - sha256 = "c7ce55a500061e1160b040e75dc38d0eccc790a2b70fa3b7ad1b4fb715c18fc9"; + sha256 = "sha256-KpkEnpItHC/9IswfboFZ5nCcGaM9bWFX/i+6jxGN5hg="; }; preBuild = '' diff --git a/pkgs/development/python-modules/typical/default.nix b/pkgs/development/python-modules/typical/default.nix index 96a07802b1c8..066c3f452ed1 100644 --- a/pkgs/development/python-modules/typical/default.nix +++ b/pkgs/development/python-modules/typical/default.nix @@ -14,7 +14,7 @@ , pytestCheckHook , pythonOlder , sqlalchemy -, typing-extensions +, ujson }: buildPythonPackage rec { @@ -22,7 +22,8 @@ buildPythonPackage rec { version = "2.8.0"; format = "pyproject"; - disabled = pythonOlder "3.7"; + # Support for typing-extensions >= 4.0.0 on Python < 3.10 is missing + disabled = pythonOlder "3.10"; src = fetchFromGitHub { owner = "seandstewart"; @@ -36,13 +37,12 @@ buildPythonPackage rec { ]; propagatedBuildInputs = [ - inflection - pendulum fastjsonschema - orjson future-typing - ] ++ lib.optionals (pythonOlder "3.10") [ - typing-extensions + inflection + orjson + pendulum + ujson ]; checkInputs = [ @@ -63,13 +63,14 @@ buildPythonPackage rec { ]; disabledTests = [ - # We use orjson - "test_ujson" # ConstraintValueError: Given value <{'key... "test_tagged_union_validate" + # TypeError: 'NoneType' object cannot be interpreted as an integer + "test_ujson" ]; disabledTestPaths = [ + # We don't care about benchmarks "benchmark/" # Tests are failing on Hydra "tests/mypy/test_mypy.py" diff --git a/pkgs/development/python-modules/xknx/default.nix b/pkgs/development/python-modules/xknx/default.nix index 3706e87bbeb0..efb944c4a71d 100644 --- a/pkgs/development/python-modules/xknx/default.nix +++ b/pkgs/development/python-modules/xknx/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { pname = "xknx"; - version = "0.21.0"; + version = "0.21.1"; format = "setuptools"; disabled = pythonOlder "3.8"; @@ -21,7 +21,7 @@ buildPythonPackage rec { owner = "XKNX"; repo = pname; rev = "refs/tags/${version}"; - sha256 = "sha256-9fpWl9mYhYwc8Ig4uCF1RJvWS3LqrZQx88IrdaSPo7c="; + sha256 = "sha256-QNy/jUh/kIj6sabWnmC5L00ikBTrVmOEp6mFBya29WM="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/tools/analysis/checkov/default.nix b/pkgs/development/tools/analysis/checkov/default.nix index 29a34ce62711..92bcfec2790e 100644 --- a/pkgs/development/tools/analysis/checkov/default.nix +++ b/pkgs/development/tools/analysis/checkov/default.nix @@ -32,13 +32,13 @@ with py.pkgs; buildPythonApplication rec { pname = "checkov"; - version = "2.0.1098"; + version = "2.0.1102"; src = fetchFromGitHub { owner = "bridgecrewio"; repo = pname; rev = version; - hash = "sha256-CFH7zb3f50tlYhRiZ/q0b8PDhithVhaeRTtsXvan+bw="; + hash = "sha256-OPYlgj8jdgCQJddy9UUXMjHJtQcoMrZbghgPUdyUV5Y="; }; nativeBuildInputs = with py.pkgs; [ diff --git a/pkgs/development/tools/fq/default.nix b/pkgs/development/tools/fq/default.nix index add4e21be89d..76757e1f8914 100644 --- a/pkgs/development/tools/fq/default.nix +++ b/pkgs/development/tools/fq/default.nix @@ -7,16 +7,16 @@ buildGoModule rec { pname = "fq"; - version = "0.0.6"; + version = "0.0.7"; src = fetchFromGitHub { owner = "wader"; repo = "fq"; rev = "v${version}"; - sha256 = "sha256-/9TBnhFGYNOcCsQKUF0uuJEgnF+qRGly/5z1s3sYhqY="; + sha256 = "sha256-4bCJcLpU/k87p884jw9Gq1i6ocuD4vMn4PuOStihssE="; }; - vendorSha256 = "sha256-zvtYyNJO4QoTes3vf6CFa3dYMJqkp0PG9pnOk+aO97Y="; + vendorSha256 = "sha256-XsMhxQ83nQO3fQ1EN2XxcZeN+I96h8mcAq+TNIvbTyo="; ldflags = [ "-s" diff --git a/pkgs/development/tools/jdt-language-server/default.nix b/pkgs/development/tools/jdt-language-server/default.nix new file mode 100644 index 000000000000..e79d212c7d4a --- /dev/null +++ b/pkgs/development/tools/jdt-language-server/default.nix @@ -0,0 +1,103 @@ +{ lib +, stdenv +, fetchurl +, makeWrapper +, jdk +}: + +stdenv.mkDerivation rec { + pname = "jdt-language-server"; + version = "1.8.0"; + timestamp = "202201261434"; + + src = fetchurl { + url = "https://download.eclipse.org/jdtls/milestones/${version}/jdt-language-server-${version}-${timestamp}.tar.gz"; + sha256 = "0wlnsr72hncdqrbpgfl9hgwqw9d9rppq4iymnjmgfn51rjcqadv8"; + }; + + sourceRoot = "."; + + buildInputs = [ + jdk + ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + installPhase = + let + # The application ships with config directories for linux and mac + configDir = if stdenv.isDarwin then "config_mac" else "config_linux"; + in + '' + # Copy jars + install -D -t $out/share/java/plugins/ plugins/*.jar + + # Copy config directories for linux and mac + install -Dm 444 -t $out/share/config ${configDir}/* + + # Get latest version of launcher jar + # e.g. org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar + launcher="$(ls $out/share/java/plugins/org.eclipse.equinox.launcher_* | sort -V | tail -n1)" + + # The wrapper script will create a directory in the user's cache, copy in the config + # files since this dir can't be read-only, and by default use this as the runtime dir. + # + # The following options are required as per the upstream documentation: + # + # -Declipse.application=org.eclipse.jdt.ls.core.id1 + # -Dosgi.bundles.defaultStartLevel=4 + # -Declipse.product=org.eclipse.jdt.ls.core.product + # -noverify + # --add-modules=ALL-SYSTEM + # --add-opens java.base/java.util=ALL-UNNAMED + # --add-opens java.base/java.lang=ALL-UNNAMED + # + # The following options configure the server to run without writing logs to the nix store: + # + # -Dosgi.sharedConfiguration.area.readOnly=true + # -Dosgi.checkConfiguration=true + # -Dosgi.configuration.cascaded=true + # -Dosgi.sharedConfiguration.area=$out/share/config + # + # Other options which the caller may change: + # + # -Dlog.level: + # Log level. + # This can be overidden by setting JAVA_OPTS. + # + # The caller must specify the following: + # + # -data: + # The application stores runtime data here. We set this to /$PWD + # so that projects don't collide with each other. + # This can be overidden by specifying -configuration to the wrapper. + # + # Java options, such as -Xms and Xmx can be specified by setting JAVA_OPTS. + # + makeWrapper ${jdk}/bin/java $out/bin/jdt-language-server \ + --add-flags "-Declipse.application=org.eclipse.jdt.ls.core.id1" \ + --add-flags "-Dosgi.bundles.defaultStartLevel=4" \ + --add-flags "-Declipse.product=org.eclipse.jdt.ls.core.product" \ + --add-flags "-Dosgi.sharedConfiguration.area=$out/share/config" \ + --add-flags "-Dosgi.sharedConfiguration.area.readOnly=true" \ + --add-flags "-Dosgi.checkConfiguration=true" \ + --add-flags "-Dosgi.configuration.cascaded=true" \ + --add-flags "-Dlog.level=ALL" \ + --add-flags "-noverify" \ + --add-flags "\$JAVA_OPTS" \ + --add-flags "-jar $launcher" \ + --add-flags "--add-modules=ALL-SYSTEM" \ + --add-flags "--add-opens java.base/java.util=ALL-UNNAMED" \ + --add-flags "--add-opens java.base/java.lang=ALL-UNNAMED" + ''; + + meta = with lib; { + homepage = "https://github.com/eclipse/eclipse.jdt.ls"; + description = "Java language server"; + license = licenses.epl20; + maintainers = with maintainers; [ matt-snider ]; + }; +} + diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix index f42acee87b51..a99523cfd703 100644 --- a/pkgs/servers/nosql/redis/default.nix +++ b/pkgs/servers/nosql/redis/default.nix @@ -7,11 +7,11 @@ stdenv.mkDerivation rec { pname = "redis"; - version = "6.2.6"; + version = "7.0.0"; src = fetchurl { url = "https://download.redis.io/releases/${pname}-${version}.tar.gz"; - sha256 = "1ariw5x33hmmm3d5al0j3307l5kf3vhmn78wpyaz67hia1x8nasv"; + sha256 = "sha256-KE2L0f2F1qVaBe5OfDHDGXetVsvzRO2DeQvusUi6pyA="; }; # Cross-compiling fixes @@ -56,6 +56,12 @@ stdenv.mkDerivation rec { substituteInPlace tests/integration/replication.tcl \ --replace 'foreach mdl {no yes}' 'foreach mdl {}' + substituteInPlace tests/support/server.tcl \ + --replace 'exec /usr/bin/env' 'exec env' + + sed -i '/^proc wait_load_handlers_disconnected/{n ; s/wait_for_condition 50 100/wait_for_condition 50 500/; }' \ + tests/support/util.tcl + ./runtest \ --no-latency \ --timeout 2000 \ diff --git a/pkgs/servers/web-apps/nifi/default.nix b/pkgs/servers/web-apps/nifi/default.nix index f25c1931501e..b53b53aaf5c7 100644 --- a/pkgs/servers/web-apps/nifi/default.nix +++ b/pkgs/servers/web-apps/nifi/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "nifi"; - version = "1.16.0"; + version = "1.16.1"; src = fetchurl { url = "https://dlcdn.apache.org/nifi/${version}/nifi-${version}-bin.tar.gz"; - sha256 = "sha256-BE990mVSocO+UuMa9kULJcbXbqiX8oquZQTQKSRPe4g="; + sha256 = "sha256-wC+oKq8QGEKuD6B22Ny92NK0z3SBKmRoTEit3vAXJQs="; }; nativeBuildInputs = [ makeWrapper ]; diff --git a/pkgs/tools/networking/magic-wormhole-rs/default.nix b/pkgs/tools/networking/magic-wormhole-rs/default.nix index 951a06643764..3d9e20d14dce 100644 --- a/pkgs/tools/networking/magic-wormhole-rs/default.nix +++ b/pkgs/tools/networking/magic-wormhole-rs/default.nix @@ -4,7 +4,7 @@ , rustPlatform }: rustPlatform.buildRustPackage rec { - name = "magic-wormhole-rs"; + pname = "magic-wormhole-rs"; version = "0.3.0"; src = fetchFromGitHub { @@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec { # https://github.com/NixOS/nixpkgs/issues/30742 # and can probably be removed once the issue is resolved cargoPatches = [ ./Cargo.toml.patch ]; - cargoSha256 = "sha256-DG1kyukgzDbolX9Mg9hK1TRyzIWbAX6f54jSM8clj/c="; + cargoSha256 = "sha256-ujwvwr4GR/rQWnXFfL8sqPyz4QvGeOxwBrT+gf+vjsI="; # all tests involve networking and are bound fail doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dce530fae757..32cbe4085497 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24324,6 +24324,8 @@ with pkgs; iwona = callPackage ../data/fonts/iwona { }; + jdt-language-server = callPackage ../development/tools/jdt-language-server {}; + jetbrains-mono = callPackage ../data/fonts/jetbrains-mono { }; jost = callPackage ../data/fonts/jost { };