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

Package fails to install into build_env #53

Closed
mfansler opened this issue Nov 6, 2023 · 6 comments · Fixed by #56
Closed

Package fails to install into build_env #53

mfansler opened this issue Nov 6, 2023 · 6 comments · Fixed by #56
Labels
bug Something isn't working

Comments

@mfansler
Copy link
Member

mfansler commented Nov 6, 2023

The r-seurat package fails to create the build_env due to the post-link.sh script here crashing. This seems to only happen when this package is a build: dependency.

ERROR conda.core.link:_execute(740): An error occurred while installing package 'conda-forge::r-tinytex-0.48-r42hc72bb7e_1'.
Rolling back transaction: ...working... done
Traceback (most recent call last):
  File "/Users/runner/miniforge3/bin/conda-mambabuild", line 10, in <module>
    sys.exit(main())
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/boa/cli/mambabuild.py", line 256, in main
    call_conda_build(action, config)
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/boa/cli/mambabuild.py", line 228, in call_conda_build
    result = api.build(
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda_build/api.py", line 253, in build
    return build_tree(
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda_build/build.py", line 3799, in build_tree
    packages_from_this = build(
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda_build/build.py", line 2572, in build
    create_build_envs(top_level_pkg, notest)
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda_build/build.py", line 2412, in create_build_envs
    environ.create_env(
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda_build/environ.py", line 1058, in create_env
    execute_actions(actions, index)
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda/common/io.py", line 84, in decorated
    return f(*args, **kwds)
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda/plan.py", line 322, in execute_actions
    execute_instructions(plan, index, verbose)
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda/plan.py", line 532, in execute_instructions
    cmd(state, arg)
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda/instructions.py", line 73, in UNLINKLINKTRANSACTION_CMD
    unlink_link_transaction.execute()
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda/core/link.py", line 283, in execute
    self._execute(tuple(chain(*chain(*zip(*self.prefix_action_groups.values())))))
  File "/Users/runner/miniforge3/lib/python3.10/site-packages/conda/core/link.py", line 756, in _execute
    raise CondaMultiError(
conda.CondaMultiError: post-link script failed for package conda-forge::r-tinytex-0.48-r42hc72bb7e_1
location of failed script: /Users/runner/miniforge3/conda-bld/r-seurat_1699279724964/_build_env/bin/.r-tinytex-post-link.sh
==> script messages <==
<None>
==> script output <==
stdout: This package can only be used in conda-build

stderr: 
return code: 1

()

##[error]Bash exited with code '1'.

This needs to be made more robust.

@mfansler mfansler added the bug Something isn't working label Nov 6, 2023
@pdimens
Copy link

pdimens commented Jan 8, 2024

Inside of the official mamba docker image, Mamba is trying to install tinytex as a dep for something else and I'm getting these error messages consistently:

error    libmamba response code: -1 error message: Invalid argument
critical libmamba failed to execute pre/post link script for r-tinytex

I have tried two approaches to including perl in the dockerfile:

  1. Installing perl via apt-get
FROM mambaorg/micromamba

USER root

RUN apt-get update && apt-get install -y perl \
    && rm -rf /var/lib/apt/lists/*

USER $MAMBA_USER

RUN micromamba install --yes --name base -c bioconda -c conda-forge \
    falco \ 
    fastp \ 
    multiqc \ 
    r-base \ 
    r-dplyr \ 
    r-dt \ 
    r-flexdashboard \ 
    r-ggplot2 \ 
    r-knitr \ 
    r-magrittr \ 
    r-plotly \ 
    r-rmarkdown \ 
    r-tidyr \ 
    r-viridislite
  1. install via conda/mamba
FROM mambaorg/micromamba

RUN micromamba install --yes --name base -c bioconda -c conda-forge \
    falco \ 
    fastp \ 
    multiqc \ 
    r-base \ 
    r-dplyr \ 
    r-dt \ 
    r-flexdashboard \ 
    r-ggplot2 \ 
    r-knitr \ 
    r-magrittr \ 
    r-plotly \ 
    r-rmarkdown \ 
    r-tidyr \ 
    r-viridislite \
    perl

The results are identical (critical failure) and I cannot proceed with environment creation

@norbusan
Copy link

norbusan commented Jan 8, 2024

Can someone tell me where I can find the pre/post link script for r-tinytex then I can look into why it fails.

@mfansler
Copy link
Member Author

mfansler commented Jan 8, 2024

Found this: conda/conda-build#5115

The info/files manifest shows bin/.r-tinytex-post-link.sh. The build seems to include it. The contents are:

#!/bin/bash

echo " " >> $PREFIX/.messages.txt
echo "To install TinyTeX with \`tinytex::install_tinytex()\` the system must have a functional Perl" >> $PREFIX/.messages.txt
echo "installation with a \`File::Find\` module. Most end-user systems will already satisfy this" >> $PREFIX/.messages.txt
echo "requirement; however, some minimal contexts (e.g., containers) may not. Perl is available" >> $PREFIX/.messages.txt
echo "via Conda Forge as the package \`perl\`. See https://github.com/rstudio/tinytex/issues/419" >> $PREFIX/.messages.txt
echo " " >> $PREFIX/.messages.txt

Are there some contexts in which appending (>>) leads to an error when the file doesn't already exist?

@mfansler
Copy link
Member Author

mfansler commented Jan 8, 2024

At this point, this message seems more trouble than it's worth ☹️

@mfansler mfansler mentioned this issue Jan 9, 2024
1 task
@mfansler
Copy link
Member Author

mfansler commented Jan 9, 2024

@pdimens could you try running again now that the message component has been removed?

Hopefully we don't need to mark the previous build as broken to get working solves moving forward. 🤞

@pdimens
Copy link

pdimens commented Jan 9, 2024

@mfansler I can confirm I no longer see the error and the Docker build no longer breaks:

Transaction finished

To activate this environment, use:

    micromamba activate base

Or to execute a single command in this environment, use:

    micromamba run -n base mycommand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants