Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rattler-build does not copy directories unless the file path ends in / #1434

Open
AaronOpfer opened this issue Feb 18, 2025 · 2 comments
Open

Comments

@AaronOpfer
Copy link

AaronOpfer commented Feb 18, 2025

Found this discrepency between how rattler-build and conda build handle file paths specified as test-time source dependencies.

recipe.yaml

package:
  name: bug_reproduction
  version: 0

source:
  path: .

build:
  script:
    - echo hi

tests:
  - files:
      source:
        - subdirectory
    script:
      - test -f subdirectory/file

source tree

$ find -type f
./subdirectory/file
./recipe.yaml

rattler-build build --recipe recipe.yaml --output-dir /some/other/place

... snip ...
 │ Installing test environment
 │ ✔ Successfully updated the test environment
 │ Testing commands:
 │ + test -f subdirectory/file
 │ × error Script failed with status 1
 │ × error Work directory: '/tmp/.tmpPel2kW'
 │ × error To debug the build, run it manually in the work directory (execute the `./conda_build.sh` or `conda_build.bat` script)
 │
 ╰─────────────────── (took 1 second)

Expected Result

subdirectory's content to be copied into the test work directory and the build passes.

Actual Result

Build fails.

Workaround is possible: append a / to the path in the recipe.yaml i.e

tests:
  - files:
      source:
        - subdirectory/

tested on rattler-build 0.35.9

@wolfv
Copy link
Member

wolfv commented Feb 18, 2025

Yeah, I think we already have a report about it. Should get fixed.

@mgorny
Copy link
Contributor

mgorny commented Feb 22, 2025

I guess this is #1055 with a WIP fix in #1067.

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

No branches or pull requests

3 participants