Skip to content

Commit 07daf6f

Browse files
Merge branch 'main' into copilot/fix-2877
2 parents b6cf068 + cc69c35 commit 07daf6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1272
-335
lines changed

.github/copilot-instructions.md

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,21 @@
33
Emscripten-forge is a conda package repository for building packages targeting the `emscripten-wasm32` platform (WebAssembly). The repository contains package recipes and uses `pixi` for environment management and `rattler-build` for package building.
44

55

6-
### Repository Structure
7-
```
8-
recipes/
9-
├── recipes/
10-
├── recipes_emscripten/ # this is where the recipes need to go
11-
...
12-
```
13-
14-
### Key Directories and Files
15-
- `recipes/recipes_emscripten/` - All WebAssembly package recipes (283+ packages)
16-
6+
## Add New Recipes
177

18-
### Package Types and Examples
19-
The repository supports multiple package types:
8+
To add new recipes follow the following steps:
209

21-
**Python packages**: zarr, numpy, scipy, matplotlib, pandas, etc.
22-
- Use `cross-python_${{ target_platform }}` build requirement
23-
- Example: `recipes/recipes_emscripten/zarr/`
10+
* check if the recipe needs building or is a noarch recipes. We **do not add noarch recipes**
11+
* check if the recipe is already present in the repository. If it is, update the existing recipe as needed.
12+
* if not, create a new directory for the recipe under `recipes/recipes_emscripten/`
13+
* add a `recipe.yaml` and file with the necessary metadata and build instructions
14+
* add a `build.sh` script to handle the build process if its more than a one-liner
15+
* include any additional files (e.g., patches, scripts) as needed
16+
* test the recipe using the appropriate testing framework
2417

25-
**C/C++ packages**: boost-cpp, arrow-cpp, opencv, etc.
26-
- Use `emcmake` instead of `cmake`, `emmake` instead of `make`
27-
- Example: `recipes/recipes_emscripten/boost-cpp/`
2818

29-
**Rust packages**: cryptography, pydantic-core, etc.
30-
- Use `maturin` for PyO3 packages
31-
- Pin `cffi == 1.15.1` during transition period
3219

33-
### Testing
20+
### Recipe test section
3421
For python packages, tests are defined in recipe.yaml files:
3522
```yaml
3623
tests:
@@ -40,4 +27,39 @@ tests:
4027
- test_import_[package].py
4128
```
4229
43-
For python packages, most tests are simple import tests. Tests run automatically during package builds.
30+
For python packages, most tests are simple import tests. These tests run automatically during package builds.
31+
32+
For non-python packages, its enough to check if the expected files exist.
33+
For a header only library this might look like:
34+
35+
```yaml
36+
tests:
37+
- script:
38+
- if: unix or emscripten
39+
then:
40+
- test -d ${PREFIX}/include/xtensor
41+
- test -f ${PREFIX}/include/xtensor/xarray.hpp
42+
- test -f ${PREFIX}/share/cmake/xtensor/xtensorConfig.cmake
43+
- test -f ${PREFIX}/share/cmake/xtensor/xtensorConfigVersion.cmake
44+
```
45+
46+
## Check if the recipe is working
47+
48+
to build the recipe you worked on with rattler-build with:
49+
(where YOUR_RECIPE_NAME is the name of the directory you created):
50+
51+
52+
rattler-build build \
53+
--package-format tar-bz2 \
54+
-c https://repo.prefix.dev/emscripten-forge-dev \
55+
-c microsoft \
56+
-c conda-forge \
57+
--target-platform emscripten-wasm32 \
58+
--skip-existing none \
59+
-m variant.yaml \
60+
--recipe recipes/recipes_emscripten/YOUR_RECIPE_NAME
61+
62+
63+
* this will build the recipe and run tests
64+
* check the output for any errors or warnings and try to resolve them
65+
* if you fail to run these commands report so
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
contents: read
24+
25+
# You can define any steps you want, and they will run before the agent starts.
26+
# If you do not check out your code, Copilot will do this for you.
27+
steps:
28+
29+
- name: Checkout repo
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- uses: prefix-dev/setup-pixi@v0.9.0

0 commit comments

Comments
 (0)