Skip to content

Commit 49d134a

Browse files
committed
make build number arithmetic explicit
don't rely on PKG_BUILDNUM resolving this correctly, which is either racy, or implicitly depends on a separate render pass after setting build.number
1 parent fa31c3f commit 49d134a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

recipe/meta.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ build:
6666
{% else %}
6767
skip: true # [is_rc]
6868
{% endif %}
69-
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
70-
string: cpu_{{ blas_impl }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
69+
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [cuda_compiler_version != "None"]
70+
string: cpu_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [cuda_compiler_version == "None"]
7171
detect_binary_files_with_prefix: false
7272
run_exports:
7373
- {{ pin_subpackage('libtorch', max_pin='x.x') }}
@@ -168,8 +168,8 @@ requirements:
168168
- pytorch-gpu ==99999999 # [cuda_compiler_version == "None"]
169169
- pytorch-gpu =={{ version }} # [cuda_compiler_version != "None"]
170170
- pytorch-cpu ==99999999 # [cuda_compiler_version != "None"]
171-
- pytorch {{ version }} cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_*_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
172-
- pytorch {{ version }} cpu_{{ blas_impl }}_*_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
171+
- pytorch {{ version }} cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_*_{{ build }} # [cuda_compiler_version != "None"]
172+
- pytorch {{ version }} cpu_{{ blas_impl }}_*_{{ build }} # [cuda_compiler_version == "None"]
173173
# if using OpenBLAS, ensure that a version compatible with OpenMP is used
174174
# otherwise, we get the following warnings:
175175
# OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
@@ -216,8 +216,8 @@ outputs:
216216
script: build.sh # [unix]
217217
script: bld.bat # [win]
218218
build:
219-
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version != "None"]
220-
string: cpu_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [cuda_compiler_version == "None"]
219+
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ build }} # [cuda_compiler_version != "None"]
220+
string: cpu_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ build }} # [cuda_compiler_version == "None"]
221221
detect_binary_files_with_prefix: false
222222
run_exports:
223223
- {{ pin_subpackage('pytorch', max_pin='x.x') }}
@@ -440,19 +440,19 @@ outputs:
440440
{% set pytorch_cpu_gpu = "pytorch-gpu" %} # [cuda_compiler_version != "None"]
441441
- name: {{ pytorch_cpu_gpu }}
442442
build:
443-
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [megabuild and cuda_compiler_version != "None"]
444-
string: cpu_{{ blas_impl }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [megabuild and cuda_compiler_version == "None"]
445-
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [not megabuild and cuda_compiler_version != "None"]
446-
string: cpu_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }} # [not megabuild and cuda_compiler_version == "None"]
443+
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [megabuild and cuda_compiler_version != "None"]
444+
string: cpu_{{ blas_impl }}_h{{ PKG_HASH }}_{{ build }} # [megabuild and cuda_compiler_version == "None"]
445+
string: cuda{{ cuda_compiler_version | replace('.', '') }}_{{ blas_impl }}py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ build }} # [not megabuild and cuda_compiler_version != "None"]
446+
string: cpu_{{ blas_impl }}_py{{ CONDA_PY }}_h{{ PKG_HASH }}_{{ build }} # [not megabuild and cuda_compiler_version == "None"]
447447
detect_binary_files_with_prefix: false
448448
# weigh down cpu implementation and give cuda preference
449449
track_features:
450450
- pytorch-cpu # [cuda_compiler_version == "None"]
451451
requirements:
452452
run:
453-
- pytorch {{ version }}=cuda*_{{ blas_impl }}*{{ PKG_BUILDNUM }} # [megabuild and cuda_compiler_version != "None"]
454-
- pytorch {{ version }}=cpu_{{ blas_impl }}*{{ PKG_BUILDNUM }} # [megabuild and cuda_compiler_version == "None"]
455-
- {{ pin_subpackage("pytorch", exact=True) }} # [not megabuild]
453+
- pytorch {{ version }}=cuda*_{{ blas_impl }}*{{ build }} # [megabuild and cuda_compiler_version != "None"]
454+
- pytorch {{ version }}=cpu_{{ blas_impl }}*{{ build }} # [megabuild and cuda_compiler_version == "None"]
455+
- {{ pin_subpackage("pytorch", exact=True) }} # [not megabuild]
456456
test:
457457
imports:
458458
- torch

0 commit comments

Comments
 (0)