rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

feat: auto detect license files from prefix directory as well

Open wolfv opened this issue 8 months ago • 3 comments

This adds auto-detection from the $PREFIX as well.

@mfansler do you think this is acceptable? It would fix the Rust case. I would have to think a bit longer to find a good solution for ${{ PREFIX }}/foobar case because the way we render the recipe, these variables are not available.

wolfv avatar May 11 '25 17:05 wolfv

@wolfv thanks for the heads up. Yes, this would suffice. 👍

So, our translation will be, for example:

v0

about:
  # other stuff
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT
    - LICENSE

v1

about:
  # other stuff
  license_file:
    - lib/R/share/licenses/MIT
    - LICENSE

I.e., simply remove {{ environ["PREFIX"] }}/ from any about.license_file entries.

mfansler avatar May 12 '25 07:05 mfansler

Yes, with this PR that would be the case, indeed.

wolfv avatar May 12 '25 07:05 wolfv

I've had some extra thoughts on this. I think it might be better to compute the directories first (without creating them) so that we can already resolve ${{ PREFIX }}, ${{ SRC_DIR }}and${{ RECIPE_DIR }}` when rendering, so that users can be really explicit about where the license is supposed to come from.

For this I would also modify the folder that we create (currently it looks like package-name_1234513425134) where the number is the timestamp. The number is not easy to understand anyways (hard to know which is the latest build), so if we have e.g. a running index it might be better regardless.

wolfv avatar May 13 '25 11:05 wolfv