Skip to content

mkdir: cannot create directory ‘/opt/host-conda-bld/linux-aarch64’: Permission denied #1047

@ljw20180420

Description

@ljw20180420

My recipe is

{% set name = "rearr" %}
{% set version = "1.0.0" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://github.com/ljw20180420/sx_lcy/archive/refs/tags/conda_pkg.tar.gz
  sha256: 6f3d15d029dc05bb02ce8f2a21eec4054c7abc86bcfb59520b649ab04647cfef

build:
  run_exports:
    - {{ pin_subpackage(name, max_pin="x") }}
  script:
    # install rearrangement
    - mkdir -p core/Rearrangement/build
    - cd core/Rearrangement/build
    - cmake -DCMAKE_BUILD_TYPE=Release ..
    - make
    - mkdir -p $PREFIX/bin
    - cp ./rearrangement $PREFIX/bin/
    - cd $SRC_DIR
    - mkdir -p $PREFIX/share/awk/
    - cp core/Rearrangement/correct_micro_homology.awk $PREFIX/share/awk/
    # install removeDup
    - cp core/removeDuplicates.md $PREFIX/bin/
    # install demultiplex
    - cp core/demultiplex/demultiplex.md $PREFIX/bin/
    - cp core/demultiplex/getAlignPos.awk $PREFIX/share/awk/
    # install getSxCsvFileRef
    - cp sx/getSxCsvFileRef/getSxCsvFileRef.md $PREFIX/bin/
    - cp sx/getSxCsvFileRef/getSxCsvFileTarget.pl $PREFIX/bin/
    - cp sx/getSxCsvFileRef/getSxRefFile.pl $PREFIX/bin/
    - cp sx/getSxCsvFileRef/sxTargetSam2Bed.awk $PREFIX/share/awk/
    # install cutR2Adapter
    - cp sx/sxCutR2AdapterFilterCumulate/sxCutR2AdapterFilterCumulate.md $PREFIX/bin/
    - cp sx/sxCutR2AdapterFilterCumulate/sxCumulateToMapCutAdaptSpliter.awk $PREFIX/share/awk/
    # install sxInderSpliter
    - cp sx/sxExtractSpliter.md $PREFIX/bin/
    # install workflow
    - mkdir -p $PREFIX/share/rearr
    - cp workFlow.mak $PREFIX/share/rearr/
    - cp runWorkFlow.md $PREFIX/bin/
  number: 0
  skip: True # [not linux]

requirements:
  build:
    - make
    - cmake
    - {{ compiler('cxx') }}
  run:
    - make
    - gawk
    - perl
    - samtools
    - bedtools
    - bowtie2
    - python
    - cutadapt
    - numpy

test:
  commands:
    - python -m unittest test.test_suite_no_genome
  source_files:
    - test

about:
  home: https://github.com/ljw20180420/sx_lcy
  summary: 'Chimeric alignment of CRISPR-seq'
  description: |
    rearr is a package to demultiplex and align CRISPR-seq data.
  license: MIT
  license_family: MIT
  license_file: LICENSE.md
  doc_url: https://ljw20180420.github.io/sx_lcy
  dev_url: https://github.com/ljw20180420/sx_lcy

extra:
  recipe-maintainers:
    - ljw

I build the conda package in docker.

bioconda-utils build --docker --mulled-test --packages rearr

The output is

10:33:14 BIOCONDA INFO Considering total of 1 recipes (rearr).
10:33:14 BIOCONDA INFO Processing 1 recipes (rearr).
10:33:14 BIOCONDA INFO Using docker image quay.io/bioconda/bioconda-utils-build-env-cos7:3.7.2 for building.
10:33:14 BIOCONDA INFO Generating DAG
Loading Recipes: 100%|████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 76.22it/s]
10:33:14 BIOCONDA INFO 1 recipes to build and test: 
rearr
10:33:14 BIOCONDA INFO Determining expected packages for recipes/rearr
WARNING: Setting build platform. This is only useful when pretending to be on another platform, such as for rendering necessary dependencies on a non-native platform. I trust that you know what you're doing.
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
Adding in variants from /home/ljw/wuqiang/sx/bioconda-recipes/.conda/conda_build_config.yaml
Adding in variants from /home/ljw/wuqiang/sx/bioconda-recipes/.conda/lib/python3.10/site-packages/bioconda_utils/bioconda_utils-conda_build_config.yaml
conda-forge/osx-arm64: 120MB [00:15, 8.13MB/s]                                        | 0/10 [00:00<?, ?files/s]
conda-forge/linux-aarch64: 132MB [00:19, 7.14MB/s]                            | 1/10 [00:19<02:56, 19.57s/files]
bioconda/linux-aarch64: 2.90MB [00:00, 4.78MB/s]                              | 2/10 [00:24<01:25, 10.69s/files]
bioconda/osx: 24.5MB [00:03, 7.40MB/s]                                        | 3/10 [00:24<00:43,  6.18s/files]
conda-forge/linux: 322MB [00:30, 11.0MB/s]                                    | 4/10 [00:29<00:32,  5.45s/files]
conda-forge/osx: 266MB [00:43, 6.48MB/s]████████                              | 5/10 [00:43<00:42,  8.52s/files]
bioconda/osx-arm64: 1.11MB [00:11, 103kB/s]███████████                        | 6/10 [00:54<00:38,  9.52s/files]
bioconda/linux: 31.2MB [00:25, 1.29MB/s]/s]]
bioconda/noarch: 31.4MB [00:01, 30.8MB/s]█████████████████████████            | 8/10 [00:55<00:10,  5.04s/files]
conda-forge/noarch: 126MB [00:37, 3.52MB/s]█████████████████████████████      | 9/10 [00:57<00:04,  4.22s/files]
Downloading: 100%|███████████████████████████████████████████████████████████| 10/10 [01:02<00:00,  6.25s/files]
Adding in variants from argument_variants
Attempting to finalize metadata for rearrs] 
Reloading output folder: ...working... done
Getting pinned dependencies: ...working... done
Reloading output folder: ...working... done
Getting pinned dependencies: ...working... done
10:36:36 BIOCONDA INFO BUILD START recipes/rearr
10:36:37 BIOCONDA INFO Starting build for recipes/rearr Free disk space: 349828.51 MB. Free memory: 49167.61 MB (76.67%)
10:36:37 BIOCONDA INFO (COMMAND) docker system df
10:36:37 BIOCONDA INFO (OUT) TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
10:36:37 BIOCONDA INFO (OUT) Images          48        0         43.95GB   43.95GB (100%)
10:36:37 BIOCONDA INFO (OUT) Containers      0         0         0B        0B
10:36:37 BIOCONDA INFO (OUT) Local Volumes   557       0         139GB     139GB (100%)
10:36:37 BIOCONDA INFO (OUT) Build Cache     1215      0         125.2GB   125.2GB
10:36:37 BIOCONDA INFO (COMMAND) docker ps -a
10:36:37 BIOCONDA INFO (OUT) CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
10:36:37 BIOCONDA INFO (COMMAND) docker run -t --net host --rm -v /tmp/tmpn3x46m2e/build_script.bash:/opt/build_script.bash -v /home/ljw/wuqiang/sx/bioconda-recipes/.conda/conda-bld:/opt/host-conda-bld -v /home/ljw/wuqiang/sx/bioconda-recipes/recipes/rearr:/opt/recipe -e LC_ADDRESS=en_US.UTF-8 -e LC_NAME=en_US.UTF-8 -e LC_MONETARY=en_US.UTF-8 -e LC_PAPER=en_US.UTF-8 -e LANG=en_US.UTF-8 -e LC_IDENTIFICATION=en_US.UTF-8 -e LC_TELEPHONE=en_US.UTF-8 -e LC_MEASUREMENT=en_US.UTF-8 -e LC_TIME=en_US.UTF-8 -e LC_NUMERIC=en_US.UTF-8 -e HOST_USER_ID=1000 quay.io/bioconda/bioconda-utils-build-env-cos7:3.7.2 /bin/bash /opt/build_script.bash
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 Subdir: linux-64 Gathering repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-64 Writing pre-patch repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-64 Applying patch instructions
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-64 Writing patched repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-64 Building current_repodata subset
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-64 Writing current_repodata subset
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-64 Writing index HTML
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 Subdir: linux-aarch64 Gathering repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-aarch64 Writing pre-patch repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-aarch64 Applying patch instructions
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-aarch64 Writing patched repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-aarch64 Building current_repodata subset
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-aarch64 Writing current_repodata subset
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 linux-aarch64 Writing index HTML
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 Subdir: noarch Gathering repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 noarch Writing pre-patch repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 noarch Applying patch instructions
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 noarch Writing patched repodata
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 noarch Building current_repodata subset
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 noarch Writing current_repodata subset
10:36:41 BIOCONDA INFO (OUT) 2025-05-28T02:36:41 noarch Writing index HTML
10:36:42 BIOCONDA INFO (OUT) mkdir: cannot create directory ‘/opt/host-conda-bld/linux-aarch64’: Permission denied
10:36:42 BIOCONDA ERROR COMMAND FAILED (exited with 1): docker run -t --net host --rm -v /tmp/tmpn3x46m2e/build_script.bash:/opt/build_script.bash -v /home/ljw/wuqiang/sx/bioconda-recipes/.conda/conda-bld:/opt/host-conda-bld -v /home/ljw/wuqiang/sx/bioconda-recipes/recipes/rearr:/opt/recipe -e LC_ADDRESS=en_US.UTF-8 -e LC_NAME=en_US.UTF-8 -e LC_MONETARY=en_US.UTF-8 -e LC_PAPER=en_US.UTF-8 -e LANG=en_US.UTF-8 -e LC_IDENTIFICATION=en_US.UTF-8 -e LC_TELEPHONE=en_US.UTF-8 -e LC_MEASUREMENT=en_US.UTF-8 -e LC_TIME=en_US.UTF-8 -e LC_NUMERIC=en_US.UTF-8 -e HOST_USER_ID=1000 quay.io/bioconda/bioconda-utils-build-env-cos7:3.7.2 /bin/bash /opt/build_script.bash

10:36:42 BIOCONDA ERROR BUILD FAILED recipes/rearr
10:36:42 BIOCONDA INFO Finished build for recipes/rearr Free disk space: 349828.51 MB. Free memory: 49191.39 MB (76.70%)
10:36:42 BIOCONDA INFO (COMMAND) docker system df
10:36:43 BIOCONDA INFO (OUT) TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
10:36:43 BIOCONDA INFO (OUT) Images          48        0         43.95GB   43.95GB (100%)
10:36:43 BIOCONDA INFO (OUT) Containers      0         0         0B        0B
10:36:43 BIOCONDA INFO (OUT) Local Volumes   557       0         139GB     139GB (100%)
10:36:43 BIOCONDA INFO (OUT) Build Cache     1215      0         125.2GB   125.2GB
10:36:43 BIOCONDA INFO (COMMAND) docker ps -a
10:36:43 BIOCONDA INFO (OUT) CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
10:36:43 BIOCONDA INFO (COMMAND) conda build purge
10:36:43 BIOCONDA INFO (COMMAND) docker container prune -f
10:36:43 BIOCONDA ERROR BUILD SUMMARY: of 1 recipes, 1 failed and 0 were skipped. Details of recipes and environments follow.
10:36:43 BIOCONDA ERROR BUILD SUMMARY: FAILED recipe recipes/rearr

The content of build_script.bash

#!/bin/bash
set -eo pipefail

# Add the host's mounted conda-bld dir so that we can use its contents as
# dependencies for building this recipe.
#
# Note that if the directory didn't exist on the host, then the staging area
# will exist in the container but will be empty.  Channels expect at least
# a linux-64/linux-aarch64 and noarch directory within that directory, so we
# make sure it exists before adding the channel.
# Also ensure conda-build's local channel directory exists the same way.
for local_channel in '/opt/conda/conda-bld' '/opt/host-conda-bld'; do
  mkdir -p "${local_channel}"/linux-64
  mkdir -p "${local_channel}"/linux-aarch64
  mkdir -p "${local_channel}"/noarch
  conda index "${local_channel}"
done
conda config --add channels file:///opt/host-conda-bld 2> >(
    grep -vF "Warning: 'file:///opt/host-conda-bld' already in 'channels' list, moving to the top" >&2
)

# Pass on conda_pkg_format ("2" for .conda instead of .tar.bz2) from host's conda-build config.
test -n '' && conda config --set conda_build.pkg_format ''

# The actual building...
# we explicitly point to the meta.yaml, in order to keep
# conda-build from building all subdirectories
conda-build -c file:///opt/host-conda-bld --override-channels --no-anaconda-upload -c conda-forge -c bioconda -e /opt/host-conda-bld/conda_build_config_0_-e_conda_build_config.yaml -e /opt/host-conda-bld/conda_build_config_1_-e_bioconda_utils-conda_build_config.yaml /opt/recipe/meta.yaml 2>&1

# copy all built packages to the staging area
find /opt/conda/conda-bld \
  -name src_cache -prune -o \
  -type f \( -name '*.tar.bz2' -o -name '*.conda' \) -print0 |
  xargs -0 -- cp -t '/opt/host-conda-bld/linux-64' --
#While technically better, this is slower and more prone to breaking
#cp `conda-build --override-channels --no-anaconda-upload -c conda-forge -c bioconda -e /opt/host-conda-bld/conda_build_config_0_-e_conda_build_config.yaml -e /opt/host-conda-bld/conda_build_config_1_-e_bioconda_utils-conda_build_config.yaml /opt/recipe/meta.yaml --output | grep -e '\.tar\.bz2$' -e '\.conda$')` /opt/host-conda-bld/linux-64
conda index /opt/host-conda-bld
# Ensure permissions are correct on the host.
HOST_USER=1000
chown $HOST_USER:$HOST_USER /opt/host-conda-bld/linux-64/*

The key error is

mkdir: cannot create directory ‘/opt/host-conda-bld/linux-aarch64’: Permission denied

According to the command

docker run -t --net host --rm -v /tmp/tmpn3x46m2e/build_build_script.bash -v /home/ljw/wuqiang/sx/bioconda-recipes/.conda/conda-bld:/opt/host-conda-bld -v /home/ljw/wuqiang/sx/bioconda-recipes/recipes/rearr:/opt/recipe -e LC_ADDRESS=en_US.UTF-8 -e LC_NAME=en_US.UTF-8 -e LC_MONETARY=en_US.UTF-8 -e LC_PAPER=en_US.UTF-8 -e LANG=en_US.UTF-8 -e LC_IDENTIFICATION=en_US.UTF-8 -e LC_TELEPHONE=en_US.UTF-8 -e LC_MEASUREMENT=en_US.UTF-8 -e LC_TIME=en_US.UTF-8 -e LC_NUMERIC=en_US.UTF-8 -e HOST_USER_ID=1000 quay.io/bioconda/bioconda-utils-build-env-cos7:3.7.2 /bin/bash /opt/build_script.bash

build_script.bash tries to create a directory linux-aarch64 in /opt/host-conda-bld/ in docker as user conda. /opt/host-conda-bld/ is bind to /home/ljw/wuqiang/sx/bioconda-recipes/.conda/conda-bld on my host, so docker user conda has not permission. My host is linux-64. Why build_script.bash also build linux-aarch64? build_script.bash also tries to create directories linux-64 and noarch in /opt/host-conda-bld/. That works because linux-64 and noarch have been created by bioconda-utils build automatically on my host before the execution of build_script.bash in docker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions