You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix wheel auto-detection and rework install to use symlinks (#2721)
* fix: resolve wheel auto-detection from executable path
Also pick the latest wheel when multiple versions exist in dist/
(filepath.Glob returns lexicographic order, so use last match).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: replace make install with mise run install using symlinks
Update development docs in CONTRIBUTING.md and README.md to document
all three build components (SDK, coglet, CLI) and their build order.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: document coglet linux wheel build and llms.txt regeneration in AGENTS.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: AGENTS.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ Development tasks are managed with [mise](https://mise.jdx.dev/). Run `mise task
32
32
|`mise run build:cog`| Build cog CLI binary |
33
33
|`mise run build:coglet`| Build coglet wheel (dev) |
34
34
|`mise run build:sdk`| Build SDK wheel |
35
+
|`mise run install`| Build and symlink cog to /usr/local/bin |
35
36
36
37
### Task Naming Convention
37
38
@@ -70,6 +71,10 @@ Tasks follow a consistent naming pattern:
70
71
-`mise run build:coglet:wheel:linux-arm64` - Build for Linux ARM64
71
72
-`mise run build:sdk` - Build SDK wheel
72
73
74
+
**Install:**
75
+
-`mise run install` - Symlink cog CLI to `/usr/local/bin` (requires `build:cog` first)
76
+
-`PREFIX=/custom/path mise run install` - Symlink to custom location
77
+
73
78
**Other:**
74
79
-`mise run typecheck` - Type check all languages
75
80
-`mise run generate` - Run code generation
@@ -123,7 +128,7 @@ The CLI code is in the `cmd/cog/` and `pkg/` directories. Support tooling is in
123
128
The main commands for working on the CLI are:
124
129
-`go run ./cmd/cog` - Runs the Cog CLI directly from source (requires wheel to be built first)
125
130
-`mise run build:cog` - Builds the Cog CLI binary, embedding the Python wheel
126
-
-`make install` - Builds and installs the Cog CLI binary to `/usr/local/bin`, or to a custom path with `make install PREFIX=/custom/path`
131
+
-`mise run install` - Symlinks the built binary to `/usr/local/bin` (run `build:cog` first), or to a custom path with `PREFIX=/custom/path mise run install`
127
132
-`mise run test:go` - Runs all Go unit tests
128
133
-`go test ./pkg/...` - Runs tests directly with `go test`
129
134
@@ -144,7 +149,8 @@ The code is in the `crates/` directory:
144
149
For detailed architecture documentation, see `crates/README.md` and `crates/coglet/README.md`.
145
150
146
151
The main commands for working on Coglet are:
147
-
-`mise run build:coglet` - Build and install coglet wheel for development
152
+
-`mise run build:coglet` - Build and install coglet wheel for development (macOS, for local Rust/Python tests)
153
+
-`mise run build:coglet:wheel:linux-x64` - Build Linux x86_64 wheel (required to test Rust changes in Docker containers via `cog predict`/`cog train`)
148
154
-`mise run test:rust` - Run Rust unit tests
149
155
-`mise run lint:rust` - Run clippy linter
150
156
-`mise run fmt:rust:fix` - Format code
@@ -164,16 +170,19 @@ The integration test suite in `integration-tests/` tests the end-to-end function
164
170
165
171
The integration tests require a built Cog binary, which defaults to the first `cog` in `PATH`. Run tests against a specific binary with the `COG_BINARY` environment variable:
166
172
```bash
167
-
make install PREFIX=./cog
168
-
COG_BINARY=./cog/cog mise run test:integration
173
+
mise run build:cog
174
+
COG_BINARY=dist/go/*/cog mise run test:integration
169
175
```
170
176
171
177
### Development Workflow
172
178
1. Run `mise install` to set up the development environment
173
179
2. Run `mise run build:sdk` after making changes to the `./python` directory
174
-
3. Run `mise run fmt:fix` to format code
175
-
4. Run `mise run lint` to check code quality
176
-
5. Read the `./docs` directory and make sure the documentation is up to date
180
+
3. Run `mise run build:coglet:wheel:linux-x64` after making changes to the `./crates` directory (needed for Docker testing)
181
+
4. Run `mise run build:cog` to build the CLI (embeds the SDK wheel; picks up coglet wheel from `dist/`)
182
+
5. Run `mise run fmt:fix` to format code
183
+
6. Run `mise run lint` to check code quality
184
+
7. Run `mise run docs:llm` to regenerate `docs/llms.txt` after changing `README.md` or any `docs/*.md` file
185
+
8. Read the `./docs` directory and make sure the documentation is up to date
return"", fmt.Errorf("%s=dist: no wheel matching '%s' found in %s\n\nTo build the wheel, run: mise run build:sdk (for cog) or mise run build:coglet (for coglet)", envVar, pattern, distDir)
186
+
return"", fmt.Errorf("%s=dist: no wheel matching '%s' found\n\nTo build the wheel, run: mise run build:sdk (for cog) or mise run build:coglet (for coglet)", envVar, pattern)
158
187
}
159
188
160
189
// findWheelInDistSilent is like findWheelInDist but returns empty string instead of error.
161
190
// Used for auto-detection where missing wheel is not an error.
162
191
// If platformTag is non-empty, only wheels whose filename contains the tag are considered.
192
+
// When multiple wheels match, the last one in lexicographic order is used (highest version).
0 commit comments