Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / search / quickwit / default.nix
blobccc32cb90056e0dbb0176d409faf33a3dc6f4f2b
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , rustPlatform
5 , nixosTests
6 , nix-update-script
7 , protobuf
8 , rust-jemalloc-sys
9 , Security
10 , nodejs
11 , yarn
12 , fetchYarnDeps
13 , fixup-yarn-lock
16 let
17   pname = "quickwit";
18   version = "0.8.2";
20   yarnOfflineCache = fetchYarnDeps {
21     yarnLock = "${src}/quickwit/quickwit-ui/yarn.lock";
22     hash = "sha256-HppK9ycUxCOIagvzCmE+VfcmfMQfPIC8WeWM6WbA6fQ=";
23   };
25   src = fetchFromGitHub {
26     owner = "quickwit-oss";
27     repo = pname;
28     rev = "v${version}";
29     hash = "sha256-OrCO0mCFmhYBdpr4Gps56KJJ37uuJpV6ZJHWspOScyw=";
30   };
32   quickwit-ui = stdenv.mkDerivation {
33     name = "quickwit-ui";
34     src = "${src}/quickwit/quickwit-ui";
36     nativeBuildInputs = [
37       nodejs
38       yarn
39       fixup-yarn-lock
40     ];
42     configurePhase = ''
43       export HOME=$(mktemp -d)
44     '';
46     buildPhase = ''
47       yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
48       fixup-yarn-lock yarn.lock
50       yarn install --offline \
51         --frozen-lockfile --no-progress \
52         --ignore-engines --ignore-scripts
53       patchShebangs .
55       yarn build
56     '';
58     installPhase = ''
59       mkdir $out
60       mv build/* $out
61     '';
62   };
64 rustPlatform.buildRustPackage rec {
65   inherit pname version src;
67   postPatch = ''
68     substituteInPlace ./quickwit-ingest/build.rs \
69       --replace-fail '.with_protos' '.with_includes(&["."]).with_protos'
70     substituteInPlace ./quickwit-codegen/example/build.rs \
71       --replace-fail '.with_protos' '.with_includes(&["."]).with_protos'
72     substituteInPlace ./quickwit-proto/build.rs \
73       --replace-fail '.with_protos' '.with_includes(&["."]).with_protos'
74   '';
76   sourceRoot = "${src.name}/quickwit";
78   preBuild = ''
79     mkdir -p quickwit-ui/build
80     cp -r ${quickwit-ui}/* quickwit-ui/build
81   '';
83   buildInputs = [
84     rust-jemalloc-sys
85   ] ++ lib.optionals stdenv.isDarwin [ Security ];
87   cargoLock = {
88     lockFile = ./Cargo.lock;
89     outputHashes = {
90       "chitchat-0.8.0" = "sha256-6K2noPoFaDnOxQIEV1WbmVPfRGwlI/WS1OWSBH2qb1Q=";
91       "mrecordlog-0.4.0" = "sha256-9LIVs+BqK9FLSfHL3vm9LL+/FXIXJ6v617QLv4luQik=";
92       "ownedbytes-0.6.0" = "sha256-in18/NYYIgUiZ9sm8NgJlebWidRp34DR7AhOD1Nh0aw=";
93       "pulsar-5.0.2" = "sha256-j7wpsAro6x4fk3pvSL4fxLkddJFq8duZ7jDj0Edf3YQ=";
94       "sasl2-sys-0.1.20+2.1.28" = "sha256-u4BsfmTDFxuY3i1amLCsr7MDv356YPThMHclura0Sxs=";
95       "whichlang-0.1.0" = "sha256-7AvLGjtWHjG0TnZdg9p5D+O0H19uo2sqPxJMn6mOU0k=";
96     };
97   };
99   CARGO_PROFILE_RELEASE_LTO = "fat";
100   CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1";
102   # needed for internal protobuf c wrapper library
103   PROTOC = "${protobuf}/bin/protoc";
104   PROTOC_INCLUDE = "${protobuf}/include";
106   passthru = {
107     tests = {
108       inherit (nixosTests) quickwit;
109       inherit (nixosTests.vector) syslog-quickwit;
110     };
111     updateScript = nix-update-script { };
112   };
114   checkFlags = [
115     # tries to make a network access
116     "--skip=test_all_local_index"
117     "--skip=test_cmd_create"
118     "--skip=test_cmd_create_no_index_uri"
119     "--skip=test_cmd_search_aggregation"
120     "--skip=test_cmd_search_with_snippets"
121     "--skip=test_delete_index_cli"
122     "--skip=test_delete_index_cli_dry_run"
123     "--skip=test_ingest_docs_cli"
124     "--skip=test_ingest_docs_cli_keep_cache"
125     "--skip=test_search_index_cli"
126     "--skip=test_garbage_collect_cli_no_grace"
127     "--skip=actors::indexing_service::tests::test_indexing_service_spawn_observe_detach"
128     "--skip=object_storage::s3_compatible_storage::tests::test_s3_compatible_storage_relative_path"
129     # flaky test
130     "--skip=actors::indexer::tests::test_indexer_triggers_commit_on_drained_mailbox"
131     "--skip=actors::indexer::tests::test_indexer_triggers_commit_on_timeout"
132     "--skip=actors::indexer::tests::test_indexer_partitioning"
133     "--skip=actors::indexing_pipeline::tests::test_merge_pipeline_does_not_stop_on_indexing_pipeline_failure"
134     "--skip=actors::indexer::tests::test_indexer_triggers_commit_on_target_num_docs"
135     "--skip=actors::packager::tests::test_packager_simple"
136     # fail on darwin for some reason
137     "--skip=io::tests::test_controlled_writer_limited_async"
138     "--skip=io::tests::test_controlled_writer_limited_sync"
139   ];
141   meta = with lib; {
142     description = "Sub-second search & analytics engine on cloud storage";
143     homepage = "https://quickwit.io/";
144     license = licenses.agpl3Only;
145     maintainers = with maintainers; [ happysalada ];
146     platforms = platforms.all;
147   };