conda-build icon indicating copy to clipboard operation
conda-build copied to clipboard

Need option to output list of files at end of CLI build

Open selten opened this issue 7 years ago • 10 comments

Actual Behavior

Using conda-build with the option --output doesn't seem to actually build the package. It will go through some steps but stops at actually creating the complete package. The filename that is returned does not exist.

Expected Behavior

With --output the package should still be built.

Steps to Reproduce

Run conda-build with the --output option.

Output of conda info

selten avatar Feb 22 '18 07:02 selten

From the help:

--output              Output the conda package filename which would have
                        been created

This command is functioning exactly as intended. It only outputs the package name that would have been created, if you hadn't used --output. What were you hoping this flag would do?

msarahan avatar Feb 22 '18 14:02 msarahan

I misunderstood the help then, my bad.

I would have liked if it would build the package and then output the name. This could then be used for automated building of conda packages and deploying these to private conda channels.

selten avatar Feb 22 '18 14:02 selten

If you use the python api, the return of the conda_build.api.build command is a list of paths to packages built. Really, though, you should be using the --user or --token flags to pass your anaconda.org user or token for for the private channel, so you can avoid keeping track of packages at all. If you specify --user or --token, automatic upload gets turned on.

msarahan avatar Feb 22 '18 14:02 msarahan

I don't want to upload to the normal repository. I want to upload to a custom internal channel. I do not want to upload to anaconda.org.

selten avatar Feb 22 '18 14:02 selten

I see, yes, we don't support that right now. In that case, your best option is to call conda-build twice: once to do the build, and again to get the output filenames. Alternatively, you could specify the --output_folder flag, which will be where your artifacts will go, and then gather your outputs as the contents of the artifacts folder.

For example, something like this might work:

conda build --output_folder some_existing_folder your_recipe
pushd some_existing_folder/linux-64
anaconda upload $(ls *.tar.bz2)
popd

Otherwise, people have long used patterns like this:

conda build your_recipe
anaconda upload $(conda build --output your_recipe)

This is less desirable because it takes longer, and is more prone to bugs in conda-build. We haven't seen those bugs in a while, but they were a concern historically.

msarahan avatar Feb 22 '18 15:02 msarahan

I have a way of using it at this moment, use --output-folder and then have a for loop in bash upload the created conda package. It would have just been slightly easier with the actual filename

selten avatar Feb 22 '18 15:02 selten

Yeah, sorry about that. I think the best way to achieve that might be to add some extra meaning to the --quiet flag, so that it hides the rest of the output from the build, but ultimately outputs just the list of files produced. I can't take that on right now, but I can add it to our backlog if you'd like.

msarahan avatar Feb 22 '18 15:02 msarahan

I think adding it to the backlog might be a good idea.

selten avatar Feb 22 '18 15:02 selten

I changed the title to reflect the request, and I'll hope to get to it soon.

msarahan avatar Feb 22 '18 15:02 msarahan

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[bot] avatar Sep 29 '22 04:09 github-actions[bot]