Skip to content
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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b305cd8d6f9d
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0e0b8f2feb81
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 18, 2020

  1. solr: drop 7.x series

    aanderse committed Jan 18, 2020
    Copy the full SHA
    acd9e87 View commit details
  2. solr: specify NixOS test

    aanderse committed Jan 18, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    pjanotti Paulo Janotti
    Copy the full SHA
    19185c5 View commit details
  3. solr: 8.4.0 -> 8.4.1

    aanderse committed Jan 18, 2020

    Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    1093736 View commit details

Commits on Jan 25, 2020

  1. Merge pull request #77983 from aanderse/solr

    solr: 8.4.0 -> 8.4.1
    aanderse authored Jan 25, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    magneticstain Josh Carlson
    Copy the full SHA
    0e0b8f2 View commit details
Showing with 56 additions and 112 deletions.
  1. +2 −10 nixos/modules/services/search/solr.nix
  2. +42 −59 nixos/tests/solr.nix
  3. +0 −35 pkgs/servers/search/solr/8.x.nix
  4. +9 −5 pkgs/servers/search/solr/default.nix
  5. +3 −3 pkgs/top-level/all-packages.nix
12 changes: 2 additions & 10 deletions nixos/modules/services/search/solr.nix
Original file line number Diff line number Diff line change
@@ -13,19 +13,11 @@ in
services.solr = {
enable = mkEnableOption "Solr";

# default to the 8.x series not forcing major version upgrade of those on the 7.x series
package = mkOption {
type = types.package;
default = if versionAtLeast config.system.stateVersion "19.09"
then pkgs.solr_8
else pkgs.solr_7
;
default = pkgs.solr;
defaultText = "pkgs.solr";
description = ''
Which Solr package to use. This defaults to version 7.x if
<literal>system.stateVersion &lt; 19.09</literal> and version 8.x
otherwise.
'';
description = "Which Solr package to use.";
};

port = mkOption {
101 changes: 42 additions & 59 deletions nixos/tests/solr.nix
Original file line number Diff line number Diff line change
@@ -1,65 +1,48 @@
{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../.. { inherit system config; }
}:
import ./make-test.nix ({ pkgs, ... }:

with import ../lib/testing.nix { inherit system pkgs; };
with pkgs.lib;

let
solrTest = package: makeTest {
machine =
{ config, pkgs, ... }:
{
# Ensure the virtual machine has enough memory for Solr to avoid the following error:
#
# OpenJDK 64-Bit Server VM warning:
# INFO: os::commit_memory(0x00000000e8000000, 402653184, 0)
# failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory.
virtualisation.memorySize = 2000;
{
name = "solr";
meta.maintainers = [ pkgs.stdenv.lib.maintainers.aanderse ];

services.solr.enable = true;
services.solr.package = package;
};
machine =
{ config, pkgs, ... }:
{
# Ensure the virtual machine has enough memory for Solr to avoid the following error:
#
# OpenJDK 64-Bit Server VM warning:
# INFO: os::commit_memory(0x00000000e8000000, 402653184, 0)
# failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory.
virtualisation.memorySize = 2000;

testScript = ''
startAll;
services.solr.enable = true;
};

$machine->waitForUnit('solr.service');
$machine->waitForOpenPort('8983');
$machine->succeed('curl --fail http://localhost:8983/solr/');
testScript = ''
startAll;
# adapted from pkgs.solr/examples/films/README.txt
$machine->succeed('sudo -u solr solr create -c films');
$machine->succeed(q(curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{
"add-field" : {
"name":"name",
"type":"text_general",
"multiValued":false,
"stored":true
},
"add-field" : {
"name":"initial_release_date",
"type":"pdate",
"stored":true
}
}')) =~ /"status":0/ or die;
$machine->succeed('sudo -u solr post -c films ${pkgs.solr}/example/films/films.json');
$machine->succeed('curl http://localhost:8983/solr/films/query?q=name:batman') =~ /"name":"Batman Begins"/ or die;
'';
};
in
{
solr_7 = solrTest pkgs.solr_7 // {
name = "solr_7";
meta.maintainers = [ lib.maintainers.aanderse ];
};
$machine->waitForUnit('solr.service');
$machine->waitForOpenPort('8983');
$machine->succeed('curl --fail http://localhost:8983/solr/');
solr_8 = solrTest pkgs.solr_8 // {
name = "solr_8";
meta.maintainers = [ lib.maintainers.aanderse ];
};
}
# adapted from pkgs.solr/examples/films/README.txt
$machine->succeed('sudo -u solr solr create -c films');
$machine->succeed(q(curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{
"add-field" : {
"name":"name",
"type":"text_general",
"multiValued":false,
"stored":true
},
"add-field" : {
"name":"initial_release_date",
"type":"pdate",
"stored":true
}
}')) =~ /"status":0/ or die;
$machine->succeed('sudo -u solr post -c films ${pkgs.solr}/example/films/films.json');
$machine->succeed('curl http://localhost:8983/solr/films/query?q=name:batman') =~ /"name":"Batman Begins"/ or die;
'';
})
35 changes: 0 additions & 35 deletions pkgs/servers/search/solr/8.x.nix

This file was deleted.

14 changes: 9 additions & 5 deletions pkgs/servers/search/solr/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ stdenv, fetchurl, jre, makeWrapper }:
{ stdenv, fetchurl, jre, makeWrapper, nixosTests }:

stdenv.mkDerivation rec {
pname = "solr";
version = "7.7.2";
version = "8.4.1";

src = fetchurl {
url = "mirror://apache/lucene/solr/${version}/solr-${version}.tgz";
sha256 = "1pr02d4sw5arig1brjb6j7ir644n8s737qsx6ll46di5iw1y93pb";
url = "mirror://apache/lucene/${pname}/${version}/${pname}-${version}.tgz";
sha256 = "00a35a6ppd4ngp80dxak3bqrp8vmx0wixr4x2h2p9qxj4khf2fgc";
};

nativeBuildInputs = [ makeWrapper ];
@@ -24,12 +24,16 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/post --set JAVA_HOME "${jre}"
'';

passthru.tests = {
inherit (nixosTests) solr;
};

meta = with stdenv.lib; {
homepage = "https://lucene.apache.org/solr/";
description = "Open source enterprise search platform from the Apache Lucene project";
license = licenses.asl20;
platforms = platforms.all;
maintainers = [ maintainers.domenkozar maintainers.aanderse ];
maintainers = with maintainers; [ domenkozar aanderse ];
};

}
6 changes: 3 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -6490,9 +6490,9 @@ in
inherit (darwin.apple_sdk.frameworks) Security;
};

solr = solr_8;
solr_7 = callPackage ../servers/search/solr { };
solr_8 = callPackage ../servers/search/solr/8.x.nix { };
solr = callPackage ../servers/search/solr { };
solr_7 = solr;
solr_8 = solr;

solvespace = callPackage ../applications/graphics/solvespace { };