nandi/frqpublic Fork 0
85852e8
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Carry the loader's .git fix over

The vendored copy, matching modal 6718f3d: the image build drops
$workdir/.git, so a worktree's gitdir pointer never reaches a container.
Both frq containers were working around it in their own commands; they no
longer have to, and an interactive shell in the same image gets it too.

This is the drift the vendoring was always going to have. Two copies, one
fix, applied by hand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-13T23:29:39-07:00 Browse files
85852e8 parent: c20643a
modified .modal/_loader.py +9 -1
@@ -1,6 +1,7 @@
11 """Turn a `container.toml` into a `modal.Image` and a `modal.App`.
22
3-Every container under `containers/` is a directory with a `container.toml` and
3+Every container -- under `containers/` here, `.modal/` in a repo that merely
4+builds itself on Modal -- is a directory with a `container.toml` and
45 a stub `container.py`. See `spec.md` for the keys; this file is what reads
56 them. Nothing here is Modal-specific configuration in its own right -- each
67 spec key maps onto a documented Modal argument, and the mapping is meant to
@@ -207,6 +208,13 @@ class Container:
207208 else:
208209 image = image.add_local_file(src, dest, copy=True)
209210
211+ # A repo copied in brings its `.git` along, and in a worktree that is a
212+ # *file* holding `gitdir: <path on the machine that copied it>`. Nix
213+ # believes it and goes looking for a checkout that is not there --
214+ # `nix develop` and `nix build .#x` both die before evaluating
215+ # anything. Nothing in a container wants the git metadata, so it goes.
216+ image = image.run_commands(f"rm -rf {self.workdir}/.git")
217+
210218 if commands := build.get("commands", []):
211219 image = image.run_commands(*commands)
212220
@@ -1,6 +1,7 @@
1 """Turn a `container.toml` into a `modal.Image` and a `modal.App`.1 """Turn a `container.toml` into a `modal.Image` and a `modal.App`.
2 2
3-Every container under `containers/` is a directory with a `container.toml` and3+Every container -- under `containers/` here, `.modal/` in a repo that merely
4+builds itself on Modal -- is a directory with a `container.toml` and
4 a stub `container.py`. See `spec.md` for the keys; this file is what reads5 a stub `container.py`. See `spec.md` for the keys; this file is what reads
5 them. Nothing here is Modal-specific configuration in its own right -- each6 them. Nothing here is Modal-specific configuration in its own right -- each
6 spec key maps onto a documented Modal argument, and the mapping is meant to7 spec key maps onto a documented Modal argument, and the mapping is meant to
@@ -207,6 +208,13 @@ class Container:
207 else:208 else:
208 image = image.add_local_file(src, dest, copy=True)209 image = image.add_local_file(src, dest, copy=True)
209 210
211+ # A repo copied in brings its `.git` along, and in a worktree that is a
212+ # *file* holding `gitdir: <path on the machine that copied it>`. Nix
213+ # believes it and goes looking for a checkout that is not there --
214+ # `nix develop` and `nix build .#x` both die before evaluating
215+ # anything. Nothing in a container wants the git metadata, so it goes.
216+ image = image.run_commands(f"rm -rf {self.workdir}/.git")
217+
210 if commands := build.get("commands", []):218 if commands := build.get("commands", []):
211 image = image.run_commands(*commands)219 image = image.run_commands(*commands)
212 220