Skip to content

Commit 251e3c5

Browse files
committed
Update copilot instructions with versioning and recent changes
- Document version macros in stackman.h - Update supported platforms (7 ABIs, no win_arm) - Document library deprecation (v1.0.1) - Add release process documentation - Document GitHub Releases workflow - Update version history
1 parent 154644d commit 251e3c5

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed

.github/copilot-instructions.md

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Copilot Instructions for stackman
22

33
## Overview
4-
Low-level C library for stack manipulation (continuations/co-routines). ~600 lines of C + assembly. Zero dependencies. Platforms: Linux (x86/x64/ARM), Windows (x86/x64/ARM). Toolchains: GCC, Clang, MSVC.
4+
Low-level C library for stack manipulation (continuations/co-routines). ~600 lines of C + assembly. Zero dependencies. **Current version: 1.0.1**
5+
6+
**Supported Platforms (7 ABIs):**
7+
- Linux: sysv_amd64, sysv_i386, arm32 (AAPCS), aarch64 (AAPCS64)
8+
- Windows: win_x86, win_x64, win_arm64
9+
10+
**Note:** Windows ARM32 (win_arm) support was removed in v1.0.0 (Microsoft SDK 10.0.26100.0+ dropped support)
11+
12+
**Toolchains:** GCC, Clang, MSVC (VS2017, VS2019, VS2022)
513

614
## Build Commands (FAST: <1 second)
715

@@ -22,19 +30,19 @@ make abiname # Print platform ABI (e.g., sysv_amd64)
2230
## Critical Build Notes
2331

2432
1. **Intel CET:** `-fcf-protection=none` flag REQUIRED (auto-added by disable_cet script). Stack switching incompatible with Shadow Stack.
25-
2. **Libraries ARE Committed:** `lib/**/*.a` and `lib/**/*.lib` are version controlled (unlike typical projects). CI rebuilds and commits them.
33+
2. **Libraries Deprecated in Repo:** As of v1.0.1, pre-built libraries are NO LONGER automatically committed. Download from [GitHub Releases](https://github.com/stackless-dev/stackman/releases) instead. `lib/` directory will be removed in v2.0.0.
2634
3. **Expected Warning:** Linker warning "missing .note.GNU-stack section" in test_asm is NORMAL - ignore it.
27-
4. **Artifacts:** `*.o`, `bin/`, `tmp/` NOT committed. Libraries in `lib/[ABI]/` ARE committed.
35+
4. **Artifacts:** `*.o`, `bin/`, `tmp/` NOT committed. Libraries available via GitHub Releases.
2836
5. **Incremental OK:** After code changes, just `make test`. Only clean when switching platforms.
2937

3038
## Project Structure
3139

3240
**Key Directories:**
33-
- `stackman/` - Main source: `stackman.h` (API), `stackman_switch.h`, `stackman_impl.h`, `platforms/` (15+ platform files)
41+
- `stackman/` - Main source: `stackman.h` (API + version macros), `stackman_switch.h`, `stackman_impl.h`, `platforms/` (15+ platform files)
3442
- `tests/` - 4 test files: `test.c` (6 tests), `test_cc.cc`, `test_static.c`, `test_asm.c/.S`
35-
- `lib/[ABI]/` - Pre-built libraries (COMMITTED to git)
43+
- `lib/[ABI]/` - Pre-built libraries (DEPRECATED - see lib/README.md, will be removed in v2.0.0)
3644
- `vs2017/`, `vs2019/`, `vs2022/` - Visual Studio projects
37-
- `tools/` - `abiname.sh`, `strip-lib.py`
45+
- `tools/` - `abiname.sh`, `abiname.c`, `strip-lib.py`
3846

3947
**Core API (2 functions only):**
4048
```c
@@ -46,12 +54,20 @@ void *stackman_call(stackman_cb_t callback, void *context, void *stack); // Cal
4654
4755
## CI Validation (.github/workflows/buildcommit.yml)
4856
49-
**Triggers:** Push to master/dev, PRs to master
57+
**Triggers:** Push to master/dev, PRs to master, tags (v*.*.*)
5058
5159
**Jobs:**
52-
1. **build-linux-gnu** (AMD64, i386, arm, aarch64) - installs cross-tools → `make all` → `make test` (qemu for ARM)
53-
2. **build-windows** (x86, x64, arm, arm64) - MSBuild → strip-lib.py → rebuild (MUST rebuild after strip!)
54-
3. **commit-artifacts** (push only) - downloads artifacts → commits libs → pushes
60+
1. **build-linux-gnu** (sysv_amd64, sysv_i386, arm32, aarch64) - installs cross-tools → `make all` → `make test` (qemu for ARM)
61+
2. **build-windows** (win_x86, win_x64, win_arm64) - MSBuild → strip-lib.py → rebuild (MUST rebuild after strip!)
62+
3. **commit-artifacts** (DISABLED as of v1.0.1) - Previously committed libs to repo, now disabled (if: false)
63+
4. **create-release** (tags only) - Creates GitHub Release with `stackman-{version}.tar.gz` containing all platforms
64+
65+
**Release Archive Contents:**
66+
- `stackman/` - Headers
67+
- `lib/{abi}/` - Pre-built libraries for all 7 platforms
68+
- `tools/` - Platform detection tools
69+
- `Makefile` - For `make abiname`
70+
- Documentation (README.md, LICENSE, CHANGELOG.md)
5571
5672
**Local validation:**
5773
```bash
@@ -80,17 +96,44 @@ git status # Verify no bin/, tmp/, *.o tracked
8096
## Configuration Files
8197
- **Build:** Makefile (Linux), vs2022/*.vcxproj (Windows)
8298
- **CI:** .github/workflows/buildcommit.yml
99+
- **Versioning:** stackman/stackman.h - STACKMAN_VERSION_MAJOR/MINOR/PATCH macros + STACKMAN_VERSION string
100+
- **Changelog:** CHANGELOG.md (documents all releases)
83101
- **Linting:** None configured
84102
- **Testing:** `make test` target
85-
- **.gitignore:** Excludes *.o, bin/, tmp/ BUT includes lib/**/*.a, lib/**/*.lib
103+
- **.gitignore:** Excludes *.o, bin/, tmp/ BUT still includes lib/**/*.a, lib/**/*.lib (deprecated, slated for removal)
86104

87105
## Development Tips
88106

89107
1. **Trust these instructions first** - search only if info incomplete/incorrect
90108
2. **Build is FAST** - rebuild freely (clean+test <1s)
91109
3. **Test after every change** - `make test` is fast and comprehensive
92110
4. **Cross-compilation optional** - CI validates all platforms, native x64 sufficient for most changes
93-
5. **Binary files in git** - lib/**/*.a, lib/**/*.lib ARE tracked (expect binary diffs)
111+
5. **No binary commits** - lib/ directory deprecated, use GitHub Releases
94112
6. **Zero dependencies** - don't add any
95113
7. **Minimal changes** - stable library, surgical edits only
96114
8. **Low-level code** - assembly is platform-specific, test on actual hardware
115+
116+
## Versioning & Releases
117+
118+
**Version Location:** `stackman/stackman.h`
119+
```c
120+
#define STACKMAN_VERSION_MAJOR 1
121+
#define STACKMAN_VERSION_MINOR 0
122+
#define STACKMAN_VERSION_PATCH 1
123+
#define STACKMAN_VERSION "1.0.1"
124+
```
125+
126+
**Release Process:**
127+
1. Update version in `stackman/stackman.h` (MAJOR.MINOR.PATCH)
128+
2. Update `CHANGELOG.md` with changes
129+
3. Commit changes: `git commit -m "Bump version to X.Y.Z"`
130+
4. Create tag: `git tag -a vX.Y.Z -m "Release vX.Y.Z"`
131+
5. Push: `git push upstream master && git push upstream vX.Y.Z`
132+
6. CI automatically creates GitHub Release with pre-built libraries
133+
134+
**Version History:**
135+
- v0.1 (2020-05-18) - Initial release
136+
- v0.2 (retroactive tag) - Pre-1.0 development state
137+
- v1.0.0 (2025-11-16) - First stable release, removed Windows ARM32
138+
- v1.0.1 (2025-11-16) - Disabled library commits, use GitHub Releases
139+
- v2.0.0 (future) - Will remove lib/ directory entirely

0 commit comments

Comments
 (0)