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

Handling GIT_* environment variables with multiple outputs #3760

Open
jakirkham opened this issue Oct 8, 2019 · 2 comments
Open

Handling GIT_* environment variables with multiple outputs #3760

jakirkham opened this issue Oct 8, 2019 · 2 comments
Labels
stale::recovered [bot] recovered after being marked as stale

Comments

@jakirkham
Copy link
Member

Not sure whether this is a bug or a feature request. Currently a recipe that uses outputs (with one or more packages produced), can use GIT_* variables. However these appear to be unassigned. As a result if one tries to generate version information using them, one ends up with an empty version string.

Actual Behavior

An example of this behavior is in PR ( conda-forge/metawrap-feedstock#11 ). Though one can also just use the meta.yaml below to produce this as well.

# filename: recipe/meta.yaml

{% set name = "metawrap" %}

package:
  name: {{ name }}-split

outputs:
  - name: {{ name|lower }}
    version: "{{ environ.get('GIT_DESCRIBE_TAG', '')[1:] }}{{ '+' + environ.get('GIT_DESCRIBE_NUMBER', '0') + '.' + environ.get('GIT_DESCRIBE_HASH', '0') if environ.get('GIT_DESCRIBE_NUMBER', '0') != '0' else '' }}"
    source:
      git_url: https://github.com/jakirkham/metawrap
      git_rev: HEAD
    build:
      noarch: python
      number: 1
      script: python -m pip install --no-deps --ignore-installed .
    requirements:
      host:
        - pip
        - python
        - setuptools
      run:
        - python
      test:
        source_files:
          - tests
        imports:
          - metawrap
        commands:
          - python -m unittest discover -s .
        about:
          home: http://github.com/jakirkham/metawrap
          license: BSD 3-Clause
          license_family: BSD
          license_file: LICENSE.txt
          summary: A collection of wrappers for functions and classes.
          doc_url: https://metawrap.readthedocs.io/
          dev_url: http://github.com/jakirkham/metawrap

extra:
  recipe-maintainers:
    - jakirkham

Expected Behavior

Honestly it is hard to say. One might hope that these GIT_* variables are set with a specific source in mind, but how to instruct that case is a little unclear. This may rely on new features. Alternatively the GIT_* variables could be disambiguated somehow based on which source they relate to. Again it is unclear exactly how this should be done. Perhaps there are other options here?

Steps to Reproduce

Run conda build recipe using the recipe provided above.

Output of conda info
     active environment : base
    active env location : /opt/conda
            shell level : 1
       user config file : /home/conda/.condarc
 populated config files : /home/conda/.condarc
          conda version : 4.7.12
    conda-build version : 3.18.9
         python version : 3.7.3.final.0
       virtual packages : 
       base environment : /opt/conda  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /home/conda/.conda/pkgs
       envs directories : /opt/conda/envs
                          /home/conda/.conda/envs
               platform : linux-64
             user-agent : conda/4.7.12 requests/2.22.0 CPython/3.7.3 Linux/4.15.0-1059-azure centos/6.10 glibc/2.12
                UID:GID : 1001:1001
             netrc file : None
           offline mode : False
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Mar 7, 2023
@jakirkham
Copy link
Member Author

This is still an issue. Also seems to extend to other environment variables ( #3993 )

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale::recovered [bot] recovered after being marked as stale
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant