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

meta.yaml accepts negative build numbers #5332

Open
2 tasks done
jaimergp opened this issue May 9, 2024 · 1 comment
Open
2 tasks done

meta.yaml accepts negative build numbers #5332

jaimergp opened this issue May 9, 2024 · 1 comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@jaimergp
Copy link
Contributor

jaimergp commented May 9, 2024

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

build:
  number: -1

is accepted and fails later down the pipeline due to filename parsing errors, after running the build scripts.

BUILD START: ['conda-build-test-source-url-1.0--1.tar.bz2']
Channels:
 - local
 - conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Channels:
 - local
 - conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715238643455/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl


The following NEW packages will be INSTALLED:

    bzip2:           1.0.8-h93a5062_5          conda-forge
    ca-certificates: 2024.2.2-hf0a4a13_0       conda-forge
    libffi:          3.4.2-h3422bc3_5          conda-forge
    libsqlite:       3.45.3-h091b4b1_0         conda-forge
    libzlib:         1.2.13-h53f4e23_5         conda-forge
    ncurses:         6.5-hb89a1cb_0            conda-forge
    openssl:         3.3.0-h0d3ecfb_0          conda-forge
    python:          3.9.19-hd7ebdb9_0_cpython conda-forge
    readline:        8.2-h92ec313_1            conda-forge
    tk:              8.6.13-h5083fa2_1         conda-forge
    tzdata:          2024a-h0c530f3_0          conda-forge
    xz:              5.2.6-h57fd34a_0          conda-forge

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Source cache directory is: /Users/jrodriguez/.local/anaconda/conda-bld/src_cache
Downloading source to cache: conda-build-1.8.1_0bf1f3598a.tar.gz
Downloading https://github.com/conda/conda-build/archive/1.8.1.tar.gz
Success
Extracting download
source tree in: /Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715238643455/work
export PREFIX=/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715238643455/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl
export SRC_DIR=/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715238643455/work

Resource usage statistics from building conda-build-test-source-url:
   Process count: 4
   CPU time: Sys=0:00:00.0, User=0:00:00.1
   Memory: 29.2M
   Disk usage: 1.0K
   Time elapsed: 0:00:04.3


Packaging conda-build-test-source-url
Packaging conda-build-test-source-url-1.0--1
WARNING: No files or script found for output conda-build-test-source-url
number of files: 0
Fixing permissions
INFO :: Time taken to mark (prefix)
        0 replacements in 0 files was 0.00 seconds

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda/cli/main.py", line 83, in main_subshell
        exit_code = do_call(args, parser)
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 172, in do_call
        result = plugin_subcommand.action(getattr(args, "_args", args))
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/plugin.py", line 14, in build
        return execute(args)
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/cli/main_build.py", line 581, in execute
        api.build(
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/api.py", line 255, in build
        return build_tree(
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/build.py", line 3782, in build_tree
        packages_from_this = build(
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/build.py", line 2859, in build
        newly_built_packages = bundlers[pkg_type](output_d, m, env, stats)
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/build.py", line 2044, in bundle_conda
        tarcheck.check_all(tmp_path, metadata.config)
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/tarcheck.py", line 99, in check_all
        x.index_json()
      File "/Users/jrodriguez/.local/anaconda/lib/python3.9/site-packages/conda_build/tarcheck.py", line 63, in index_json
        raise Exception(
    Exception: name: 'conda-build-test-source-url' != 'conda-build-test-source-url-1.0'

Conda Info

conda info

     active environment : base
    active env location : /Users/jrodriguez/.local/anaconda
            shell level : 1
       user config file : /Users/jrodriguez/.condarc
 populated config files : /Users/jrodriguez/.local/anaconda/.condarc
                          /Users/jrodriguez/.condarc
          conda version : 24.1.1
    conda-build version : 24.1.2
         python version : 3.9.9.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.1.1=0
                          __osx=14.3.1=0
                          __unix=0=0
       base environment : /Users/jrodriguez/.local/anaconda  (writable)
      conda av data dir : /Users/jrodriguez/.local/anaconda/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/jrodriguez/.local/anaconda/pkgs
                          /Users/jrodriguez/.conda/pkgs
       envs directories : /Users/jrodriguez/.local/anaconda/envs
                          /Users/jrodriguez/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.1.1 requests/2.31.0 CPython/3.9.9 Darwin/23.3.0 OSX/14.3.1 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.6
                UID:GID : 501:20
             netrc file : None
           offline mode : False

Conda Config

==> /Users/jrodriguez/.local/anaconda/.condarc <==
channels:
  - conda-forge

==> /Users/jrodriguez/.condarc <==
add_pip_as_python_dependency: False
auto_update_conda: False
local_repodata_ttl: 0
channel_priority: strict
channels:
  - conda-forge
show_channel_urls: True
report_errors: False
experimental:
  - jlap

Conda list

N/A

Additional Context

No response

@jaimergp jaimergp added the type::bug describes erroneous operation, use severity::* to classify the type label May 9, 2024
@jaimergp
Copy link
Contributor Author

jaimergp commented May 9, 2024

Note that if you patch string then it does build:

build:
  number: -1
  string: h123456_1
WARNING: No numpy version specified in conda_build_config.yaml.  Falling back to default numpy value of 1.22
Adding in variants from internal_defaults
Attempting to finalize metadata for conda-build-test-source-url
Reloading output folder (local): ...working... done
Getting pinned dependencies: ...working... done
BUILD START: ['conda-build-test-source-url-1.0-h123456_1.tar.bz2']
Channels:
 - local
 - conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Channels:
 - local
 - conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl


The following NEW packages will be INSTALLED:

    bzip2:           1.0.8-h93a5062_5          conda-forge
    ca-certificates: 2024.2.2-hf0a4a13_0       conda-forge
    libffi:          3.4.2-h3422bc3_5          conda-forge
    libsqlite:       3.45.3-h091b4b1_0         conda-forge
    libzlib:         1.2.13-h53f4e23_5         conda-forge
    ncurses:         6.5-hb89a1cb_0            conda-forge
    openssl:         3.3.0-h0d3ecfb_0          conda-forge
    python:          3.9.19-hd7ebdb9_0_cpython conda-forge
    readline:        8.2-h92ec313_1            conda-forge
    tk:              8.6.13-h5083fa2_1         conda-forge
    tzdata:          2024a-h0c530f3_0          conda-forge
    xz:              5.2.6-h57fd34a_0          conda-forge

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Source cache directory is: /Users/jrodriguez/.local/anaconda/conda-bld/src_cache
Found source in cache: conda-build-1.8.1_0bf1f3598a.tar.gz
Extracting download
source tree in: /Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/work
export PREFIX=/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl
export SRC_DIR=/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/work

Resource usage statistics from building conda-build-test-source-url:
   Process count: 2
   CPU time: Sys=0:00:00.0, User=0:00:00.0
   Memory: 6.4M
   Disk usage: 1.0K
   Time elapsed: 0:00:02.0


Packaging conda-build-test-source-url
Packaging conda-build-test-source-url-1.0-h123456_1
WARNING: No files or script found for output conda-build-test-source-url
number of files: 0
Fixing permissions
INFO :: Time taken to mark (prefix)
        0 replacements in 0 files was 0.00 seconds
WARNING: Importing conda-verify failed.  Please be sure to test your packages.  conda install conda-verify to make this message go away.
TEST START: /Users/jrodriguez/.local/anaconda/conda-bld/osx-arm64/conda-build-test-source-url-1.0-h123456_1.tar.bz2
Adding in variants from /var/folders/1b/z374sygs1s96t_xxxv0hr3lr0000gn/T/tmp1z0uo694/info/recipe/conda_build_config.yaml
Nothing to test for: /Users/jrodriguez/.local/anaconda/conda-bld/osx-arm64/conda-build-test-source-url-1.0-h123456_1.tar.bz2
Renaming work directory '/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/work' to '/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/work_moved_conda-build-test-source-url-1.0-h123456_1_osx-arm64_main_build_loop'
shutil.move(work)=/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/work, dest=/Users/jrodriguez/.local/anaconda/conda-bld/conda-build-test-source-url_1715242275301/work_moved_conda-build-test-source-url-1.0-h123456_1_osx-arm64_main_build_loop)
# Automatic uploading is disabled
# If you want to upload package(s) to anaconda.org later, type:


# To have conda build upload to anaconda.org automatically, use
# conda config --set anaconda_upload yes
anaconda upload \
    /Users/jrodriguez/.local/anaconda/conda-bld/osx-arm64/conda-build-test-source-url-1.0-h123456_1.tar.bz2
anaconda_upload is not set.  Not uploading wheels: []

INFO :: The inputs making up the hashes for the built packages are as follows:
{
  "conda-build-test-source-url-1.0-h123456_1.tar.bz2": {
    "recipe": {}
  }
}


####################################################################################
Resource usage summary:

Total time: 0:00:48.8
CPU usage: sys=0:00:00.0, user=0:00:00.0
Maximum memory usage observed: 6.4M
Total disk usage observed (not including envs): 1.0K


####################################################################################
Source and build intermediates have been left in /Users/jrodriguez/.local/anaconda/conda-bld.
There are currently 9 accumulated.

If you look at the info metadata or the resulting repodata.json, you do see:

...
        "conda-build-test-source-url-1.0-h123456_1.tar.bz2": {
            "build": "h123456_1",
            "build_number": -1,
            "depends": [
                "python_abi 3.9.* *_cp39"
            ],
            "md5": "822e6e1724c4abbf8c83566dfbf4136e",
            "name": "conda-build-test-source-url",
            "sha256": "76d97bbde2bbfad7fb0babfa3064ae0d742b401d9bd2b96ac81220e0443e5c03",
            "size": 4535,
            "subdir": "osx-arm64",
            "timestamp": 1715242322366,
            "version": "1.0"
        },
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant