22 Oct 2024 |
just1602 | KFears (tragedy arc): out of curiosity, what are you "bad git habits"? | 18:06:46 |
23 Oct 2024 |
| @navi:tchncs.de joined the room. | 05:22:28 |
uep | oof, just had a lix crash pulling in a flake update .. | 08:42:07 |
uep | oh, no, never mind, there are conflict markers in flake.lock | 08:42:53 |
KFears (tragedy arc) | I really need someone to help me out on this... I'm writing a test in Python for Lix. I'm literally trying to do the bare minimum right now. This code hangs infinitely. If I launch the shebang manually - it runs in 2 seconds successfully. How do I even debug this?
from .testlib.fixtures import Nix
from pathlib import Path
def test_trivial_shebang(nix: Nix):
trivial_shebang = '''
#! /usr/bin/env nix-shell
#! nix-shell --no-substitute
#! nix-shell --pure -i bash -p hello
hello
'''.strip()
trivial_path = nix.test_root / "shell.shebang.sh"
_ = trivial_path.write_text(trivial_shebang)
trivial_path.chmod(0o777)
result = nix.call([str(trivial_path), 'abc', 'def'])
new_path = Path("/tmp/something-something")
_ = new_path.write_text(result.stdout.decode('utf-8').strip())
assert result.ok().stdout.decode('utf-8').strip() == 'Hello, world! abc def'
| 14:30:48 |
piegames | Does strace show anything useful? | 14:43:45 |
KFears (tragedy arc) | Haven't tried that. I'm now trying to set all the same env vars and run the thing manually. It looks like something is happening, at the very least:
/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/xmlkd6c11nl1f3fsqqj2vpya6ll9vra7-hello-2.12.1.tar.gz.drv
/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/yldz05a86ppdxzqsfj0kaf1mji4515kf-hello-2.12.1.drv
building '/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/q72pnadsjl15qp6l73dvdfig0jl920s6-bison-3.8.2.tar.gz.drv'...
building '/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/dxx9rkl5f0wni9rbrzi165x88wf1vw7v-gcc-12.3.0.tar.xz.drv'...
| 14:44:55 |
KFears (tragedy arc) | Uhh, so it looks like it pulled gcc from cache, and now it compiles Perl5... I really hope I'm not rebuilding stdenv | 14:52:33 |
KFears (tragedy arc) | make[3]: Entering directory '/build/bison-3.8.2/runtime-po'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/bison-3.8.2/runtime-po'
Making all in gnulib-po
make[3]: Entering directory '/build/bison-3.8.2/gnulib-po'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/bison-3.8.2/gnulib-po'
Making all in .
make[3]: Entering directory '/build/bison-3.8.2'
GEN doc/bison.help
make[3]: Leaving directory '/build/bison-3.8.2'
make[2]: Leaving directory '/build/bison-3.8.2'
/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/70j5mzii8q4z4y3gzk7yzm5r9795ngbp-bootstrap-tools/bin/bash ./tests/testsuite -C tests -j16 AUTOTEST_PATH='/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/g4nyddmadx9wnzry2g8rwnlgczdk8azg-bison-3.8.2/bin'
## --------------------------- ##
## GNU Bison 3.8.2 test suite. ##
## --------------------------- ##
5: Invalid inputs with {} ok
9: Invalid symbol declarations ok
13: Invalid $n and @n ok
14: Type Clashes ok
3: Invalid options ok
2: Invalid number of arguments ok
1: Generating Comments ok
4: Invalid inputs ok
21: Per-type %printer and %destructor redeclared ok
19: Symbol class redefinition ok
12: Symbol declarations ok
| 14:53:36 |
K900 | You are | 14:53:38 |
K900 | For sure | 14:53:40 |
KFears (tragedy arc) | Oh god how, why | 14:54:49 |
KFears (tragedy arc) | What have I done to deserve it | 14:54:59 |
K900 | Wrong store? | 14:55:25 |
KFears (tragedy arc) | But I thought the point is to have a temporary store for integration tests? | 14:59:44 |
KFears (tragedy arc) | Why doesn't it substitute? | 15:00:06 |
puck | …--no-substitute? | 15:04:04 |
KFears (tragedy arc) | I made a re-run without this flag, the logs are from there actually | 15:05:10 |
KFears (tragedy arc) | (I didn't find this flag in nix-shell manual so I'm not sure if it even exists) | 15:05:41 |
puck | hm. i wonder what config it is using. forgot the command to list config tho lol | 15:06:06 |
puck | oh, i see | 15:06:38 |
puck | you're not on a chroot store | 15:06:42 |
puck | so it can't reuse the substituted paths | 15:06:55 |
KFears (tragedy arc) | In reply to @kfears:matrix.org I made a re-run without this flag, the logs are from there actually Even if the flag would affect it, it would be pretty weird, because it substitutes gcc and some other things already | 15:07:02 |
puck | In reply to @kfears:matrix.org
make[3]: Entering directory '/build/bison-3.8.2/runtime-po'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/bison-3.8.2/runtime-po'
Making all in gnulib-po
make[3]: Entering directory '/build/bison-3.8.2/gnulib-po'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/build/bison-3.8.2/gnulib-po'
Making all in .
make[3]: Entering directory '/build/bison-3.8.2'
GEN doc/bison.help
make[3]: Leaving directory '/build/bison-3.8.2'
make[2]: Leaving directory '/build/bison-3.8.2'
/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/70j5mzii8q4z4y3gzk7yzm5r9795ngbp-bootstrap-tools/bin/bash ./tests/testsuite -C tests -j16 AUTOTEST_PATH='/tmp/pytest-of-nixchad/pytest-31/popen-gw2/test_trivial_shebang0/store/g4nyddmadx9wnzry2g8rwnlgczdk8azg-bison-3.8.2/bin'
## --------------------------- ##
## GNU Bison 3.8.2 test suite. ##
## --------------------------- ##
5: Invalid inputs with {} ok
9: Invalid symbol declarations ok
13: Invalid $n and @n ok
14: Type Clashes ok
3: Invalid options ok
2: Invalid number of arguments ok
1: Generating Comments ok
4: Invalid inputs ok
21: Per-type %printer and %destructor redeclared ok
19: Symbol class redefinition ok
12: Symbol declarations ok
note how it mentions /tmp/pytest-of-…/store and not /nix/store | 15:08:14 |
KFears (tragedy arc) | Right, but I thought that's expected, because my store is literally on a different path from /nix/store ? | 15:09:31 |
KFears (tragedy arc) | I vaguely remember something about the store being cursed and pretty much hardcoded to /nix/store if you don't try to have a bad time, but I only remember it vaguely | 15:10:38 |
puck | In reply to @kfears:matrix.org Right, but I thought that's expected, because my store is literally on a different path from /nix/store ? yes, so it won't be able to substitute | 15:10:43 |
KFears (tragedy arc) | In reply to @puck:puck.moe yes, so it won't be able to substitute Why? | 15:11:21 |
puck | because the store dirs don't match; it can't just replace /nix/store with a longer string | 15:11:55 |