Skip to content

rattler-build: frequent rebuilds #401

@burdiyan

Description

@burdiyan

I'm using pixi 0.55.0 with these in the pixi.toml file:

[workspace]
preview = ["pixi-build"]

# ...
# ...

[package.build.backend]
name = "pixi-build-rattler-build"
version = "*"

[dependencies]
please = { path = "./build/pixi-packages/please" }
# ...

In ./build/pixi-packages/please I have a source dependency — a rattler-build recipe, which is a repackaging of a particular tool I need, roughly following the Repackaging example in rattler-build docs.

I then add this package as a dependency in my workspace pixi.toml file.

The problem I'm having is that a simple touch of the recipe file would trigger a rebuild during my next interaction with pixi. So sometimes when I switch branches, or somehow the recipe file gets touched, whenever I do something in pixi the entire recipe gets rebuilt, which in this case takes a while.

Reproduction Steps

Create the following files in an empty directory:

  • pixi.toml
[workspace]
name = "repro"
channels = ["https://prefix.dev/conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
version = "0.0.0"
requires-pixi = ">=0.55.0"
preview = ["pixi-build"]

[package.build.backend]
name = "pixi-build-rattler-build"
version = "*"

[dependencies]
please = { path = "./pixi-packages/please" }
  • ./pixi-packages/please/recipe.yaml
context:
  version: "16.17.1"

package:
  name: please
  version: ${{ version }}

source:
  git: "https://github.com/thought-machine/please"
  tag: "v${{ version }}"

requirements:
  build:
    - ${{ compiler('go-cgo') }}
    - ${{ compiler('c') }}

tests:
  - script:
      - plz --version

build:
  script:
    - mkdir -p $PREFIX/bin
    - CGO_ENABLED=1 go build -o $PREFIX/bin/plz ./src/

about:
  homepage: https://please.build
  repository: https://github.com/thought-machine/please
  documentation: https://please.build
  summary: The Please build system
  description: |
    High-performance extensible build system for reproducible multi-language builds.
  license: Apache-2.0
  license_file:
    - LICENSE
  • pixi install and see the package being built.
  • pixi run which plz to see the plz binary being available in the environment.
  • pixi install again, and see that everything is cached.
  • touch ./pixi-packages/please/recipe.yaml.
  • pixi install again, and see the package being rebuilt. At this step it also fetches the repodata, and it's taking a long time, despite the first repodata fetch being pretty fast, assuming due to using the https://prefix.dev/conda-forge channel with optimizations. But looks like on the second install it's not using it.

Expectations

  1. No rebuilds when nothing relevant about the package has changed.
  2. No unnecessary repodata fetches if rebuilds need to happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions