conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
147 stars 177 forks source link

add lint for run_exports outside of a build section #1857

Open beckermr opened 5 months ago

beckermr commented 5 months ago

In some cases, run_exports outside of build sections are ignored in multioutput recipes. This syntax

outputs:
  - name: blah
    run_exports:
     - blah

is the main issue.

See this PR https://github.com/conda-forge/ctng-compiler-activation-feedstock/pull/103.

We should lint for this syntax and make sure recipes do not use it.

carterbox commented 5 months ago

The correct placement would be

outputs:
  - name: blah
    build:
      run_exports:
       - blah
isuruf commented 5 months ago

Both are fine, except when you have

outputs:
  - name: blah
    run_exports:
     - blah
     build:
       some_other_option: value
beckermr commented 5 months ago

Right. My proposal is to require only stuff under build in conda-forge to make things simpler and less error prone. We could lint exactly for the bug if we want OFC.

h-vetinari commented 5 months ago

Both are fine, except when you have [...]

What's the benefit of allowing the build:-less way, except saving some characters? I don't think that's worth the footgun that comes along with it.

I mean, if we can lint the specific case that breaks, all the better, but I'd be equally happy to just require a build: section.

isuruf commented 5 months ago

What's the benefit of allowing the build:-less way, except saving some characters? I don't think that's worth the footgun that comes along with it.

You'll shoot yourself in the foot if you only move run_exports to build and the other values are not moved to the build section.