forked from flox/flox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.toml
508 lines (437 loc) · 13.4 KB
/
config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
[vars]
[resolve.empty]
# Not actually a resolve response, just have to put it somewhere
skip_if_output_exists = "empty.json"
cmd = '''
echo "[]" > empty.json
'''
post_cmd = '''
main_output_dir="$(dirname $(dirname $RESPONSE_FILE))"
mv empty.json "$main_output_dir/empty.json"
'''
[resolve.failed_resolution]
pre_cmd = '''
flox init
'''
cmd = "flox install definitely-not-a-package"
ignore_cmd_errors = true
# Install a package that doesn't exist and that doesn't have suggestions
[resolve.badpkg]
pre_cmd = "flox init"
cmd = "flox install badpkg"
ignore_cmd_errors = true
# Install multiple packages that don't exist
[resolve.badpkg1_badpkg2]
pre_cmd = "flox init"
cmd = "flox install badpkg1 badpkg2"
ignore_cmd_errors = true
# Install a package that doesn't exist and a another that does only exist on Linux
[resolve.badpkg_bpftrace]
pre_cmd = "flox init"
cmd = "flox install badpkg bpftrace"
ignore_cmd_errors = true
# Install a package that only exists on Linux
[resolve.bpftrace]
pre_cmd = "flox init"
cmd = "flox install bpftrace"
# Install multiple packages that only exist on Linux
[resolve.bpftrace_systemd]
pre_cmd = "flox init"
cmd = "flox install bpftrace systemd"
ignore_cmd_errors = true
[resolve.curl_hello]
pre_cmd = "flox init"
cmd = "flox install curl hello"
[resolve.emacs]
pre_cmd = "flox init"
cmd = "flox install emacs"
[resolve.emacs_vim]
pre_cmd = "flox init"
cmd = "flox install emacs vim"
[resolve.gzip]
pre_cmd = "flox init"
cmd = "flox install gzip"
[resolve.glibc]
pre_cmd = '''
flox init
tomlq --in-place --toml-output '.options.systems = [ "x86_64-linux" ]' .flox/env/manifest.toml
'''
cmd = "flox install glibc"
ignore_cmd_errors = true # build will fail on macos, thats fine
[resolve.glibc_incompatible]
pre_cmd = '''
flox init
tomlq --in-place --toml-output '.options.systems = [ "x86_64-linux" ]' .flox/env/manifest.toml
'''
cmd = '''
tomlq --in-place --toml-output '.options.systems = [ "x86_64-linux", "aarch64-darwin" ]' .flox/env/manifest.toml
flox install glibc || true
'''
ignore_cmd_errors = true # build will fail on macos, thats fine
[resolve.influxdb2]
pre_cmd = "flox init"
cmd = "flox install influxdb2"
[resolve.darwin_ps]
pre_cmd = '''
flox init
tomlq --in-place --toml-output '.options.systems = [ "x86_64-darwin" ]' .flox/env/manifest.toml
'''
cmd = "flox install darwin.ps"
ignore_cmd_errors = true # build will fail on linux, thats fine
[resolve.darwin_ps_incompatible]
pre_cmd = '''
flox init
'''
cmd = '''
tomlq --in-place --toml-output '.options.systems = [ "x86_64-darwin", "aarch64-linux" ]' .flox/env/manifest.toml
flox install darwin.ps
'''
ignore_cmd_errors = true # build will fail on linux, thats fine
[resolve.fish_3_2_2]
pre_cmd = "flox init"
cmd = "flox install [email protected]"
[resolve.hello]
pre_cmd = "flox init"
cmd = "flox install hello"
[resolve.hello_unfree]
pre_cmd = "flox init"
cmd = "flox install hello-unfree"
[resolve.jupyter_with_extensions]
pre_cmd = "flox init"
cmd = "flox install jupyter python312Packages.jupyterlab-widgets python312Packages.jupyterlab-git"
[resolve.go]
pre_cmd = "flox init"
cmd = "flox install go"
[resolve.krb5_after_prereqs_installed]
files = ["envs/krb5_prereqs/manifest.toml"]
pre_cmd = '''
flox init
flox edit -f manifest.toml
'''
cmd = "flox install krb5"
[resolve.ld_floxlib]
skip_if_output_exists = "envs/ld_floxlib"
files = ["envs/ld_floxlib/manifest.toml"]
pre_cmd = "flox init"
ignore_cmd_errors = true
cmd = "flox edit -f manifest.toml"
# Attempts an install for a package that doesn't exist but that *does* have suggestions
[resolve.node_suggestions]
pre_cmd = "flox init"
cmd = "flox install node"
ignore_cmd_errors = true
[resolve.old_hello]
pre_cmd = "flox init"
cmd = "flox install hello"
post_cmd = '''
cat "$RESPONSE_FILE" | jq | sed 's/"derivation": .*$/"derivation": "\/nix\/store\/AAA-hello-2.12.1.drv",/g' > tmp.json
mv tmp.json "$RESPONSE_FILE"
'''
# Install a specific version of Node that doesn't exist on x86_64-darwin
# so we get "constraints too tight" as a resolution message
[resolve.old_node]
pre_cmd = "flox init"
cmd = "flox install [email protected]"
ignore_cmd_errors = true
[resolve.overmind]
pre_cmd = "flox init"
cmd = "flox install overmind"
# Try to install a package that doesn't exist, but that *does* have suggestions
[resolve.package_suggestions]
pre_cmd = "flox init"
cmd = "flox install package"
ignore_cmd_errors = true
# This is useful for testing insecure packages
[resolve.python2]
pre_cmd = "flox init"
cmd = "flox install python2"
[resolve.python3]
pre_cmd = "flox init"
cmd = "flox install python3"
[resolve.python3_pip]
pre_cmd = "flox init"
cmd = "flox install -i pip python311Packages.pip python3"
[resolve."python311Packages.pip"]
pre_cmd = "flox init"
cmd = "flox install python311Packages.pip"
[resolve.redis]
pre_cmd = "flox init"
cmd = "flox install redis netcat"
[resolve."rubyPackages_3_2.rails"]
pre_cmd = "flox init"
cmd = "flox install rubyPackages_3_2.rails"
[resolve.rust-lib-src]
pre_cmd = "flox init"
cmd = "flox install rustPlatform.rustLibSrc"
[resolve.tabula]
pre_cmd = "flox init"
cmd = "flox install tabula"
ignore_cmd_errors = true # tabula is broken
# resolve.tabula_allowed is likely redundant and at least for the time being
# generates the same JSON as resolve.tabula.
# But broken is included in the resolution request,
# so include it here in case the server changes behavior.
[resolve.tabula_allowed]
pre_cmd = '''
flox init
tomlq --in-place --toml-output '.options.allow.broken = true' .flox/env/manifest.toml
'''
cmd = "flox install tabula"
[resolve.torchvision-bin]
pre_cmd = "flox init"
cmd = "flox install python311Packages.torchvision-bin"
ignore_cmd_errors = true
[resolve.webmention_ripgrep_rails]
pre_cmd = "flox init"
cmd = "flox install -i foo rubyPackages_3_2.webmention ripgrep -i bar rubyPackages_3_2.rails"
[resolve.vim]
pre_cmd = "flox init"
cmd = "flox install vim"
[resolve.vim-vim-full-conflict]
pre_cmd = "flox init"
cmd = "flox install vim vim-full"
ignore_cmd_errors = true # pacakges conflict
[search.hello]
cmd = "flox search hello"
[search.python]
cmd = "flox search python"
[search.surely_doesnt_exist]
# This command is intended to fail, it still dumps a useful response
cmd = "flox search surely_doesnt_exist || true"
[search.ello_all]
cmd = "flox search ello --all"
[search.exactly_ten]
cmd = "flox search python"
post_cmd = '''
cat "$RESPONSE_FILE" | jq '[{"count": 10, "results": .[0].results[:10]}]' > tmp.json
mv tmp.json "$RESPONSE_FILE"
'''
[search.java_suggestions]
cmd = "flox search java"
[show.hello]
cmd = "flox show hello"
[show.flask]
cmd = "flox show python310Packages.flask"
[init.go]
files = ["init/go/common", "init/go/module"]
pre_cmd = '''
cp -r {common,module}/* .
'''
cmd = "flox init --auto-setup"
[init.node_npm]
files = ["init/node/common", "init/node/npm"]
pre_cmd = '''
cp -r {common,npm}/* .
'''
cmd = "flox init --auto-setup"
[init.node_yarn]
files = ["init/node/common", "init/node/yarn"]
pre_cmd = '''
cp -r {common,yarn}/* .
'''
cmd = "flox init --auto-setup"
[init.python_poetry]
files = ["init/python/common", "init/python/poetry"]
pre_cmd = '''
cp -r {common,poetry}/* .
'''
cmd = "flox init --auto-setup"
[init.python_poetry_zlib]
files = ["init/python/common", "init/python/poetry"]
pre_cmd = '''
cp -r {common,poetry}/* .
flox init --auto-setup
'''
cmd = "flox install zlib"
[init.python_pyproject_pip]
files = ["init/python/common", "init/python/pyproject-pip"]
pre_cmd = '''
cp -r {common,pyproject-pip}/* .
'''
cmd = "flox init --auto-setup"
[init.python_pyproject_pip_zlib]
files = ["init/python/common", "init/python/pyproject-pip"]
pre_cmd = '''
cp -r {common,pyproject-pip}/* .
flox init --auto-setup
'''
cmd = "flox install zlib"
[init.python_requirements]
files = ["init/python/common", "init/python/requirements"]
pre_cmd = '''
cp -r {common,requirements}/* .
'''
cmd = "flox init --auto-setup"
[init.python_requirements_zlib]
files = ["init/python/common", "init/python/requirements"]
pre_cmd = '''
cp -r {common,requirements}/* .
flox init --auto-setup
'''
cmd = "flox install zlib"
[init.python_requests]
pre_cmd = '''
echo requests > requirements.txt
'''
cmd = "flox init --auto-setup"
[envs.go_gcc]
skip_if_output_exists = "envs/go_gcc"
files = ["envs/go_gcc/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/go_gcc"
mkdir -p "$env_dir"
cp .flox/env/manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
'''
[envs.kitchen_sink]
skip_if_output_exists = "envs/kitchen_sink"
files = ["envs/kitchen_sink/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/kitchen_sink"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
[envs.krb5_prereqs]
skip_if_output_exists = "envs/krb5_prereqs"
files = ["envs/krb5_prereqs/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/krb5_prereqs"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
# Used as an environment with a macOS-only package
[envs.darwin_ps]
skip_if_output_exists = "envs/darwin_ps"
files = ["envs/darwin_ps/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/darwin_ps"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
# Used as an environment with a Linux-only package
[envs.bpftrace]
skip_if_output_exists = "envs/bpftrace"
files = ["envs/bpftrace/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/bpftrace"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
# Used in list tests for packages whose install IDs != pkg-path
[envs.hello_as_greeting]
skip_if_output_exists = "envs/hello_as_greeting"
files = ["envs/hello_as_greeting/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/hello_as_greeting"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
# Used for list tests that only display packages for the current system
[envs.hello_and_htop_for_no_system]
skip_if_output_exists = "envs/hello_and_htop_for_no_system"
files = ["envs/hello_and_htop_for_no_system/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/hello_and_htop_for_no_system"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
# This is used as a package that doesn't have a version
[envs.influxdb2]
skip_if_output_exists = "envs/influxdb2"
files = ["envs/influxdb2/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/influxdb2"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
# Used in list tests to show the full pkg-path (pip)
[envs.pip]
skip_if_output_exists = "envs/pip"
files = ["envs/pip/manifest.toml"]
pre_cmd = "flox init"
cmd = "flox edit -f manifest.toml"
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/pip"
mkdir -p "$env_dir"
cp manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
mv "$RESPONSE_FILE" "$env_dir/$(basename $RESPONSE_FILE)"
'''
[envs.build-noop]
skip_if_output_exists = "envs/build-noop"
pre_cmd = "flox init"
cmd = '''
echo '
version = 1
[build]
hello.command = "echo hello"
' | flox edit -f -
'''
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/build-noop"
mkdir -p "$env_dir"
cp .flox/env/manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
'''
[envs.publish-simple]
skip_if_output_exists = "envs/publish-simple"
pre_cmd = "flox init"
cmd = '''
echo '
version = 1
[install]
hello.pkg-path = "hello"
[build]
mypkg.command = """
mkdir $out
echo -n "Happy Floxing!" > $out/mypkg
"""
' | flox edit -f -
'''
post_cmd = '''
envs_output_dir="$(dirname $RESPONSE_FILE)"
env_dir="$envs_output_dir/publish-simple"
mkdir -p "$env_dir"
cp .flox/env/manifest.toml "$env_dir/manifest.toml"
cp .flox/env/manifest.lock "$env_dir/manifest.lock"
'''