Skip to content

CEP 14: document additional fields in source items - #176

Open
wolfv wants to merge 9 commits into
conda:mainfrom
wolfv:amend-source-filters
Open

CEP 14: document additional fields in source items#176
wolfv wants to merge 9 commits into
conda:mainfrom
wolfv:amend-source-filters

Conversation

@wolfv

@wolfv wolfv commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Changes to the source items: prefix-dev/rattler-build#2608

Checklist for submitter

  • I am submitting a new CEP: Put your title here.
    • I am using the CEP template by creating a copy cep-0000.md named cep-XXXX.md in the root level.
  • I am submitting modifications to CEP XX.
    • The PR title reflects the CEP I'm modifying: CEP XX: Amend XYZ.
    • I updated the "Updated" date.
    • I added the link of this PR to the Discussions row.
    • I added or extended the ## Changelog section right above the final "Copyright" section with an item that uses syntax YYYY-MM-DD: Brief explanation of changes.
  • Something else: (add your description here).

Checklist for CEP approvals

  • The vote period has ended and the vote has passed the necessary quorum and approval thresholds.
  • A new CEP number has been minted. Usually, this is ${greatest-number-in-main} + 1.
  • The cep-XXXX.md file has been renamed accordingly.
  • The # CEP XXXX - header has been edited accordingly.
  • The CEP status in the table has been changed to approved.
  • The last modification date in the table has been updated accordingly.
  • The table in the README has been updated with the new CEP entry.
  • The pre-commit checks are passing.

@wolfv wolfv changed the title amend source filters CEP 14: amend source filters Jun 30, 2026
wolfv pushed a commit to prefix-dev/rattler-build that referenced this pull request Jun 30, 2026
Following CEP-0014 (conda/ceps#176), which specifies `filter` on `url`,
`path`, and `git` sources, extend filter support to git sources as well.
The filter is applied to the checked-out tree when copying it into the
work directory, mirroring the url/path behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RxSDwdYTY8h7T8VRHR5wmD
Comment thread cep-0014.md Outdated
Comment thread README.md Outdated
Comment thread cep-0014.md
Comment on lines +630 to +631
# variables that are resolved before collection: ${{ PREFIX }}, ${{ BUILD_PREFIX }},
# ${{ SRC_DIR }}, ${{ RECIPE_DIR }}, and ${{ BUILD_DIR }}.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these variables defined in the CEPs? (Are they?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a CEP for the Jinja / Env vars yet. I think I had something prepared but haven't really finished it. Might be good to start something though ...

Comment thread cep-0014.md
> This per-index folder layout has been superseded. The rendered tests are
> serialized to a single `info/tests/tests.yaml` file, and additional test
> element types (`package_contents`, `perl`, `r`, `ruby`) as well as the
> `python_version` field were added. See [CEP 48](./cep-0048.md).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't exist yet, does it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope it doesn't! Although I prepared something.

Comment thread cep-0014.md Outdated
Comment thread cep-0014.md Outdated
Comment thread cep-0014.md Outdated
Comment thread cep-0014.md Outdated
Comment thread cep-0014.md Outdated
Comment thread cep-0014.md

`build.post_process` applies regex-based text replacements to files in the
package during the packaging phase. Each entry MUST specify all three of
`files`, `regex`, and `replacement`. The following semantics apply:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What type of regex are allowed? Which part of the match is replaced? The whole thing or just the capture group?

@jaimergp jaimergp changed the title CEP 14: amend source filters CEP 14: document additional fields in source items Jul 2, 2026
wolfv and others added 7 commits July 2, 2026 15:09
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Co-authored-by: jaimergp <jaimergp@users.noreply.github.com>
Comment thread cep-0014.md
# pre-link: path
```

#### Post-processing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern about the addition of this feature to the standard is that it may cause scope creep of the purpose of conda package builders and that it may make processors of the recipe standard harder to fully implement.

Do these new keywords enable something that was not possible before? Or are they just moving a task that was previously possible as bash/batch as part of the build script into the implementation of the package builder?

Is this capability an essential function for shipping correct conda packages?

Is there an example where it is essential that a package builder can do arbitrary regex replacement?

Comment thread cep-0014.md
Comment on lines +349 to +350
# whether to recursively initialize and update git submodules
submodules: bool (defaults to true)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be a change in the default behavior of existing package builders (default true instead of false)? IIRC, currently when the source is a git repository submodules are not initialized by default?

Maybe I'm misremembering because on CF we have a policy that sources should be unpacked from archives, so submodules have to be listed as separate sources.

Comment thread cep-0014.md

SVN and HG (mercury) source definitions are removed as they are not relevant anymore.

### Source filters

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my other note about post-processing. I can see the utility of removing unused artifacts from a source, but this could also be accomplished as the first step of the build script?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants