CONDA-BUILD(1)

๐Ÿ“ฆ
version 26.1.0 ยท 3 versions
, in fedora 44

okay so bestie, pull up a chair ๐Ÿซถ this is the manual page for conda-build โ€” yes, CONDA-BUILD(1), the conda-build manual โ€” and it is long, but we're gonna get through it together because you deserve to know how to build packages ๐Ÿ’…โœจ

๐ŸŽ€ NAME ๐ŸŽ€

conda-build โ€” conda-build Documentation ๐Ÿ“–

Conda-build</p> is the whole toolkit, no cap. It contains the commands and tools to build your own conda packages ๐Ÿ’– It also hands you helpful tools to constrain or pin versions in recipes. And listen โ€” to actually build a conda package you first need to install conda-build <> and create a conda recipe <>. Then you use the conda build command to build the conda package from the conda recipe. That's the whole loop, periodt โœจ

You can build conda packages from a variety of source code projects, but most notably Python ๐Ÿ. For help packing a Python project, go look at the packaging.python.org tutorial: https://packaging.python.org/en/latest/tutorials/packaging-projects

OPTIONAL: if you're planning to upload your packages to anaconda.org (https://anaconda.org), you will need to make an anaconda.org account and install the Anaconda client (https://docs.anaconda.com/anaconda/install/). Just so you know ahead of time, bestie ๐Ÿซถ

๐Ÿ› ๏ธ INSTALLING AND UPDATING CONDA-BUILD ๐Ÿ› ๏ธ

So to enable building conda packages, you gotta:

๐Ÿ’ญ Way of working

For proper functioning, it is strongly recommended to install conda-build in the conda base environment. Not doing so may lead to problems ๐Ÿ˜ญ like fr, don't fight it.

๐Ÿง  Explanation

With earlier conda / conda-build versions, it was possible to build packages in your own defined environment, e.g. my_build_env. This was partly driven by the general conda recommendation not to use the base env for normal work โ€” see Conda Managing Environments (https://conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-environments) for instance. BUT โœ‹ conda-build is better viewed as part of the conda infrastructure, and not as a normal package. Hence, installing it in the base env makes way more sense. More information here: Must conda-build be installed in the base env? (https://github.com/conda/conda-build/issues/4995)

๐Ÿ“Œ Other considerations

  • An installation or update of conda-build (in fact, of any package) in the base environment needs to be run from an account with the proper permissions โ€” i.e., the same permissions as were used to install conda and the base env in the first place via the Miniconda or Anaconda installers. For example, on Windows that might mean an account with administrator privileges ๐Ÿ‘‘
  • conda-verify (https://github.com/conda/conda-verify) is a useful package that can also be added to the base environment in order to remove some warnings generated when conda-build runs. Cute little quality-of-life move ๐ŸŽ€
  • For critical CI/CD projects, you might want to pin to an explicit (but recent) version of conda-build, i.e. only update to a newer version of conda-build and conda once they have been first verified "offline". Very demure, very mindful ๐Ÿง˜

๐Ÿ“ฅ Installing conda-build

To install conda-build, in your terminal window or an Anaconda Prompt, run:

conda activate base
conda install conda-build

โฌ†๏ธ Updating conda and conda-build

Keep your versions of conda and conda-build up to date so you get all the bug fixes and new features, bestie ๐ŸŒŸ

To update conda and conda-build, in your terminal window or an Anaconda Prompt, run:

conda activate base
conda update conda
conda update conda-build

For release notes, see the conda-build GitHub page: https://github.com/conda/conda-build/releases


๐ŸŒˆ CONCEPTS ๐ŸŒˆ

๐Ÿ“ก Conda channels

Conda-build supports standard conda channel behavior. That's it, that's the tea โ˜• (https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html)

๐Ÿ˜ญ Identical channel and package name problem

If the channel and package name are identical, it's possible to encounter a build problem if the short channel name is used. Not me finding a cursed edge case ๐Ÿ™ˆ

Let's say your Anaconda.org username or an organization name is example. And suppose you created a package example, whose files' layout is similar to:

setup.py
conda/meta.yaml
example/

If your build depends on some other packages inside your channel, you will need to add -c example, however, the following code:

conda-build ./conda/ -c example

will fail with the following error message (the path will be different):

requests.exceptions.HTTPError: 404 Client Error: None for url:
file:///path/to/your/local/example/noarch/repodata.json
[...]
The remote server could not find the noarch directory for the requested channel with
url: file:///path/to/your/local/example/noarch/repodata.json
[...]
As of conda 4.3, a valid channel must contain a `noarch/repodata.json` and
associated `noarch/repodata.json.bz2` file, even if `noarch/repodata.json`
is empty. please request that the channel administrator create
`noarch/repodata.json` and associated `noarch/repodata.json.bz2` files.

This happens because conda-build will consider the directory ./example/ in your project as a channel. This is by design due to conda's CI servers, where the build path can be long, complicated, and not predictable prior to build ๐Ÿ’€

There are several ways to resolve this issue:

  1. Use the URL of the desired channel:
conda-build ./conda/ -c https://conda.anaconda.org/example/
  1. Run the build from inside the conda recipe directory:
cd conda
conda-build . -c example
  1. Use the label specification workaround:
conda-build ./conda/ -c example/label/main

which technically is the same as -c example, since main is the default label, but now it won't mistakenly find a channel example/label/main on the local filesystem. Clever girl behavior ๐Ÿ’…

๐Ÿ—‚๏ธ Channels and generating an index

๐ŸŒธ Channel layout

.
โ”œโ”€โ”€ channeldata.json
โ”œโ”€โ”€ linux-32
|   โ”œโ”€โ”€ repodata.json
โ”‚   โ””โ”€โ”€ package-0.0.0.tar.bz2
โ”œโ”€โ”€ linux-64
|   โ”œโ”€โ”€ repodata.json
โ”‚   โ””โ”€โ”€ package-0.0.0.tar.bz2
โ”œโ”€โ”€ win-64
|   โ”œโ”€โ”€ repodata.json
โ”‚   โ””โ”€โ”€ package-0.0.0.tar.bz2
โ”œโ”€โ”€ win-32
|   โ”œโ”€โ”€ repodata.json
โ”‚   โ””โ”€โ”€ package-0.0.0.tar.bz2
โ”œโ”€โ”€ osx-64
|   โ”œโ”€โ”€ repodata.json
โ”‚   โ””โ”€โ”€ package-0.0.0.tar.bz2
...

๐Ÿงฉ Parts of a channel

  • channeldata.json contains metadata about the channel, including:
    • What subdirs the channel contains.
    • What packages exist in the channel and what subdirs they are in.
  • Subdirs are associated with platforms. For example, the linux-64 subdir contains packages for linux-64 systems.
  • repodata.json contains an index of the packages in a subdir. Each subdir will have its own repodata.
  • Channels have packages as tarballs under corresponding subdirs.

๐Ÿ“„ channeldata.json

{
  "channeldata_version": 1,
  "packages": {
    "super-fun-package": {
      "activate.d": false,
      "binary_prefix": false,
      "deactivate.d": false,
      "home": "https://github.com/Home/super-fun-package",
      "license": "BSD",
      "post_link": false,
      "pre_link": false,
      "pre_unlink": false,
      "reference_package": "win-64/super-fun-package-0.1.0-py310_0.tar.bz2",
      "run_exports": {},
      "subdirs": [
        "win-64"
      ],
      "summary": "A fun package! Open me up for rainbows",
      "text_prefix": false,
      "version": "0.1.0"
    },
    "subdirs": [
      "win-64",
      ...
    ]
}

๐Ÿ“„ repodata.json

{
  "packages": {
    "super-fun-package-0.1.0-py310_0.tar.bz2": {
      "build": "py37_0",
      "build_number": 0,
      "depends": [
        "some-depends"
      ],
      "license": "BSD",
      "md5": "a75683f8d9f5b58c19a8ec5d0b7f796e",
      "name": "super-fun-package",
      "sha256": "1fe3c3f4250e51886838e8e0287e39029d601b9f493ea05c37a2630a9fe5810f",
      "size": 3832,
      "subdir": "win-64",
      "timestamp": 1530731681870,
      "version": "0.1.0"
    },
    ...
  },
  "packages.conda": {
      "super-fun-package-0.2.0-py310_0.conda": {
      "build": "py37_0",
      "build_number": 0,
      "depends": [
        "some-depends"
      ],
      "license": "BSD",
      "md5": "a75683f8d9f5b58c19a8ec5d0b7f796e",
      "name": "super-fun-package",
      "sha256": "e39029d601b9f493ea05c37a2630a9fe5810f1fe3c3f4250e51886838e8e0287",
      "size": 4125,
      "subdir": "win-64",
      "timestamp": 1530731987654,
      "version": "0.2.0"
    },
    ...
  }
}

โš™๏ธ How an index is generated

For each subdir:

  • Look at all the packages that exist in the subdir.
  • Generate a list of packages to add/update/remove.
  • Remove all packages that need to be removed.
  • For all packages that need to be added/updated:
    • Extract the package to access metadata, including full package name, file modification time (mtime), size, and index.json.
    • Aggregate package metadata to repodata collection.
  • Apply repodata hotfixes (patches).
  • Compute and save the reduced current_index.json index.

๐Ÿ—๏ธ Example: Building a channel

To build a local channel and put a package in it, follow the directions below ๐Ÿซก

  1. Make the channel directory.
$ mkdir local-channel
$ cd local-channel
  1. Now, download your favorite package. We'll use SciPy in our example. The next steps depend on your platform:
    1. Windows
$ mkdir win-64
$ curl -L https://anaconda.org/anaconda/scipy/1.9.1/download/win-64/scipy-1.9.1-py310h86744a3_0.tar.bz2 -o win-64\scipy-1.9.1-py310h86744a3_0.tar.bz2
  1. Linux
    1. Most Linux systems come with curl pre-installed. Let's install it if you don't already have it.
      1. Check if you have curl:
$ which curl
  1. If curl is not found, then install it:
$ conda install curl
  1. Create a local copy of the package you want to include in your channel:
$ mkdir linux-64
$ curl -L https://anaconda.org/anaconda/scipy/1.9.1/download/linux-64/scipy-1.9.1-py310hd5efca6_0.tar.bz2 -o linux-64\scipy-1.9.1-py310hd5efca6_0.tar.bz2
  1. macOS, Intel chip
$ mkdir osx-64
$ curl -L https://anaconda.org/anaconda/scipy/1.9.1/download/osx-64/scipy-1.9.1-py310h09290a1_0.tar.bz2 -o osx-64/scipy-1.9.1-py310h09290a1_0.tar.bz2
  1. macOS, Apple chip

and bestie, we are not done โ€” this is only part 1 of 54, the plot thickens ๐Ÿฆ‹

$ mkdir osx-arm64
$ curl -L https://anaconda.org/anaconda/scipy/1.9.1/download/osx-arm64/scipy-1.9.1-py310h20cbe94_0.tar.bz2 -o osx-arm64/scipy-1.9.1-py310h20cbe94_0.tar.bz2
  1. Other โ€” wanna find the latest SciPy on a platform that's not in the list above? No stress, bestie, just hit up the Anaconda Packages file list for SciPy at https://anaconda.org/anaconda/scipy/files. โœจ
  2. Run a conda index. This is the moment, okay, this generates both channeldata.json for the channel AND repodata.json for the linux-64 and osx-64 subdirs, plus some other files that are just vibing in the background:
$ conda index .
  1. Check your work by searching the channel, because we always verify in this house ๐Ÿ’…:
$ conda search -c file:/<path to>/local-channel scipy

SciPy should be available in several channels, including local-channel. Slay. ๐ŸŽ€


๐ŸŒˆ More details behind the scenes ๐ŸŒˆ

๐Ÿซง Caching package metadata

Caching utilizes the existing repodata.json file if it exists. Indexing checks which files to update based on which files are new, removed, or changed since the last repodata.json was created. When a package is new or changed, its metadata is extracted and cached in the subdir to which the package belongs. That subfolder is the .cache folder. Inside it there's exactly one file you actually care about: stat.json, which contains results from the stat command for each file. It's literally the thing that tells us when a file has changed and needs updating. In each of the other subfolders, the extracted metadata file for each package is saved as the original package name plus a .json extension. Having these already extracted can save a LOT of time when you need to fully re-create the index. Big deal, huge.

An aside, because I love lore: one design goal of the .conda package format was to make indexing as fast as possible. To achieve this, the .conda format separates metadata from the actual package contents. Where the old .tar.bz2 container required extracting the entire package just to obtain the metadata, the new package format allows extraction of metadata without touching the package contents. This allows indexing speed to be independent of the package size. Large .tar.bz2 packages can take a very long time to extract and index. ๐ŸŒ๐Ÿ’€

It is generally never necessary to manually alter the cache. But if you do need to force an update/rescan of all cached packages, you can delete the .cache folder, or you can delete just the .cache/stat.json file. Ideally you could remove only one package of interest from the cache, but ngl that functionality does not currently exist. ๐Ÿ™ˆ

๐Ÿฉน Repodata patching

Package repodata is bootstrapped from the index.json file within packages. Unfortunately, that metadata is not always correct. Sometimes a version bound needs to be added retroactively. The process of altering repodata from the values derived from package index.json files is called "hotfixing." Hotfixing is tricky, bestie โ€” it has the potential to break environments that have worked, but it is also sometimes necessary to fix environments that are known not to work. High risk, high reward energy. ๐Ÿ˜ญ

๐Ÿ Repodata patches generated from a python script

On your own server, you're probably fine to run arbitrary python code that you have written to apply your patches. The advantage here is that the patches are generated on the fly every time the index is generated. That means any new packages that have been added since the patch python file was last committed will be picked up and will have hotfixes applied to them where appropriate. It's giving self-updating, we love that. โœจ

Anaconda applies hotfixes by providing a python file to conda index that has logic on how to alter metadata. Anaconda's repository of hotfixes lives at https://github.com/AnacondaRecipes/repodata-hotfixes.

๐Ÿ“„ Repodata patches applied from a JSON file

Unfortunately, you can't always run your python code directly โ€” other people who host your patches may not allow you to run code. Which is so annoying, I know. What you can do instead is package the patches as .json files. These will clobber the entries in the repodata.json when they are applied. Clobber. Periodt.

This is the approach that conda-forge has to take, for example. Their patch creation code is here: https://github.com/conda-forge/conda-forge-repodata-patches-feedstock/tree/main/recipe

What that code does is download the current repodata.json, then runs their python logic to generate the patch JSON file. Those patches are placed into a location where Anaconda's mirroring tools will find them and apply them to conda-forge's repodata.json at mirroring time.

The downside here โ€” and there IS a downside, always is ๐Ÿ˜ญ โ€” is that this JSON file is only as new as the last time that the repodata-patches feedstock last generated a package. Any new packages that have been added to the index in the meantime will not have any hotfixes applied to them, because the hotfix JSON file does not know about those files.

โœ‚๏ธ Trimming to "current" repodata

The number of packages available is always growing. That means conda is always having to do more and more work. To slow down this growth, in conda 4.7, we added the ability to have alternate repodata.json files that may represent a subset of the normal repodata.json. One in particular is current_repodata.json, which represents:

  1. the latest version of each package
  2. any earlier versions of dependencies needed to make the latest versions satisfiable

current_repodata.json also keeps only one file type: .conda where it is available, and .tar.bz2 where only .tar.bz2 is available.

For Anaconda's defaults "main" channel, the current_repodata.json file is approximately 1/7 the size of repodata.json. This makes downloading the repodata faster, and it also makes loading the repodata into its python representation faster. Smaller file, faster everything, it's giving efficiency queen. ๐Ÿ‘‘

For those interested in how this is achieved, please refer to the code at https://github.com/conda/conda-build/blob/90a6de55d8b9e36fc4a8c471b566d356e07436c7/conda_build/index.py#L695-L737


๐Ÿ“ Conda-build recipes

To enable building conda packages (https://conda.io/projects/conda/en/latest/user-guide/concepts/packages.html), install and update conda and conda-build #install-conda-build.

Building a conda package requires a recipe. A conda-build recipe is a flat directory that contains the following files:

  • meta.yaml โ€” A file that contains all the metadata in the recipe. Only package/name and package/version are required.
  • build.sh โ€” The script that installs the files for the package on macOS and Linux. It is executed using the bash command.
  • bld.bat โ€” The build script that installs the files for the package on Windows. It is executed using cmd.
  • run_test.[py,pl,sh,bat,r] โ€” An optional Python test file, a test script that runs automatically if it is part of the recipe.
  • Optional patches that are applied to the source.
  • Other resources that are not included in the source and cannot be generated by the build scripts. Examples are icon files, readme files and build notes.

Review Defining metadata (meta.yaml) <> to see a breakdown of the components of a recipe, including:

  • Package name
  • Package version
  • Descriptive metadata
  • Where to obtain source code
  • How to test the package
Tip: ๐Ÿ’ก When you use the conda skeleton <#skeleton-ref> command, the first 3 files โ€” meta.yaml, build.sh, and bld.bat โ€” are automatically generated for you. Free labor, we stan.

๐Ÿงš Conda-build process

Conda-build performs the following steps:

  1. Reads the metadata.
  2. Downloads the source into a cache.
  3. Extracts the source into the source directory.
  4. Applies any patches.
  5. Re-evaluates the metadata, if source is necessary to fill any metadata values.
  6. Creates a build environment and then installs the build dependencies there.
  7. Runs the build script. The current working directory is the source directory with environment variables set. The build script installs into the build environment.
  8. Performs some necessary post-processing steps, such as adding a shebang and rpath.
  9. Creates a conda package containing all the files in the build environment that are new from step 5, along with the necessary conda package metadata.
  10. Tests the new conda package โ€” if the recipe includes tests โ€” by doing the following:
    • Deletes the build environment and source directory to ensure that the new conda package does not inadvertantly depend on artifacts not included in the package.
    • Creates a test environment with the package and its dependencies.
    • Runs the test scripts.

The archived conda-recipes repo (https://github.com/continuumio/conda-recipes), AnacondaRecipes aggregate repo (https://github.com/AnacondaRecipes/aggregate), and conda-forge feedstocks repo (https://github.com/conda-forge/feedstocks/tree/main/feedstocks) contain example recipes for many conda packages.

Caution: ๐Ÿšจ All recipe files, including meta.yaml and build scripts, are included in the final package archive that is distributed to users. Be careful not to put sensitive information such as passwords into recipes where it could be made public. Not me accidentally leaking my password in a meta.yaml, couldn't be me, but it COULD be you. ๐Ÿ™ˆ

The conda skeleton command can help to make skeleton recipes for common repositories, such as PyPI (https://pypi.python.org/pypi).


๐Ÿ” Deep dive

Let's take a closer look at how conda-build uses a recipe to create a package. Grab a snack, bestie. ๐Ÿ“

๐ŸŽ€ Templates

When you build a conda package, conda-build renders the package by reading a template in the meta.yaml. See Templating with Jinja <#jinja-templates>.

Templates are filled in using your conda-build configuration, which shows the matrix of things to build against. The conda-build configuration determines how many builds it has to do. For example, defining a conda_build_config.yaml of the form and filling it defines a matrix of 4 packages to build:

foo:
  - 1.0
  - 2.0
bar:
  - 1.2.0
  - 1.4.0

After this, conda-build determines what the outputs will be. For example, if your conda-build configuration indicates that you want 2 different versions of Python, conda-build will show you the rendering for each Python version.

๐Ÿ  Environments

To build the package, conda-build will make an environment for you and install all of the build and run dependencies in that environment. Conda-build will indicate where you can successfully build the package. The prefix will take the form:

<file path to conda>/conda-bld/<package name and string>/h_env_placeholderโ€ฆ

Conda-build downloads your package source and then builds the conda package in the context of the build environment. For example, you may direct it to download from a Git repo or pull down a tarball from another source. See the Source section <#source-section> for more information.

What conda-build puts into a package depends on what you put into the build, host, or run sections. Peep the Requirements section for the tea on that. Conda-build uses this info to figure out which dependencies to link against and which run requirements the package has. Basically it's how conda-build knows what's needed to install the thing. ๐Ÿง 

๐ŸŒˆ Building ๐ŸŒˆ

Once the content is downloaded, conda-build runs the build step. See the Build section for more info. The build step runs a script โ€” and yeah, it can totally be one you provided. See the Script section for the deets on that. โœจ

If you don't define the script section, then you can create a build.sh or a bld.bat file to be run. Easy.

๐ŸŽ€ Prefix replacement ๐ŸŽ€

The build environment gets created in a placeholder prefix. When the package is bundled, that prefix gets set to a "dummy" prefix. Then, once conda is ready to install the package, it rewrites the dummy prefix with the final one. Sneaky but iconic. ๐Ÿ’…

๐Ÿงช Testing ๐Ÿงช

Once a package is built, conda-build can test it. To do that, it creates another environment and installs the conda package. The form of this prefix is:

<file path to conda>/conda-bld/<package name + string>/_test_env_placeholderโ€ฆ

At this point conda-build has all the info from meta.yaml about what the runtime dependencies are, so those dependencies get installed too. This generates a test runner script that references the testing meta.yaml that's created. See the Test section for more. That file gets run for testing. ๐Ÿฆ‹

๐Ÿ“ฆ Output metadata ๐Ÿ“ฆ

After the package is built and tested, conda-build cleans up the environments it made during the previous steps and outputs the metadata. The recipe for the package also gets added into the output metadata. The metadata directory lives at the top level of the package contents, inside the info directory. The metadata holds info about the package's dependencies plus a list of where all the files in the package go when it's installed. Conda reads that metadata whenever it needs to install. ๐Ÿ‘‘

Running conda install makes conda do this whole lil routine:

  1. Reach out to the repodata containing the dependencies for the package(s) you're installing.
  2. Determine the correct dependencies.
  3. Install a list of additional packages determined by those dependencies.
  4. For each dependency package being installed:
    1. Unpack the tarball to look at the information contained within.
    2. Verify the file based on metadata in the package.
    3. Go through each file in the package and put it in the right location.

For additional info on conda install, go check the conda documentation deep dive page on that topic: https://docs.conda.io/projects/conda/en/stable/dev-guide/deep-dives/install.html ๐Ÿซถ

๐ŸŒธ Package naming conventions ๐ŸŒธ

To make communication and documentation easier, conda follows the package naming conventions listed below:

  • Package name โ€” The name of a package, with zero reference to any particular version. Conda package names are normalized and may contain only lowercase alpha characters, numeric digits, underscores, hyphens, or dots. In usage docs, these get referred to by package_name.
  • Package version โ€” A version number or string, often something like X.Y or X.Y.Z, but it can take other forms too.
  • Build string โ€” An arbitrary string that identifies a particular build of a package for conda. It may contain suggestive mnemonics, but those are subject to change, and you should not rely on it or try to parse it for any specific info. ๐Ÿšซ
  • Canonical name โ€” The package name, version, and build string joined together by hyphens: name-version-buildstring. In usage docs, these get referred to by canonical_name.
  • Filename โ€” Conda package filenames are canonical names, plus the suffix .tar.bz2 or .conda.

Here's a figure comparing a canonical name to a filename:

๐Ÿ–ผ๏ธ [image] Conda package naming.

Conda supports both .conda and .tar.bz2 package extensions. The .conda format (default since 25.1) is generally smaller and more efficient than .tar.bz2 packages. Read the blog post about it to learn more: https://www.anaconda.com/understanding-and-improving-condas-performance/ ๐Ÿ’–

For more info on configuring package formats, see Configuration. For detailed info about conda package formats and specifications, see package specification.

The build string is created as the package is built. Things that contribute to it are the variants specified either by the command line or the configuration from the conda_build_config.yaml, plus the build number in the recipe. If there are no variants, then the build string is the build number specified in the recipe. โœจ

๐ŸŽ€ Package specification ๐ŸŽ€

A package name together with a package version โ€” which may be partial or absent โ€” joined by an equal sign.

Examples:

  • python=2.7.3
  • python=2.7
  • python

In usage docs, these get referred to by package_spec.

๐Ÿ’œ What is a โ€œpackageโ€? ๐Ÿ’œ

  • A package is anything you install using your package manager.
  • A "conda package" is a compressed tarball that contains:
    • the module to be installed
    • information on how to install the package
  • You can use conda-build to build a conda package. ๐ŸŒˆ

๐Ÿฆ‹ What about channels? ๐Ÿฆ‹

  • Channels contain packages.
  • They conform to a standard structure and contain an index of available packages.
  • An index of the available packages can be generated by running:
$ conda index <path to channel>
  • conda is able to install from channels and uses the indexes in the channel to solve for requirements and dependencies. ๐Ÿงš

๐Ÿ‘‘ USER GUIDE ๐Ÿ‘‘

Welcome to the conda-build user guide, bestie! Here you'll find tutorials and recipes, plus info about environment variables and wheel files. ๐Ÿ’–

โœจ Getting started โœจ

Before you start the tutorials, consider reviewing how to install and update conda-build and conda-build concepts.

You might also find the resources collection helpful. ๐ŸŽ€

๐ŸŒธ Prerequisites ๐ŸŒธ

Before you start the tutorials, you need to install:

The most straightforward way to do this is to install Miniconda or Anaconda (which contain conda), and then use conda to install conda-build and Git. Make sure you install these packages into your base environment:

conda install -n base conda-build git

For more info on installing and updating conda-build, see Installing and updating conda-build. ๐Ÿซถ

๐Ÿ’… Tutorial submissions ๐Ÿ’…

Got an idea for a tutorial? You can submit your suggestions to Anaconda by emailing us at documentation@anaconda.com. ๐Ÿ“ง

To create your own tutorials, follow the writing style guide and tutorial template.

๐ŸŒˆ Tutorials ๐ŸŒˆ

Before starting the tutorials, review the Getting started guide. โญ

๐Ÿงช Building conda packages ๐Ÿงช

Overview

This tutorial describes how to use conda-build to create conda packages on Windows, macOS, and Linux, using the examples of SEP and GDAL. Additional Windows-specific instructions are provided in the Toolkit section.

The final built packages from this tutorial are available on anaconda.org (formerly known as Anaconda Cloud):

This tutorial also describes writing recipes. You can see the final SEP recipe (https://github.com/conda-forge/sep-feedstock) and the GDAL recipe (https://github.com/conda-forge/gdal-feedstock) on GitHub in the conda-build documentation repository (https://github.com/conda/conda-build/tree/main/docs). ๐Ÿ”ฅ

Who is this for?

This tutorial is for Windows, macOS, and Linux users who wish to build more complex conda packages. It involves building scientific packages, which require compilers for several different Python versions. ๐Ÿ

Before you start

Before you start, make sure you have installed:

Toolkit

๐ŸŽ€ Microsoft Visual Studio ๐ŸŽ€

In the standard practices of the conda developers, conda packages for different versions of Python are each built with their own version of Visual Studio (VS):

  • Python 2.7 packages with Visual Studio 2008
  • Python 3.4 packages with VS 2010
  • Python 3.5 packages with VS 2015, (default) 2017
  • Python 3.6 packages with VS 2015, (default) 2017
  • Python 3.7 packages with VS 2015, (default) 2017

Using these versions of VS to build packages for each of these versions of Python is also the practice used for the official python.org builds of Python. Currently VS 2008 and VS 2010 are available only through resellers, while VS 2015 and VS 2017 can be purchased online from Microsoft. Note there's also a community edition of VS 2015 and VS 2017 which may be used. ๐Ÿ‘‘

Alternatives to Microsoft Visual Studio

There are free alternatives available for each version of the VS compilers:

The MS Visual C++ Compiler for Python 2.7 and the Microsoft Windows SDK for Windows 7 and .NET Framework 4 are both, like, genuinely reasonably well tested, bestie. Not me being impressed. Conda-build is carefully tested to support these configurations, but there are known issues with the CMake build tool and these free VS 2008 and 2010 alternatives. ๐Ÿ’€ So in those cases you should lowkey prefer the "NMake Makefile" generator, rather than a Visual Studio solution generator. iykyk.


๐ŸชŸ Windows versions ๐ŸชŸ

You can use literally any recent version of Windows, no cap. These examples were built on Windows 10. โœจ


๐Ÿงš Other tools ๐Ÿงš

Some environments start out with nothing, and are missing tools like patch or Git that may be needed for some build workflows. ๐Ÿ™ˆ Not a vibe, but we fix it.

On Windows, you can install these with conda using the following command:

$ conda install git m2-patch

On macOS and Linux, just swap out m2-patch for patch. ๐Ÿ’…


๐ŸŒˆ Developing a build strategy ๐ŸŒˆ

Conda recipes are typically built with a trial-and-error method, and honestly? That's the whole personality. ๐Ÿ˜ญ Sometimes the first attempt to build a package will fail with compiler or linker errors, often caused by missing dependencies. The person writing the recipe then examines these errors and modifies the recipe to include the missing dependencies, usually as part of the meta.yaml file. Then the recipe writer attempts the build again, and after a few of these cycles of trial and error, the package builds successfully. Main character arc, periodt. ๐Ÿ‘‘


๐Ÿ Building with a Python version different from your Miniconda installation ๐Ÿ

Miniconda2 and Miniconda3 can each build packages for either Python 2 or Python 3, simply by specifying the version you want. Miniconda2 includes only Python 2, and Miniconda3 includes only Python 3. ๐Ÿ’–

Installing only one makes it easier to keep track of the builds, but it is possible to have both installed on the same system at the same time. If you do have both installed, use the where command on Windows, or the which command on macOS or Linux, to see which version comes first on PATH, since this is the one you will be using:

$ where python

To build a package for a Python version other than the one in your Miniconda installation, use the --python option in the conda-build command. For example, to build a Python 3.5 package with Miniconda2:

$ conda-build recipeDirectory --python=3.5
๐Ÿซถ Note: Replace recipeDirectory with the name and path of your recipe directory.

๐ŸŽ€ Automated testing ๐ŸŽ€

After the build, if the recipe directory contains a test file โ€” that's the moment. ๐Ÿ‘€ This test file is named run_test.bat on Windows, run_test.sh on macOS or Linux, or run_test.py on any platform. The file runs to test the package, and any errors that surface are reported. After seeing "check the output," you can also test if this package was built by using the command:

$ conda build --test <path to package>.tar.bz2
๐ŸŒธ Note: Use the "test" section of the meta.yaml file to move data files from the recipe directory to the test directory when the test is run.

๐Ÿฆ‹ Building a SEP package with conda and Python 2 or 3 ๐Ÿฆ‹

The SEP documentation (https://sep.readthedocs.io) states that SEP runs on Python 2 and 3, and it depends only on NumPy. Searching for SEP on PyPI shows that there is already a PyPI package for SEP (https://pypi.python.org/pypi/sep). โœจ

Because a PyPI package for SEP already exists, the conda skeleton command can make a skeleton, or outline, of a conda recipe based on the PyPI package. The recipe outline can then be completed manually, and conda can build a conda package from the completed recipe. It's giving efficiency. ๐Ÿ’…

โญ Install Visual Studio โญ

If you have not already done so, install the appropriate version of Visual Studio:

  • For Python 3 โ€” Visual Studio 2017:
    1. Choose the "Custom install" option.
    2. Under Programming Languages, choose to install Visual C++.
  • For Python 2 โ€” Visual Studio 2008:
    1. Choose the "Custom install" option.
    2. Choose to install X64 Compilers and Tools. Install Service Pack 1.

๐Ÿ“ Make a conda skeleton recipe ๐Ÿ“

  1. Run the skeleton command:
$ conda skeleton pypi sep

The skeleton command installs into a newly-created directory called sep.

  1. Go to the sep directory to view the files:
$ cd sep

You will see that one skeleton file has been created: meta.yaml. ๐ŸŽ‰

๐Ÿ’œ Edit the skeleton files ๐Ÿ’œ

For this package, bld.bat and build.sh need no changes, bestie โ€” they're already that girl. You do need to edit the meta.yaml file to add the dependency on NumPy, and add an optional test for the built package by importing it. For more information about what can be specified in meta.yaml, see Defining metadata (meta.yaml).

  1. In the requirements section of the meta.yaml file, add a line that adds NumPy as a requirement to build the package.
  2. Add a second line to list NumPy as a requirement to run the package.
  3. Set the NumPy version to the letters x.x.
  4. Make sure the new line is aligned with - python on the line above it, so as to ensure proper yaml format. (YAML is so sensitive, honestly. ๐Ÿ™„)

EXAMPLE:

requirements:
  host:
    - python
    - numpy     x.x

  run:
    - python
    - numpy     x.x

Notice that there are two types of requirements, host and run (build is another valid parameter, but is not shown in this example). host represents packages that need to be specific to the target platform when the target platform is not necessarily the same as the native build platform. run represents the dependencies that should be installed when the package is installed. ๐Ÿซถ

๐Ÿ’€ Note: Using the letters x.x instead of a specific version such as 1.11 pins NumPy dynamically, so that the actual version of NumPy is taken from the build command. Currently, NumPy is the only package that can be pinned dynamically. Pinning is important for SEP because this package uses NumPy's C API through Cython. That API changes between NumPy versions, so it is important to use the same NumPy version at runtime that was used at build time.

๐Ÿงš Optional: Add a test for the built package ๐Ÿงš

Adding this optional test will test the package at the end of the build by making sure that the Python statement import sep runs successfully:

  1. Add - sep, checking to be sure that the indentation is consistent with the rest of the file:
test:
  # Python imports
  imports:
    - sep

๐Ÿ”ฅ Build the package ๐Ÿ”ฅ

Build the package using the recipe you just created:

$ conda build sep
โœจ Note: By default, conda-build creates packages in the modern .conda format. If you need legacy .tar.bz2 format compatibility, use the --package-format=1 option. For more information on package formats, see Configuration.

๐Ÿ‘‘ Check the output ๐Ÿ‘‘

  1. Check the output to make sure that the build completed successfully. The output contains the location of the final package file and a command to upload the package to Anaconda Cloud. The output will look something like:
# Automatic uploading is disabled
# If you want to upload package(s) to anaconda.org later, type:
anaconda upload /Users/builder/miniconda3/conda-bld/osx-64/sep-1.0.3-np111py36_0.tar.bz2
# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes
anaconda_upload is not set.  Not uploading wheels: []
####################################################################################
Resource usage summary:
Total time: 0:00:56.4
CPU usage: sys=0:00:00.7, user=0:00:07.0
Maximum memory usage observed: 220.1M
Total disk usage observed (not including envs): 3.9K
####################################################################################
Source and build intermediates have been left in /Users/builder/miniconda3/conda-bld.
There are currently 437 accumulated.
To remove them, you can run the ```conda build purge``` command
  1. If there are any linker or compiler errors, modify the recipe and build again. ๐Ÿ˜ค (You got this. Fr fr.)

๐ŸŒˆ Building a GDAL package with conda and Python 2 or 3 ๐ŸŒˆ

To begin, install Anaconda or Miniconda and conda-build. If you are using a Windows machine, also use conda to install Git and m2-patch.

$ conda install git
$ conda install m2-patch

Because GDAL includes C and C++, building it on Windows requires Visual Studio. This procedure describes how to build a package with Python 2 or Python 3. Follow the instructions for the version with which you want to build. ๐Ÿ’–

To build a GDAL package:

  1. Install Visual Studio:
  2. Install Git. Because the GDAL package sources are retrieved from GitHub for the build, you must install Git:
$ conda install git m2-patch conda-build
  1. Get gdal-feedstock. For the purpose of this tutorial, we will be using a recipe from Anaconda:
$ git clone https://github.com/AnacondaRecipes/gdal-feedstock.git
  1. Use conda-build to build the gdal-feedstock:
$ conda build gdal-feedstock
โœจ Note: By default, conda-build creates packages in the modern .conda format. If you need legacy .tar.bz2 format compatibility, use the --package-format=1 option. For more information on package formats, see Configuration.
  1. Check the output to make sure that the build completed successfully. The output also contains the location of the final package file and a command to upload the package to Cloud. For this package in particular, there should be two packages outputted: libgdal and GDAL. ๐ŸŽ‰
  2. In case of any linker or compiler errors, modify the recipe and run it again. ๐Ÿ”

Let's take a closer look at what's happening inside the gdal-feedstock, specifically in the meta.yaml file. ๐Ÿ‘€

The first interesting bit happens under source in the patches section:

patches:
  # BUILT_AS_DYNAMIC_LIB.
  - 0001-windowshdf5.patch
  # Use multiple cores on Windows.
  - 0002-multiprocessor.patch
  # disable 12 bit jpeg on Windows as we aren't using internal jpeg
  - 0003-disable_jpeg12.patch

This bit is literally just saying "bestie, when this package gets built on Windows, apply these patch files, mmkay?" And notice the patch files live in the patches directory of the recipe โ€” that's the vibe. They only get applied to Windows because the # [win] selector is tacked onto every single patch entry. Want the whole lore on selectors? Go peek at Preprocessing selectors <#preprocess-selectors>. ๐ŸŽ€

In the requirements section, clock that there's a build set AND a host set of requirements (run is also a valid parameter, it's just not showing up in this example, lowkey camera-shy). For this recipe, all the compilers you need to build the package are chillin' in the build requirements. Normally this section lists out the packages required to build the package, periodt. GDAL requires CMake on Windows, plus C compilers. And see how the C compilers get pulled into the recipe with the syntax {{ compiler('c') }}? Since conda-build 3, conda-build defines a jinja2 function compiler() to specify compiler packages dynamically. So using the compiler('c') function in a conda recipe pulls in the correct compiler for any build platform. Slay. More on compilers with conda-build? See compiler-tools <#compiler-tools>. ๐Ÿงš

Also note โ€” the compilers conda-build uses can be specified with a conda_build_config.yaml. Wanna know how? See Using your customized compiler package with conda-build 3 <#using-your-customized-compiler-package-with-conda-build-3>.

Now, notice this package has an outputs section. It's a list of packages to output as a result of building this package. In this case, libgdal and GDAL get built. Just like a normal recipe, the outputs can have build scripts, test scripts, and requirements specified. The whole Outputs section <#package-outputs> is right there if you're obsessed and need more.

OK so now let's try to build GDAL against some build matrix ๐Ÿ’… We're specifying a build against Python 3.7 and 3.5 using a conda-build config. Drop the following into your conda_build_config.yaml:

python:
   - 3.7
   - 3.5

And now you can build GDAL using conda-build with the command:

$ conda build gdal-feedstock

Or set the location of the conda-build variant matrix explicitly:

$ conda build gdal-feedstock --variant-config-file conda_build_config.yaml

If you're dying to know more about build variants and conda_build_config.yaml โ€” like how to specify a config file and what can go inside it โ€” take a look at Creating conda-build variant config files <#conda-build-variant-config-files>. ๐ŸŒˆ

๐ŸŒธ Building conda packages with conda skeleton ๐ŸŒธ

Tip: We recommend Grayskull <https://github.com/conda/grayskull> โ€” a newer alternative to conda-skeleton โ€” to generate conda recipes for PyPI packages. Please check out their project page on GitHub for more information. ๐Ÿ‘‘

โœจ Overview โœจ

This tutorial describes how to quickly build a conda package for a Python module that's already available on PyPI.

In the first procedure, building a simple package, you build a package that can be installed in any conda environment of the same Python version as your root environment. The remaining optional procedures describe how to build packages for other Python versions and other architectures, plus how to upload packages to your Anaconda.org account.

Note: You may consider using Docker <https://www.docker.com/> to run the tutorial.

๐Ÿฆ‹ Who is this for? ๐Ÿฆ‹

This tutorial is for Windows, macOS, and Linux users who wish to build a conda package from a PyPI package. No prior knowledge of conda-build or conda recipes is required. Yes bestie, you can walk in knowing literally nothing. ๐Ÿ˜Œ

๐Ÿ’œ Before you start ๐Ÿ’œ

Before you start, check the Prerequisites <#prereqs>.


๐ŸŽ€ Building a simple package with conda skeleton pypi ๐ŸŽ€

The conda skeleton command picks up the PyPI package metadata and prepares the conda-build recipe. The final step is to build the package itself and install it into your conda environment.

It is easy to build a skeleton recipe for any Python package that's hosted on PyPI, the official third-party software repository for the Python programming language.

In this section you're going to use conda skeleton to generate a conda recipe, which informs conda-build about where the source files are located and how to build and install the package.

You'll be working with a package named Click <https://github.com/pallets/click> that's hosted on PyPI. Click is a tool for exposing Python functions to create command line interfaces. Iconic honestly.

First, in your user home directory, run the conda skeleton command:

conda skeleton pypi click

The two arguments to conda skeleton are the hosting location โ€” in this case pypi โ€” and the name of the package.

This creates a directory named click and creates one skeleton file in that directory: meta.yaml. Many other files can be added there as necessary, such as build.sh and bld.bat, test scripts, or anything else you need to build your software. For simple, pure-Python recipes, these extra files are unnecessary and the build/script section in the meta.yaml is sufficient. Use the ls command on macOS or Linux, or the dir command on Windows, to verify that this file has been created. The meta.yaml file has been populated with information from the PyPI metadata and in many cases will not need to be edited. ๐Ÿ™ˆ

Files in the folder with meta.yaml are collectively referred to as the "conda-build recipe":

  • meta.yaml โ€” Contains all the metadata in the recipe. Only the package name and package version sections are required โ€” everything else is optional.
  • bld.bat โ€” Windows commands to build the package.
  • build.sh โ€” macOS and Linux commands to build the package.

Now that you have the conda-build recipe ready, you can use conda-build to create the package:

conda-build click

When conda-build is finished, it displays the exact path and filename of the conda package. See Troubleshooting a sample issue if the conda-build command fails.

Windows example file path:

C:\Users\jsmith\miniconda\conda-bld\win-64\click-7.0-py37_0.tar.bz2

macOS example file path:

/Users/jsmith/miniconda/conda-bld/osx-64/click-7.0-py37_0.tar.bz2

Linux example file path:

/home/jsmith/miniconda/conda-bld/linux-64/click-7.0-py37_0.tar.bz2
Note: Your path and filename will vary depending on your installation and operating system. Save the path and filename information for the next step. ๐Ÿ“Œ

Now you can install your newly built package in your conda environment by using the use-local flag:

conda install --use-local click

Notice that Click is coming from the local conda-build channel.

(click) 0561:~ jsmith$ conda list
# packages in environment at /Users/Jsmith/miniconda/envs/click:
# Name                    Version                   Build  Channel
ca-certificates           2019.1.23                     0
certifi                   2019.3.9                 py37_0
click                     7.0                      py37_0    local

Now verify that Click installed successfully:

conda list

Scroll through the list until you find Click. ๐Ÿ”

At this point you now have a conda package for Click that can be installed in any conda environment of the same Python version as your root environment. The remaining optional sections show you how to make packages for other Python versions and other architectures, and how to upload them to your Anaconda.org account.


๐Ÿ’… Optional---Building for a different Python version ๐Ÿ’…

By default, conda-build creates packages for the version of Python installed in the root environment. To build packages for other versions of Python, you use the --python flag followed by a version. For example, to explicitly build a version of the Click package for Python 2.7, use:

conda-build --python 2.7 click

Notice that the file printed at the end of the conda-build output has changed to reflect the requested version of Python. conda install will look in the package directory for the file that matches your current Python version.

Windows example file path:

C:\Users\jsmith\Miniconda\conda-bld\win-64\click-7.0-py27_0.tar.bz2

macOS example file path:

/Users/jsmith/miniconda/conda-bld/osx-64/click-7.0-py27_0.tar.bz2

Linux example file path:

/home/jsmith/miniconda/conda-bld/linux-64/click-7.0-py27_0.tar.bz2
Note: Your path and filename will vary depending on your installation and operating system. Save the path and filename information for the next task. ๐Ÿ“Œ

๐ŸŒˆ Optional---Converting conda package for other platforms ๐ŸŒˆ

Now that you've built a package for your current platform with conda-build, you can convert it for use on other platforms with the conda convert command. This works only for pure Python packages where there is no compiled code. Conda convert does nothing to change compiled code โ€” it only adapts file paths to take advantage of the fact that Python scripts are mostly platform independent. Conda convert accepts a platform specifier from this and a platform specifier from this list:

  • osx-64.
  • linux-32.
  • linux-64.
  • win-32.
  • win-64.
  • all.

In the output directory, 1 folder will be created for each of the 1 or more platforms you chose, and each folder will contain a .tar.bz2 package file for that platform.

Windows:

conda convert -f --platform all C:\Users\jsmith\miniconda\conda-bld\win-64\click-7.0-py37_0.tar.bz2
-o outputdir\

macOS and Linux:

conda convert --platform all /home/jsmith/miniconda/conda-bld/linux-64/click-7.0-py37_0.tar.bz2
-o outputdir/
Note: Change your path and filename to the exact path and filename you saved in Optional---Building for a different Python version.

To use these packages, you need to transfer them to other computers and place them in the correct conda-bld/$ARCH directory for the platform, where $ARCH can be osx-64, linux-32, linux-64, win-32, or win-64.

A simpler way is to upload all of the bz2 files to Anaconda.org as described in the next task.

If you find yourself needing to use conda convert, you might instead prefer to change your recipe to make your package a "noarch" package. Noarch packages run anywhere and do not require conda convert. Some of the ecosystem tools don't yet support noarch packages but, for the most part, noarch packages are a better way to go. โœจ

Optional---Uploading packages to Anaconda.org

Okay so Anaconda.org is a whole repository for public or private packages, and uploading there means your package can be installed in any environment with just the conda install command โ€” no more manually copying or moving the tarball file from one place to another like it's 2009. ๐Ÿ’… You get to choose whether your files are public or private. Wanna know more about Anaconda.org? Go read the Anaconda.org documentation <http://docs.anaconda.org/>. โœจ

  1. Create a free Anaconda.org account and write down your new Anaconda.org username and password. ๐ŸŽ€
  2. Run conda install anaconda-client and enter your Anaconda.org username and password.
  3. Log into your Anaconda.org account from your terminal with the command anaconda login.

Now bestie, you can upload the new local packages to Anaconda.org. ๐Ÿ‘‘

Windows:

anaconda upload C:\Users\jsmith\miniconda\conda-bld\win-64\click-7.0-py37_0.tar.bz2

macOS and Linux:

anaconda upload /home/jsmith/miniconda/conda-bld/linux-64/click-7.0-py37_0.tar.bz2
Note: Change your path and filename to the exact path and filename you saved in Optional---Building for a different Python version. Your path and filename will vary depending on your installation and operating system. ๐Ÿ™ˆ

If you created packages for multiple versions of Python, or you used conda convert to make packages for each supported architecture, you must use the anaconda upload command to upload each one. And it's considered best practice to create packages for Python versions 2.7, 3.4, and 3.5 along with all of the architectures. fr fr. ๐Ÿฆ‹

Tip: If you want to always automatically upload a successful build to Anaconda.org, run: conda config --set anaconda_upload yes

You can log out of your Anaconda.org account with the command:

anaconda logout

Troubleshooting a sample issue

Conda-build may produce the error message "Build Package missing." ๐Ÿ˜ญ (not me crying over build errors)

To explore this error:

  1. Create a conda skeleton package for skyfield. The conda skeleton command is:
conda skeleton pypi skyfield

This command creates the skyfield conda-build recipe.

  1. Run conda-build skyfield and observe that it fails with the following output:
Removing old build environment
Removing old work directory
BUILD START: skyfield-0.8-py35_0
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .
Error:  Package missing in current osx-64 channels:
  - sgp4 >=1.4

In this example, the conda recipe requires sgp4 for the skyfield package. The skyfield recipe was created by conda skeleton. This error means that conda could not find the sgp4 package and install it. ๐Ÿ’€

Since many PyPI packages depend on other PyPI packages to build or run, the solution is sometimes as simple as using conda skeleton to create a conda recipe for the missing package and then building it:

conda skeleton sgp4
conda build sgp4

You may also try using the --recursive flag with conda skeleton, but heads up โ€” this makes conda recipes for all required packages, even those that are already available to conda install. So like, extra work, but valid. ๐Ÿซถ

More information

For more options, see the full conda skeleton command documentation <>. ๐Ÿ“š


๐ŸŒˆ Building conda packages from scratch ๐ŸŒˆ

Overview

This tutorial describes how to build a conda package for Click by writing the required files in the conda-build recipe. We're doing it by hand bestie, artisanal style. โœจ

Who is this for?

This tutorial is for Windows, macOS, and Linux users who wish to generate a conda package by writing the necessary files. Prior knowledge of conda-build and conda recipes is helpful. ๐ŸŽ€

Before you start

  • Check the Prerequisites <#prereqs>.
  • You should have already completed Building conda packages with conda skeleton <>. (iykyk)

Editing the meta.yaml file

  1. Make a new directory for this tutorial named click, and then change to the new directory:
mkdir click
cd click
  1. To create a new meta.yaml file, open your favorite editor. Create a new text file and insert the information shown below. A blank sample meta.yaml follows the table to make it easier to match up the information. ๐Ÿ“
Note: To allow correct sorting and comparison, specify version as a string.
package:
  name:
  version:

source:
  git_rev:
  git_url:

requirements:
  build:
    - python
    - setuptools

  run:
    - python

test:
  imports:
    -

about:
  home:
  1. Save the file in the same click directory as meta.yaml. It should match this meta.yaml file. ๐Ÿ’–

Writing the build script files build.sh and bld.bat

Besides meta.yaml, 2 files are required for a build:

  • build.sh---Shell script for macOS and Linux.
  • bld.bat---Batch file for Windows.

These 2 build files contain all the variables, such as for 32-bit or 64-bit architecture---the ARCH variable---and the build environment prefix---PREFIX. The 2 files build.sh and bld.bat must be in the same directory as your meta.yaml file. no cap. ๐Ÿซก

This tutorial describes how to make both build.sh and bld.bat so that other users can build the appropriate package for their architecture.

  1. Open a text editor and create a new file named bld.bat. Type the text exactly as shown:
"%PYTHON%" setup.py install
if errorlevel 1 exit 1
Note: In bld.bat, the best practice is to to add if errorlevel 1 exit 1 after every command so that if the command fails, the build fails. (yes, the original really says "to to" โ€” iconic typo, we keep it ๐Ÿ’…)
  1. Save this new file bld.bat to the same directory where you put your meta.yaml file.
  2. Open a text editor and create a new file named build.sh. Enter the text exactly as shown:
$PYTHON setup.py install     # Python command to install the script.
  1. Save your new build.sh file to the same directory where you put the meta.yaml file.

You can run build.sh with bash -x -e. The -x makes it echo each command that is run, and the -e makes it exit whenever a command in the script returns nonzero exit status. If you need to revert this in the script, use the set command in build.sh. ๐Ÿ”ฅ

Building and installing

Now that you have your 3 new build files ready, you are ready to create your new package with conda-build and install the package on your local computer. main character moment fr. ๐Ÿ‘‘

  1. Run conda-build:
conda-build click

If you are already in the click folder, you can type conda build .

When conda-build is finished, it displays the package filename and location. In this case the file is saved to:

~/anaconda/conda-bld/linux-64/click-7.0-py37_0.tar.bz2
Note: By default, conda-build now creates packages in the modern .conda format. The example above shows the legacy .tar.bz2 format. For more information on package formats and how to configure them, see Configuration <#configuration>.
Note: Save this path and file information for the next task. The exact path and filename vary depending on your operating system and whether you are using Anaconda or Miniconda. The conda-build command tells you the exact path and filename. ๐Ÿ“Œ
  1. Install your newly built program on your local computer by using the use-local flag:
conda install --use-local click

If there are no error messages, Click installed successfully. ๐ŸŽ‰

Note: Explicitly installing a local package bypasses the dependency resolver, as such the package's run dependencies will not be evaluated. See conda install --help or the install command reference page <https://docs.conda.io/projects/conda/en/latest/commands/install.html> for more info. โš ๏ธ

Converting a package for use on all platforms

Now that you have built a package for your current platform with conda-build, you can convert it for use on other platforms by using the 2 build files, build.sh and bld.bat. ๐Ÿฆ‹

Use the conda convert command with a platform specifier from the list:

  • osx-64.
  • linux-32.
  • linux-64.
  • win-32.
  • win-64.
  • all.

EXAMPLE: Using the platform specifier all:

conda convert --platform all ~/anaconda/conda-bld/linux-64/click-7.0-py37_0.tar.bz2 -o outputdir/
Note: Change your path and filename to the path and filename you saved in Building and installing.

Optional---Using PyPI as the source instead of GitHub

You can use PyPI or another repository instead of GitHub. There is little difference to conda-build between building from Git versus building from a tarball on a repository like PyPI. Because the same source is hosted on PyPI and GitHub, you can easily find a script on PyPI instead of GitHub. ๐ŸŒธ

Replace this source section:

git_rev: v0.6.7
git_url: https://github.com/pallets/click.git

okay so instead you swap all that out for this lil glow-up โœจ:

url: https://files.pythonhosted.org/packages/f8/5c/f60e9d8a1e77005f664b76ff8aeaee5bc05d0a91798afd7f53fc998dbc47/Click-7.0.tar.gz
sha256: 5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7
Note: bestie the url and sha256 live right there on the PyPI Click page <https://pypi.org/project/click/#files> ๐Ÿ‘€

๐ŸŽ€ Optional---Uploading new packages to Anaconda.org ๐ŸŽ€

So after you've converted your files so they play nice on other platforms, you may wanna yeet them up to Anaconda.org (formerly known as binstar.org, throwback fr). It literally takes a minute if you've got a free Anaconda.org account ๐Ÿ’…

  1. If you haven't already, open a free Anaconda.org account and write down your new username and password ๐Ÿ“
  2. Run conda install anaconda-client, then enter your Anaconda.org username and password.
  3. Log into your Anaconda.org <http://anaconda.org> account with the command:
anaconda login
  1. Upload your package to Anaconda.org:
anaconda upload ~/miniconda/conda-bld/linux-64/click-7.0-py37_0.tar.bz2
Note: swap out the path and filename for the actual path and filename you saved back in Building and installing ๐Ÿ™ˆ Tip: to save time, you can set conda to always upload a successful build to Anaconda.org with: conda config --set anaconda_upload yes ๐Ÿš€

More information

  • For more info on all the possible values that can go into the meta.yaml file, see Defining metadata (meta.yaml) <>.

๐ŸŒธ Building R packages with skeleton CRAN ๐ŸŒธ

Overview

This tutorial walks you through quickly building an R-language package on macOS for an R module that's already chilling on CRAN.

You're gonna build a simple package that can be installed in any conda environment running the same R version as your root environment. The tutorial also tells you how to build the dependencies that might pop up while you're building the package ๐Ÿซถ

Who is this for?

This one's for macOS users who wanna build an R-language package from CRAN. No prior knowledge of conda-build or conda recipes needed โ€” you're fine, bestie ๐Ÿ’–

Before you start

Before you start, check the prerequisites <> โœจ

๐Ÿงš Building a simple package with conda skeleton CRAN ๐Ÿงš

The conda skeleton command picks up the CRAN package metadata and preps the conda-build recipe. The final step is building the package itself and installing it into your conda environment.

It's genuinely easy to build a skeleton recipe for any R package hosted on CRAN. In this section you're gonna use conda skeleton to generate a conda recipe, which tells conda-build where the source files live and how to build and install the package.

You'll be working with a package hosted on CRAN named fansi <https://github.com/conda-forge/r-fansi-feedstock> โ€” a tool that accounts for the effects of ANSI text formatting control sequences ๐Ÿ’…

First, in your user home directory, run the conda skeleton command:

conda skeleton cran fansi

The two arguments to conda skeleton are the type of hosting location โ€” in this case cran โ€” and the name of the package.

This creates a directory named r-fansi and creates 1 skeleton file in that directory: meta.yaml. Many other files can be added there as necessary, like build.sh and bld.bat, test scripts, or literally anything else you need to build your software. Use the ls command to verify that this file has been created. The meta.yaml file has been populated with info from the CRAN metadata and in many cases won't need to be edited ๐ŸŽ€

Files in the folder with meta.yaml are collectively referred to as the "conda-build recipe":

  • meta.yaml---Contains all the metadata in the recipe. The package name and package version sections are required---everything else is optional.
  • bld.bat---Windows commands to build the package.
  • build.sh---macOS and Linux commands to build the package.

Now that you've got the conda-build recipe ready, you can use conda-build to create the package:

conda-build r-fansi

When conda-build finishes, it displays the exact path and filename of the conda package. See Troubleshooting a sample issue <#troubleshooting> if the conda-build command fails. If you get an error with SDK on macOS, review our resources for macOS and SDK <#mac-sdk>.

Example file path:

/Users/jsmith/anaconda3/conda-bld/osx-64/r-fansi-0.4.0-r353h46e59ec_0.tar.bz2
Note: your path and filename will vary depending on your installation and operating system. Save that path and filename info for the next step ๐Ÿ™ˆ

Now you can install your newly built package in your conda environment by using the use-local flag:

conda install --use-local r-fansi

Now verify that fansi installed successfully:

conda list

Scroll through the list until you find r-fansi.

Notice that fansi is coming from the local conda-build channel ๐Ÿ‘‘

(base) 0561:~ jsmith$ conda list
# packages in environment at /Users/Jsmith/anaconda3:
# Name                    Version                   Build  Channel
qtpy                      1.5.0                    py37_0
r-base                    3.5.1                h539fb6c_1
r-fansi                   0.4.0            r353h46e59ec_0    local

The version of R will be whatever you've got in your base environment.

See Optional---Building for a different R version to set your own R version ๐Ÿ’œ

At this point you've now got a conda package for fansi that can be installed in any conda environment of its R version. Slay ๐Ÿ’…

๐Ÿ’€ Building an R package with dependencies ๐Ÿ’€

The fansi package was a simple one that didn't have dependencies. To build an R package with dependencies, let's look at the example of janitor. Janitor is a package hosted on CRAN that's used for examining and cleaning up data.

To begin building it, type:

conda skeleton cran janitor

This creates a directory named r-janitor and creates one skeleton file in that directory: meta.yaml. Many other files can be added there as necessary, like build.sh and bld.bat, test scripts, or anything else you need to build your software. Use the ls command to verify that this file has been created. The meta.yaml file has been populated with info from the CRAN metadata and in many cases won't need to be edited ๐ŸŒˆ

Now that you've got the conda-build recipe ready, you can use conda-build to create the package:

conda-build r-janitor

What might happen at this point is that you'll have dependencies of this package that don't exist as conda packages yet ๐Ÿ˜ญ They need to be turned into conda packages. Use conda skeleton to recursively build out recipes for the packages that it depends on:

conda skeleton cran janitor --recursive

You can manually build each package individually by typing:

conda-build package-name
Note: replace "package-name" with the name of each package.

Once all the package dependencies are resolved, you can build the R package by using:

conda-build .

Now you can install your newly built package in your conda environment by using the use-local flag:

conda install --use-local r-janitor

The remaining optional sections show you how to make R packages for other R versions and other architectures, and how to upload them to your Anaconda.org account ๐Ÿฆ‹

โญ Optional---Building for a different R version โญ

By default, conda-build creates packages for the version of R installed in the root environment. To build packages for other versions of R, you use the --R flag followed by a version.

For example, to explicitly build a version of the fansi package for R 3.6.1, use:

conda-build --R 3.6.1 r-fansi

Notice that the file printed at the end of the conda-build output has changed to reflect the requested version of R. Conda install will look in the package directory for the file that matches your current R version.

Example file path:

/Users/jsmith/anaconda3/conda-bld/osx-64/r-fansi-0.4.0-r353h46e59ec_0.tar.bz2
Note: your path and filename will vary depending on your installation and operating system. Save the path and filename info for the next task ๐Ÿ™ˆ

๐Ÿ“ Optional---Uploading packages to Anaconda.org ๐Ÿ“

Anaconda.org is a repository for public or private packages. Uploading to Anaconda.org lets you easily install your package in any environment with just the conda install command, instead of manually copying or moving the tarball file from one place to another. You can choose to make your files public or private ๐Ÿ’–

For more info about Anaconda.org, see the Anaconda.org documentation <http://docs.anaconda.org/>.

  1. Create a free Anaconda.org account and write down your new Anaconda.org username and password.
  2. Run conda install anaconda-client and enter your Anaconda.org username and password.
  3. Log into your Anaconda.org account from your terminal with the command anaconda login.

Now you can upload the new local packages to Anaconda.org.

anaconda upload /Users/jsmith/anaconda3/conda-bld/osx-64/r-fansi-0.4.0-r353h46e59ec_0.tar.bz2
Note: change your path and filename to the exact path and filename you saved in Optional---Building for a different R version. Your path and filename will vary depending on your installation and operating system. If you created packages for multiple versions of R, you must use the anaconda upload command to upload each one ๐Ÿ˜ค Tip: if you wanna always automatically upload a successful build to Anaconda.org, run: conda config --set anaconda_upload yes ๐Ÿš€

You can log out of your Anaconda.org account with the command:

anaconda logout

More information

For more options, see the full conda skeleton command documentation <>.


๐Ÿฆ‹ Recipes ๐Ÿฆ‹

Review recipe concepts <> for more info about conda-build recipes.

๐Ÿ‘‘ Sample recipes ๐Ÿ‘‘

Conda gives you the flexibility to build things that aren't Python-related, iconic behavior honestly. The first 2 sample recipes, boost and libtiff, are examples of non-Python libraries โ€” meaning they don't require Python to run or build ๐Ÿ’…

gensim runs on Python 2, and literally all of the others work on both Python 2 and Python 3. Versatile queens ๐Ÿ‘‘


๐Ÿ› Debugging conda recipes

Okay bestie, real talk: you will basically never get a recipe exactly right on the first try. That's not a you problem, that's just how it is ๐Ÿ˜ญ Something about the build will be wrong and the build will break. Maybe you only clock a problem during tests, but you need more info than what the tests running inside conda-build handed you. So conda-build 3.17.0 said "here's a gift" and added the subcommand conda debug, which exists specifically to make recipe debugging less of a nightmare ๐Ÿซถ

So like, what is debugging fundamentally? It's getting into โ€” or recreating โ€” the environment and the set of shell environment variables that conda-build makes during its build or test processes. And ngl, this has been possible for a very long time: you could watch the build output, figure out where your build's files landed, navigate there, and finally activate the right environment(s). And then probably also set some environment variables by hand like it's 2009 ๐Ÿ™ˆ

What conda debug does is the glow-up: it creates the environments for you and hands you a single command line you can copy/paste to enter a debugging environment. Main character energy, honestly โœจ

Usage

The conda debug command accepts 1 of 2 kinds of inputs: a recipe folder or a path to a built package.

If you hand it a path to a recipe folder, conda debug:

  • creates the build and host environments
  • provisions any source code that your recipe specifies
  • leaves the build-time scripts in the work folder for you

When it's done, conda debug prints something like this:

################################################################################
Build and/or host environments created for debugging.  To enter a debugging environment:

cd /Users/UserName/miniconda3/conda-bld/debug_1542385789430/work && source /Users/UserName/miniconda3/conda-bld/debug_1542385789430/work/build_env_setup.sh

To run your build, you might want to start with running the conda_build.sh file.
################################################################################

If you hand it a path to a built package, conda debug:

  • creates the test environment
  • prepares any test files that the recipe specified

And when that's done, conda debug prints something like this:

################################################################################
Test environment created for debugging.  To enter a debugging environment:

cd /Users/UserName/miniconda3/conda-bld/conda-build_1542302975704/work && source /Users/UserName/miniconda3/conda-bld/conda-build_1542302975704/work/build_env_setup.sh

To run your tests, you might want to start with running the conda_test_runner.sh file.
################################################################################

Next steps

So given that output above, you can now enter an environment to start debugging. Copy paste from your terminal and go, bestie:

cd /Users/UserName/miniconda3/conda-bld/debug_1542385789430/work && source /Users/UserName/miniconda3/conda-bld/debug_1542385789430/work/build_env_setup.sh

And this is where you'll hopefully already know which build commands you wanna run to help you debug ๐Ÿงš Every build is different so your experience will vary, no cap. But if you have no idea at all, you could probably start by running the appropriate build or test script, as mentioned in the output.

โš ๏ธ But if you do that, remember: these scripts might be written to exit on error, which may close your shell session ๐Ÿ’€ So it may be wise to only run these scripts in an explicit subshell:
bash conda_build.sh
bash conda_test_runner.sh

Complications with multiple outputs

Multiple outputs effectively give the recipe many build phases to consider. The --output-id argument is the mechanism for specifying which of these should be used to create the debug envs and scripts ๐Ÿ‘‘

The --output-id argument accepts an fnmatch pattern. You can match any part of the output filenames. This really only works for conda packages, not other output types like wheels, because conda-build can't currently predict their filenames without actually carrying out a build ๐Ÿ˜ญ

For example, our NumPy recipe (https://github.com/AnacondaRecipes/numpy-feedstock/blob/master/recipe/meta.yaml) has multiple outputs. If we wanted to debug the NumPy-base output, we'd specify it with a command like:

conda debug numpy-feedstock --output-id="numpy-base*"

If you have a matrix build, you may need to be more specific:

Specified --output-id matches more than one output (['/Users/msarahan/miniconda3/conda-bld/debug_1542387301945/osx-64/numpy-base-1.14.6-py27h1a60bec_4.tar.bz2', '/Users/msarahan/miniconda3/conda-bld/debug_1542387301945/osx-64/numpy-base-1.14.6-py27h8a80b8c_4.tar.bz2', '/Users/msarahan/miniconda3/conda-bld/debug_1542387301945/osx-64/numpy-base-1.14.6-py36h1a60bec_4.tar.bz2', '/Users/msarahan/miniconda3/conda-bld/debug_1542387301945/osx-64/numpy-base-1.14.6-py36h8a80b8c_4.tar.bz2', '/Users/msarahan/miniconda3/conda-bld/debug_1542387301945/osx-64/numpy-base-1.14.6-py37h1a60bec_4.tar.bz2', '/Users/msarahan/miniconda3/conda-bld/debug_1542387301945/osx-64/numpy-base-1.14.6-py37h8a80b8c_4.tar.bz2']).  Please refine your output id so that only a single output is found.

You could either reduce your matrix by changing your conda_build_config.yaml, or by making a simpler one and passing it on the CLI, or by using the CLI to reduce it:

conda debug numpy-feedstock --output-id="numpy-base*" --python=3.6 --variants="{blas_impl: openblas}"
Specified --output-id matches more than one output (['/Users/UserName/miniconda3/conda-bld/debug_1542387443190/osx-64/numpy-base-1.14.6-py36h28eea48_4.tar.bz2', '/Users/UserName/miniconda3/conda-bld/debug_1542387443190/osx-64/numpy-base-1.14.6-py36ha711998_4.tar.bz2']).  Please refine your output id so that only a single output is found.

However โ€” and this is the annoying part ๐Ÿ˜ญ โ€” this is still not enough, because our matrix includes two BLAS implementations: MKL and OpenBLAS.

So, further reduction:

conda debug numpy-feedstock --output-id="numpy-base*" --python=3.6 --variants="{blas_impl: 'openblas'}"

Cleanup

Debugging folders are named in a way that the conda build purge command will find and clean up ๐Ÿงน But if you use the -p/--path CLI argument, conda-build will not detect these and you'll need to manually clean up yourself. Also, conda build purge-all will remove previously built packages too โœจ

Quirks

You can specify where you want the root of your debugging stuff to go with the -p/--path CLI argument. The way this works is that conda-build treats that as its "croot" where packages get cached as necessary, and potentially indexed too. When you use the --path argument, you may see folders like osx-64 or other platform subdirs in the path you specify. It is safe to remove them or ignore them โ€” don't stress, bestie ๐Ÿซถ


๐ŸŒˆ Environment variables

Dynamic behavior based on state of build process

There are times when you may want to process a single file in different ways at more than 1 step in the render-build-test flow of conda-build. So conda-build sets the CONDA_BUILD_STATE environment variable during each of these phases ๐Ÿ‘‘ The possible values are:

  • RENDER โ€” Set during evaluation of the meta.yaml file.
  • BUILD โ€” Set during processing of the bld.bat or build.sh script files.
  • TEST โ€” Set during the running of any run_test scripts, which also includes any commands defined in meta.yaml in the test/commands section.

And the plot twist: the CONDA_BUILD_STATE variable is undefined outside of these locations ๐Ÿ’€

Environment variables set during the build process

During the build process, the following environment variables are set โ€” on Windows with bld.bat, and on macOS and Linux with build.sh.

By default, these are the only variables available to your build script. Unless otherwise noted, no variables are inherited from the shell environment in which you invoke conda-build. And if you wanna override this behavior, go look at Inherited environment variables ๐Ÿ‘€

Note ๐Ÿ’– โ€” for configuration options, including package format settings, see Configuration.

okay bestie, here's the full lineup of env vars conda-build hands you during a build. every single one, no skips, fr fr ๐Ÿซถ

  • ARCH โ€” either 32 or 64, telling you whether the build is 32-bit or 64-bit. The value depends on the ARCH environment variable and defaults to the architecture the interpreter running conda was compiled with. ๐Ÿ’…
  • BUILD_PREFIX โ€” the build prefix where command line tools are installed.
  • CMAKE_GENERATOR โ€” the CMake generator string for the current build environment. On Linux systems this is always Unix Makefiles. On Windows, it's generated according to the Visual Studio version activated at build time, for example Visual Studio 9 2008 Win64. ๐ŸชŸ
  • CONDA_BUILD=1 โ€” always set. periodt.
  • CPU_COUNT โ€” the number of CPUs on the system, as reported by multiprocessing.cpu_count(). ๐Ÿ‘‘
  • SHLIB_EXT โ€” the shared library extension.
  • DIRTY โ€” set to 1 if the --dirty flag is passed to the conda-build command. May be used to skip parts of a build script conditionally for faster iteration time when developing recipes. For example, downloads, extraction and other things that need not be repeated. lowkey a lifesaver for dev loops โœจ
  • HTTP_PROXY โ€” inherited from your shell environment.
  • HTTPS_PROXY โ€” inherited from your shell environment.
  • LANG โ€” inherited from your shell environment.
  • MAKEFLAGS โ€” inherited from your shell environment. May be used to set additional arguments to make, such as -j2, which uses 2 CPU cores to build your recipe. ๐Ÿ”ฅ
  • PY_VER โ€” Python version building against. Set with the --python argument or with the CONDA_PY environment variable.
  • NPY_VER โ€” NumPy version to build against. Set with the --numpy argument or with the CONDA_NPY environment variable.
  • PATH โ€” inherited from your shell environment and augmented with $PREFIX/bin.
  • PREFIX โ€” host prefix to which the build script should install.
  • PKG_BUILDNUM โ€” build number of the package being built.
  • PKG_NAME โ€” name of the package being built.
  • PKG_VERSION โ€” version of the package being built.
  • PKG_BUILD_STRING โ€” complete build string of the package being built, including hash. EXAMPLE: py27h21422ab_0. Conda-build 3.0+.
  • PKG_HASH โ€” hash of the package being built, without leading h. EXAMPLE: 21422ab. Conda-build 3.0+. ๐ŸŽ€
  • PYTHON โ€” path to the Python executable in the host prefix. Python is installed only in the host prefix when it is listed as a host requirement.
  • PY3K โ€” 1 when Python 3 is installed in the host prefix, otherwise 0.
  • R โ€” path to the R executable in the host prefix. R is only installed in the host prefix when it is listed as a build requirement.
  • RECIPE_DIR โ€” directory of the recipe.
  • SP_DIR โ€” Python's site-packages location. ๐ŸŒธ
  • SRC_DIR โ€” path to where source is

okay bestie we're still deep in the environment-variables lore and honestly? iconic behavior from conda-build, it just hands you a whole lil toolkit ๐Ÿ’…

  • (finishing the row from right before this one ๐Ÿ’–) โ€” unpacked or cloned. If the source file is not a recognized file type---zip, tar, tar.bz2, or tar.xz---this is a directory containing a copy of the source file.
  • STDLIB_DIR โ€” where the Python standard library lives. that's it, that's the whole vibe ๐Ÿ“š
  • build_platform โ€” the native subdir of the conda executable. literally just the subdir, no notes.

โœจ WINDOWS-ONLY MOMENT โœจ

so real talk: Unix-style packages on Windows โ€” which are usually statically linked to executables โ€” get built in a special Library directory under the host prefix. The env vars in the next lil list are only defined on Windows, no cap. ๐ŸชŸ

  • CYGWIN_PREFIX โ€” same as PREFIX, but as a Unix-style path, such as /cygdrive/c/path/to/prefix.
  • LIBRARY_BIN โ€” %PREFIX%\Library\bin.
  • LIBRARY_INC โ€” %PREFIX%\Library\include.
  • LIBRARY_LIB โ€” %PREFIX%\Library\lib.
  • LIBRARY_PREFIX โ€” %PREFIX%\Library.
  • SCRIPTS โ€” %PREFIX%\Scripts.
  • VS_MAJOR โ€” the major version number of the Visual Studio version activated within the build, such as 9.
  • VS_VERSION โ€” the version number of the Visual Studio version activated within the build, such as 9.0.
  • VS_YEAR โ€” the release year of the Visual Studio version activated within the build, such as 2008.

โœจ macOS + LINUX ONLY โœจ

  • HOME โ€” the standard $HOME environment variable. yes bestie, the classic ๐Ÿ 
  • PKG_CONFIG_PATH โ€” path to the pkgconfig directory.

โœจ macOS ONLY, WE'RE BEING EXCLUSIVE โœจ

  • CFLAGS โ€” the -arch flag.
  • CXXFLAGS โ€” same as CFLAGS.
  • LDFLAGS โ€” same as CFLAGS.
  • MACOSX_DEPLOYMENT_TARGET โ€” same as the Anaconda Python macOS deployment target. Currently 10.9.
  • OSX_ARCH โ€” i386 or x86_64, depending on the Python build. pick your fighter fr fr
๐Ÿซถ and yes, every single one of those is verbatim, we do NOT round the numbers here, 10.9 stays 10.9, periodt.

Okay so the env vars in this next table are Linux-only, bestie โ€” they literally only exist on Linux. And you've got three ways to set them: straight from your shell environment, from variant configuration (like in conda_build_config.yaml), or just let them fall back to their default values. Pick your fighter. ๐Ÿ’…

  • BUILD โ€” the GNU triplet that says what your build target is, like x86_64-conda_cos6-linux-gnu or aarch64-conda_cos7-linux-gnu. The distribution part of that (think cos6, cos7, el8) is customizable โ€” you do it by setting the cdt_name variable over in variant configuration. Defaults are cos6 for most architectures, and cos7 for powerpc, aarch64, and s390x. And heads up: if BUILD and cdt_name are both set, BUILD wins. No tiebreakers, no discussion. ๐Ÿ‘‘
  • CFLAGS โ€” your C compiler flags. If it's set in the environment or in variant configuration it gets inherited, otherwise it's just empty.
  • CXXFLAGS โ€” same energy but for C++ compiler flags. Inherited from the environment or variant configuration if set, otherwise empty.
  • DEJAGNU โ€” configuration for the DejaGnu test framework. Inherited from the environment or variant configuration if set, otherwise empty.
  • DISPLAY โ€” the X11 display variable. Inherited from the environment or variant configuration if set, otherwise empty.
  • LD_RUN_PATH โ€” the runtime library search path. Defaults to $PREFIX/lib.
  • LDFLAGS โ€” linker flags. Inherited from the environment or variant configuration if set, otherwise empty.
  • QEMU_LD_PREFIX โ€” the QEMU library prefix, used for cross-compilation. Inherited from the environment or variant configuration if set, otherwise empty.
  • QEMU_UNAME โ€” QEMU uname information, also for cross-compilation. Inherited from the environment or variant configuration if set, otherwise empty.

โœจ Git environment variables โœจ

Now this set only shows up when your source is a git repository โ€” and by that I mean you specified the source with either git_url or path. Slay. ๐ŸŒธ

  • GIT_BUILD_STR โ€” a string that joins GIT_DESCRIBE_NUMBER and GIT_DESCRIBE_HASH together with an underscore.
  • GIT_DESCRIBE_HASH โ€” the current commit's short-hash, exactly as it's displayed by git describe --tags.
  • GIT_DESCRIBE_NUMBER โ€” a string denoting how many commits have happened since the most recent tag.
  • GIT_DESCRIBE_TAG โ€” a string denoting the most recent tag from the current commit, based on the output of git describe --tags.
  • GIT_FULL_HASH โ€” a string with the full SHA1 of the current HEAD.

These ones are chef's kiss when you pair them with templated meta.yaml files, because you can set stuff โ€” like the build string โ€” based on whatever state your git repository is in. ๐Ÿฆ‹


๐ŸŒˆ Mercurial environment variables ๐ŸŒˆ

And these appear when your source is a mercurial repository. Different VCS, same iconic energy. ๐Ÿ’œ

  • HG_BRANCH โ€” a string denoting the presently active branch.
  • HG_BUILD_STR โ€” a string that joins HG_NUM_ID and HG_SHORT_ID together with an underscore.
  • HG_LATEST_TAG โ€” a string denoting the most recent tag from the current commit.
  • HG_LATEST_TAG_DISTANCE โ€” a string denoting the number of commits since the most recent tag.
  • HG_NUM_ID โ€” a string denoting the revision number.
  • HG_SHORT_ID โ€” a string denoting the hash of the commit.

๐ŸŽ€ Inherited environment variables ๐ŸŽ€

Okay so, other than everything we just listed up there, literally nothing gets inherited from the environment you invoke conda-build in. Nothing. Zero. It's giving sealed box. ๐Ÿ“ฆ

But if you want to pull in extra environment variables, you totally can โ€” just add them to meta.yaml:

build:
  script_env:
   - TMPDIR
   - LD_LIBRARY_PATH # [linux]
   - DYLD_LIBRARY_PATH # [osx]

And if an inherited variable isn't actually present in your shell environment? It just stays unassigned โ€” but conda-build will throw a warning at you noting that it has no value assigned. Not me getting called out by a build system ๐Ÿ˜ญ

You can also hard-set values by including = followed by whatever value you want:

build:
  script_env:
   - MY_VAR=some value
Warning: inheriting environment variables can make it difficult for other people to reproduce binaries from source with your recipe. Use this feature with caution, or explicitly set values using the = syntax. Fr fr, be careful with this one. ๐Ÿ™ˆ
lowkey important bestie: if you split your build and test phases with --no-test and --test, you have to make sure the environment variables at build time and test time match. Like, actually match. If they don't, the package hashes can come out different and then your package isn't testable because the hashes differ. It's giving chaos. Don't do that to yourself. ๐Ÿ˜ญ

โœจ Environment variables that affect the build process โœจ

  • CONDA_PY โ€” the Python version used to build the package. Should be 27, 34, 35, 36, or 37.
  • CONDA_NPY โ€” the NumPy version used to build the package, like 19, 110, or 111.
  • CONDA_PREFIX โ€” the path to the conda environment used to build the package, like /path/to/conda/env. Super useful to pass as the environment prefix parameter to various conda tools, usually labeled -p or --prefix.

Environment variables that affect the test process

All of the environment variables above are also set during the test process, except it uses the test prefix instead of the build prefix. Same variables, different prefix. ๐Ÿ’…


๐Ÿงš Using wheel files with conda ๐Ÿงš

So if you have software sitting in a Python wheel file (that's https://pythonwheels.com/) and you wanna use it with conda or install it into a conda environment, there are 3 ways. Let's go.

  1. The best way is to get the source code for the software and build a conda package from the source, not from a wheel. This helps make sure the new package uses other conda packages to satisfy its dependencies. Chef's kiss. ๐Ÿ‘‘
  2. The second best way is to build a conda package from the wheel file. This tells conda more about the files present than a pip install does. It's also less likely than a pip install to cause errors by overwriting (or "clobbering") files. Bonus: building a conda package from the wheel file means any clobbering is more likely to happen at build time and not runtime. Which is a whole vibe improvement.
  3. The third way is to use pip to install a wheel file into a conda environment. Some conda users have used this option safely. But the first 2 ways are still the safest and most reliable. No cap. ๐Ÿซถ

Building a conda package from a wheel file

To build a conda package from a wheel file, install the .whl file in the conda recipe's bld.bat or build.sh file.

You may download the .whl file in the source section of the conda recipe's meta.yaml file.

You may instead put the URL directly in the pip install command.

EXAMPLE: the conda recipe for TensorFlow has a pip install command in build.sh (https://github.com/conda/conda-recipes/blob/a796713805ac8eceed191c0cb475b51f4d00718c/python/tensorflow/build.sh#L7) with the URL of a .whl file. The meta.yaml (https://github.com/conda/conda-recipes/blob/a796713805ac8eceed191c0cb475b51f4d00718c/python/tensorflow/meta.yaml) file does not download or list the .whl file.

โš ๏ธ Note: it is important to pip install only the one desired package. Whenever possible, install dependencies with conda and not pip. Periodt.

You must use the --no-deps option in the pip install command in order to avoid bundling dependencies into your conda package.

If you run pip install without the --no-deps option, pip will often install dependencies in your conda recipe, and those dependencies will become part of your package. That wastes space in the package and increases the risk of file overlap, file clobbering, and broken packages. ๐Ÿ’€


๐Ÿ“š Tutorials

The tutorials (<>) will guide you through how to build conda packages โ€” whether you're creating a package with compilers, using conda skeleton, creating from scratch, or building R packages using skeleton CRAN. It's giving curriculum. โœจ

๐Ÿ“ Recipes

Conda-build uses recipes (<>) to create conda packages. We have guides on debugging conda recipes, sample recipes for you to use, and information on how to build a package without a recipe.

๐ŸŒˆ Environment variables

Use our environment variables (<>) guide to understand which environment variables are available, set, and inherited, and how they affect different processes.

๐Ÿฆ‹ Wheel files

The user guide includes information about wheel files (<>) and how to build conda packages from them.


๐Ÿ‘‘ RESOURCES ๐Ÿ‘‘

These resources will help you accomplish more using conda-build. We provide information on topics including build scripts, build variants, making packages relocatable, and defining metadata in the meta.yaml. We also provide guidelines and a template for submitting your own documentation. So much main character energy in one section. ๐ŸŽ€

๐Ÿ”ฅ Build scripts (build.sh, bld.bat)

The build.sh file is the build script for Linux and macOS and bld.bat is the build script for Windows. These scripts contain the logic that carries out your build steps. Traditionally it has also included install steps. With the traditional one-package-per-recipe way of doing things, anything that your build script copies into the $PREFIX or %PREFIX% folder will be included in your output package. For example, this build.sh:

mkdir -p $PREFIX/bin
cp $RECIPE_DIR/my_script_with_recipe.sh $PREFIX/bin/super-cool-script.sh

If you don't care about deploying your package with pip on PyPI, this can save you a lot of time in figuring out the proper way to include additional files with setup.py. ๐Ÿซถ

There are many environment variables defined for you to use in build.sh and bld.bat. Please see Environment variables (#env-vars) for more information.

As of conda-build 2.1, you can also define multiple output packages. Each package has its own script or list of files to include. The rules for these outputs are documented at Outputs section (#package-outputs). When any output is defined, this overrides the default behavior of bundling anything in $PREFIX. So to output multiple packages from a single recipe, remove any installation steps from build.sh or bld.bat and do them instead in your install script(s) for each output.

build.sh and bld.bat are optional. You can instead use the build/script key in your meta.yaml, with each value being either a string command or a list of string commands. Any commands you put there must be able to run on every platform for which you build. For example, you can't use the cp command because cmd.exe won't understand it in Windows. Not me learning that the hard way. ๐Ÿ™ˆ

build.sh is run with bash and bld.bat is run with cmd.exe.

There is some development towards the ability to use bash scripts in Windows, but this is not currently supported. You may write your script as a .sh file, and then call it in your bld.bat file, but there is no way to directly run build.sh on Windows. The conda recipe at https://github.com/AnacondaRecipes/conda-feedstock/tree/master/recipe is an example of this method.

๐Ÿ’œ Anaconda compiler tools

Anaconda 5.0 switched from OS-provided compiler tools to our own toolsets. This allows improved compiler capabilities, including better security and performance. This page describes how to use these tools and enable these benefits.

Compiler packages

Before Anaconda 5.0, compilers were installed using system tools such as XCode or yum install gcc. Now there are conda packages for Linux and macOS compilers. Unlike the previous GCC 4.8.5 packages that included GCC, g++, and GFortran all in the same package, these conda packages are split into separate compilers:

macOS:

  • clang_osx-64.
  • clangxx_osx-64.
  • gfortran_osx-64.

Linux:

  • gcc_linux-64.
  • gxx_linux-64.
  • gfortran_linux-64.

A compiler's "build platform" is the platform where the compiler runs and builds the code.

A compiler's "host platform" is the platform where the built code will finally be hosted and run.

Notice that all of these package names end in a platform identifier which specifies the host platform. All compiler packages are specific to both the build platform and the host platform. Double duty, iconic behavior. ๐Ÿ‘‘

Using the compiler packages

The compiler packages can be installed with conda. Because they are designed with (pseudo) cross-compiling in mind, all of the executables in a compiler package are "prefixed." Instead of gcc, the executable name of the compiler you use will be something like x86_64-conda_cos6-linux-gnu-gcc. These full compiler names are shown in the build logs, recording the host platform and helping prevent the common mistake of using the wrong compiler.

Many build tools such as make and CMake search by default for a compiler named simply gcc, so we set environment variables to point these tools to the correct compiler.

We set these variables in conda activate.d scripts, so any environment in which you will use the compilers must first be activated so the scripts will run. Conda-build does this activation for you using activation hooks installed with the compiler packages in CONDA_PREFIX/etc/conda/activate.d, so no additional effort is necessary. โœจ

You can activate the root environment with the command conda activate root.

macOS SDK

The macOS compilers require the macOS 10.9 SDK or above. The SDK license prevents it from being bundled in the conda package. We know of 2 current sources for the macOS SDKs:

We usually install the 10.10 SDK at /opt/MacOSX10.10.sdk but you may install it anywhere. Edit your conda_build_config.yaml file to point to it, like this:

CONDA_BUILD_SYSROOT:
  - /opt/MacOSX10.10.sdk        # [osx]

At Anaconda, we have this configuration setting in a centralized conda_build_config.yaml at the root of our recipe repository. Since we run build commands from that location, the file and the setting are used for all recipes. The conda_build_config.yaml search order is described further at Creating conda-build variant config files (#conda-build-variant-config-files).

Okay so for macOS build scripts bestie, you GOTTA use these two variables: MACOSX_DEPLOYMENT_TARGET and CONDA_BUILD_SYSROOT ๐Ÿ’– conda-build sets both of them for you (peep Environment variables <#env-vars> iykyk). Your job is to translate them into the correct compiler arguments. For Clang that looks like:

clang .. -isysroot ${CONDA_BUILD_SYSROOT} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} ..

Most build tools โ€” think CMake and distutils (setuptools) โ€” will slurp up MACOSX_DEPLOYMENT_TARGET all on their own, no effort required โœจ But CONDA_BUILD_SYSROOT? Nah, you have to pass that one explicitly, no cap. For CMake that's done with the option -DCMAKE_OSX_SYSROOT=${CONDA_BUILD_SYSROOT}. And when you're building Python extensions with distutils, you should always extend CFLAGS before you call setup.py:

export CFLAGS="${CFLAGS} -i sysroot ${CONDA_BUILD_SYSROOT}"

And when it's C++ extensions with Cython, CXXFLAGS needs the same treatment. Same energy, different variable ๐ŸŽ€


๐Ÿ”„ Backward compatibility

Some users want the shiny latest Anaconda packages but are NOT ready to switch to the Anaconda compilers yet โ€” totally valid, we support that ๐Ÿ’… To make it happen, the latest Python package builds ship with a default _sysconfigdata file. That file sets the compilers your system already provides โ€” like gcc and g++ โ€” as the default compilers. Boom, legacy recipes keep working, nobody's build breaks, iconic behavior honestly.

Python packages also include an alternative _sysconfigdata file that sets the Anaconda compilers as the default ones instead. Fun fact: the Anaconda Python executable itself is made with those very Anaconda compilers ๐ŸŒธ

The compiler packages set the environment variable _PYTHON_SYSCONFIGDATA_NAME, which is how Python knows which _sysconfigdata file to reach for. And when does that get set? At activation time, using the activation hooks described above. Chef's kiss ๐ŸคŒ

Heads up tho: the new _sysconfigdata customization system is only present in recent versions of the Python package. conda-build automatically tries to use the latest Python version available in the currently configured channels โ€” which normally means it grabs the latest from the default channel ๐Ÿ‘‘ But if you're using something other than conda-build while working with the new compilers, conda does not automatically update Python. So make sure you've got the correct _sysconfigdata files by updating your Python package manually. Don't get caught lacking ๐Ÿ™ˆ


๐Ÿ› ๏ธ Anaconda compilers and conda-build 3

The Anaconda 5.0 compilers and conda-build 3 are literally designed to work together. Soulmates fr fr ๐Ÿ’ž

conda-build 3 defines a special jinja2 function, compiler(), so you can specify compiler packages dynamically across many platforms without losing your mind. The compiler function takes at least 1 argument: the language of the compiler you want to use ๐ŸŒˆ

requirements:
  build:
    - {{ compiler('c') }}

Now โ€” "cross-capable" recipes ๐Ÿ‘€ These are recipes you can use to make packages where the host platform is different from the build platform (the one where conda-build actually runs). To write cross-capable recipes you may also need the host section inside the requirements section. In this example we set host to zlib, which tells conda-build to use the zlib sitting in the conda environment and not the system zlib. That's what makes sure conda-build uses the zlib for the host platform and not the zlib for the build platform. Precision ๐Ÿ’…

requirements:
  build:
    - {{ compiler('c') }}
  host:
    - zlib

General rule of thumb bestie: the build section should include compilers and other build tools, and the host section should include basically everything else โ€” shared libraries, Python, and Python libraries. Write that down ๐Ÿ“


๐ŸŒ‰ An aside on CMake and sysroots

Anaconda's compilers for Linux are built with something called crosstool-ng. They include not only GCC, but also a "sysroot" with glibc, plus the rest of the toolchain (binutils) ๐Ÿงฐ

Ordinarily the sysroot is something your system provides, and it's the thing that establishes the libc compatibility bound for your compiled code. Any compilation that uses a sysroot other than the system sysroot is said to be "cross-compiling." And when the target OS and the build OS are the same? That's a "pseudo-cross-compiler." Which is exactly the situation for normal builds with Anaconda's compilers on Linux ๐Ÿง

Unfortunately ๐Ÿ˜ญ some software tools do not handle sysroots in intuitive ways. CMake is especially bad about this. Even though the compiler itself understands its own sysroot, CMake insists on ignoring that. Rude. We've filed issues at:

Also this Stack Overflow issue has some more info: <https://stackoverflow.com/questions/36195791/cmake-missing-sysroot-when-cross-compiling>

So to teach CMake about the sysroot you must do additional work, no shortcuts. As an example, peep our recipe for libnetcdf at <https://github.com/AnacondaRecipes/libnetcdf-feedstock/tree/master/recipe> ๐Ÿ“

Specifically, you'll need to copy the cross-linux.cmake file that lives there, and reference it in your build.sh file:

CMAKE_PLATFORM_FLAGS+=(-DCMAKE_TOOLCHAIN_FILE="${RECIPE_DIR}/cross-linux.cmake")

cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} \
  ${CMAKE_PLATFORM_FLAGS[@]} \
  ${SRC_DIR}

๐ŸŽจ Customizing the compilers

The compiler packages listed above are tiny little packages โ€” they only include the activation scripts, and they list most of the software they provide as runtime dependencies. Minimalist queen โœจ

This design is intentional: it's meant to make it easy for you to customize your own compiler packages by copying these recipes and changing the flags. Then you edit the conda_build_config.yaml file to specify your own packages. Slay, your build your rules ๐Ÿ’…

We were super careful picking flags that are good, general purpose, secure, and fast. We also used them for all packages in Anaconda Distribution 5.0.0, except for some minor customizations in a few recipes. But when you're changing these flags, remember: choosing the wrong flags can reduce security, reduce performance, and cause incompatibilities.

โš ๏ธ Okay that warning is real, don't skip it. Wrong flags = reduced security, reduced performance, incompatibilities. Respect the flags bestie ๐Ÿ™

With that warning living rent-free in your head, let's look at good ways to customize Clang ๐Ÿ‘‘

  1. Download or fork the code from <https://github.com/anacondarecipes/aggregate>. The Clang package recipe is in the clang folder. The main material is in the llvm-compilers-feedstock folder.
  2. Edit clang/recipe/meta.yaml:
package:
  name: clang_{{ target_platform }}
  version: {{ version }}

The name here does not matter but the output names below do. Conda-build expects any compiler to follow the BASENAME_PLATFORMNAME pattern, so it is important to keep the {{target_platform}} part of the name ๐Ÿซถ

{{ version }} is left as an intentionally undefined jinja2 variable. It is set later in conda_build_config.yaml.

  1. Before any packaging is done, run the build.sh script: <https://github.com/AnacondaRecipes/aggregate/blob/master/clang/build.sh>

In this recipe, values are changed here. Those values are inserted into the activate scripts that are installed later.

#!/bin/bash

CHOST=${macos_machine}

FINAL_CPPFLAGS="-D_FORTIFY_SOURCE=2 -mmacosx-version-min=${macos_min_version}"
FINAL_CFLAGS="-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe"
FINAL_CXXFLAGS="-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0"
# These are the LDFLAGS for when the linker is being called directly, without "-Wl,"
FINAL_LDFLAGS="-pie -headerpad_max_install_names"
# These are the LDFLAGS for when the linker is being driven by a compiler, with "-Wl,"
FINAL_LDFLAGS_CC="-Wl,-pie -Wl,-headerpad_max_install_names"
FINAL_DEBUG_CFLAGS="-Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments"
FINAL_DEBUG_CXXFLAGS="-Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments"
FINAL_DEBUG_FFLAGS="-Og -g -Wall -Wextra -fcheck=all -fbacktrace -fimplicit-none -fvar-tracking-assignments"

find "${RECIPE_DIR}" -name "*activate*.sh" -exec cp {} . \;

find . -name "*activate*.sh" -exec sed -i.bak "s|@CHOST@|${CHOST}|g" "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@CPPFLAGS@|${FINAL_CPPFLAGS}|g"             "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@CFLAGS@|${FINAL_CFLAGS}|g"                 "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@DEBUG_CFLAGS@|${FINAL_DEBUG_CFLAGS}|g"     "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@CXXFLAGS@|${FINAL_CXXFLAGS}|g"             "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@DEBUG_CXXFLAGS@|${FINAL_DEBUG_CXXFLAGS}|g" "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@DEBUG_CXXFLAGS@|${FINAL_DEBUG_CXXFLAGS}|g" "{}" \;
# find . -name "*activate*.sh" -exec sed -i.bak "s|@FFLAGS@|${FINAL_FFLAGS}|g"                 "{}" \;
# find . -name "*activate*.sh" -exec sed -i.bak "s|@DEBUG_FFLAGS@|${FINAL_DEBUG_FFLAGS}|g"     "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@LDFLAGS@|${FINAL_LDFLAGS}|g"               "{}" \;
find . -name "*activate*.sh" -exec sed -i.bak "s|@LDFLAGS_CC@|${FINAL_LDFLAGS_CC}|g"         "{}" \;
find . -name "*activate*.sh.bak" -exec rm "{}" \;
  1. With those changes to the activate scripts in place, it's time to move on to installing things. Look back at the clang folder's meta.yaml. Here's where we change the package name. Notice what comes before the {{ target_platform }} ๐Ÿ‘€
outputs:
  - name: super_duper_clang_{{ target_platform }}
    script: install-clang.sh
    requirements:
      - clang {{ version }}

The script reference here is another place you might add customization. You'll either change the contents of those install scripts or change the scripts that those install scripts are installing ๐Ÿ’…

Note that we make the package clang in the main material agree in version with our output version. This is implicitly the same as the top-level recipe. The clang package sets no environment variables at all, so it may be difficult to use directly ๐Ÿ™ˆ

  1. Let's examine the script install-clang.sh:
#!/bin/bash

set -e -x

CHOST=${macos_machine}

mkdir -p "${PREFIX}"/etc/conda/{de,}activate.d/
cp "${SRC_DIR}"/activate-clang.sh "${PREFIX}"/etc/conda/activate.d/activate_"${PKG_NAME}".sh
cp "${SRC_DIR}"/deactivate-clang.sh "${PREFIX}"/etc/conda/deactivate.d/deactivate_"${PKG_NAME}".sh

pushd "${PREFIX}"/bin
  ln -s clang ${CHOST}-clang
popd

Nothing here is too unusual, promise ๐Ÿงš

Activate scripts are named according to our package name so they won't conflict with other activate scripts. Clean, no drama โœจ

The symlink for Clang is a Clang implementation detail that sets the host platform.

We define macos_machine in aggregate's conda_build_config.yaml: <https://github.com/AnacondaRecipes/aggregate/blob/master/conda_build_config.yaml#L79>

The activate scripts that are being installed? That's where we actually set the environment variables, bestie. And remember โ€” these have been modified by build.sh. ๐Ÿ’…

  1. With any of your desired changes in place, go ahead and build the recipe.

You should end up with a super_duper_clang_osx-64 package. Or, if you're not on macOS and are modifying a different recipe, you should end up with an equivalent package for your platform. Slay. โœจ


๐ŸŒˆ Using your customized compiler package with conda-build 3

Remember the Jinja2 function, {{ compiler('c') }}? Here's where that comes in. Specific keys in conda_build_config.yaml are named for the language argument to that jinja2 function. In your conda_build_config.yaml, add this:

c_compiler:
  - super_duper_clang

Note that we're not adding the target_platform part โ€” that one's separate. You can define that key too, though:

c_compiler:
  - super_duper_clang
target_platform:
  - win-64

With those two keys defined, conda-build will try to use a compiler package named super_duper_clang_win-64. That package needs to exist for your native platform. For example, if you're on macOS, your native platform is osx-64. ๐Ÿ“

The package subdirectory for your native platform is the build platform. The build platform and the target_platform can be the same, and they are the same by default, but they can also be different. When they are different, you're cross-compiling. ๐Ÿฆ‹

If you ever needed a different compiler key for the same language, remember that the language key is arbitrary. For example, we might want different compilers for Python and for R within one ecosystem. On Windows, the Python ecosystem uses the Microsoft Visual C compilers, while the R ecosystem uses the Mingw compilers. iykyk ๐Ÿ’€

Let's start in conda_build_config.yaml:

python_c_compiler:
  - vs2015
r_c_compiler:
  - m2w64-gcc
target_platform:
  - win-64

In Python recipes, you'd have:

requirements:
  build:
    - {{ compiler('python_c') }}

In R recipes, you'd have:

requirements:
  build:
    - {{ compiler('r_c') }}

This example is a little contrived, because the m2w64-gcc_win-64 package is not available. You'd need to create a metapackage m2w64-gcc_win-64 to point at the m2w64-gcc package, which does exist on the msys2 channel on repo.anaconda.com โ€” https://repo.anaconda.com/. ๐Ÿ™ˆ


๐Ÿ’– Expressing the relation between compiler and its standard library

For most languages, certainly for "c" and for "cxx", compiling any given program may create a run-time dependence on symbols from the respective standard library. For example, the standard library for C on linux is generally glibc, and a core component of your operating system. Conda is not able to change or supersede this library (it would be too risky to try to). A similar situation exists on MacOS and on Windows.

Compiler packages usually have two ways to deal with this dependence:

  • assume the package must be there (like glibc on linux).
  • always add a run-time requirement on the respective stdlib (e.g. libcxx on MacOS).

However, even if we assume the package must be there, the information about the glibc version is still a highly relevant piece of information, which is also why it is reflected in the __glibc virtual package โ€” https://docs.conda.io/projects/conda/en/stable/user-guide/tasks/manage-virtual.html. โœจ

For example, newer packages may decide over time to increase the lowest version of glibc that they support. We therefore need a way to express this dependence in a way that conda will be able to understand, so that (in conjunction with the __glibc virtual package) the environment resolver will not consider those packages on machines whose glibc version is too old.

The way to do this is to use the Jinja2 function {{ stdlib('c') }}, which matches {{ compiler('c') }} in as many ways as possible. Let's start again with the conda_build_config.yaml:

c_stdlib:
  - sysroot                     # [linux]
  - macosx_deployment_target    # [osx]
c_stdlib_version:
  - 2.17                        # [linux]
  - 10.13                       # [osx]

In the recipe we would then use:

requirements:
  build:
    - {{ compiler('c') }}
    - {{ stdlib('c') }}

This would then express that the resulting package requires sysroot ==2.17 (corresponds to glibc) on linux and macosx_deployment_target ==10.13 on MacOS in the build environment, respectively. How this translates into a run-time dependence can be defined in the metadata of the respective conda (meta-)package which represents the standard library (i.e. those defined under c_stdlib above). ๐Ÿซถ

In this example, sysroot 2.17 would generate a run-export on __glibc >=2.17 and macosx_deployment_target 10.13 would similarly generate __osx >=10.13. This way, we enable packages to define their own expectations about the standard library in a unified way, and without implicitly depending on some global assumption about what the lower version on a given platform must be.

In principle, this facility would make it possible to also express the dependence on separate stdlib implementations (like musl instead of glibc), or to remove the need to assume that a C++ compiler always needs to add a run-export on the C++ stdlib โ€” it could then be left up to packages themselves whether they need {{ stdlib('cxx') }} or not. ๐Ÿ‘‘


๐ŸŽ€ Anaconda compilers implicitly add RPATH pointing to the conda environment

You might want to use the Anaconda compilers outside of conda-build so that you use the same versions, flags, and configuration, for maximum compatibility with Anaconda packages (but in a case where you want simple tarballs, for example). In this case, there is a gotcha. ๐Ÿ˜ญ

Even if Anaconda compilers are used from outside of conda-build, the GCC specs are customized so that, when linking an executable or a shared library, an RPATH pointing to lib/ inside the current enviroment prefix directory ($CONDA_PREFIX/lib) is added. This is done by changing the link_libgcc: section inside GCC specs file, and this change is done so that LD_LIBRARY_PATH isn't required for basic libraries.

conda-build knows how to make this automatically relocatable, so that this RPATH will be changed to point to the environment where the package is being installed (at installation time, by conda). But if you only pack this binary in a tarball, it will continue containing this hardcoded RPATH to an environment in your machine.

In this case, it is recommended to manually remove the RPATH. Bestie, please actually do it. ๐Ÿ’€

๐ŸŒธ Defining metadata (meta.yaml)

All the metadata in the conda-build recipe is specified in the meta.yaml file. See the example below:

{% set version = "1.1.0" %}

package:
  name: imagesize
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/i/imagesize/imagesize-{{ version }}.tar.gz
  sha256: f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5

build:
  noarch: python
  number: 0
  script: python -m pip install .

requirements:
  host:
    - python
    - pip
  run:
    - python

test:
  imports:
    - imagesize

about:
  home: https://github.com/shibukawa/imagesize_py
  license: MIT
  summary: 'Getting image size from png/jpeg/jpeg2000/gif file'
  description: |
    This module analyzes jpeg/jpeg2000/png/gif image header and
    return image size.
  dev_url: https://github.com/shibukawa/imagesize_py
  doc_url: https://pypi.python.org/pypi/imagesize
  doc_source_url: https://github.com/shibukawa/imagesize_py/blob/master/README.rst

All sections are optional except for package/name and package/version. Periodt.

Headers must appear only once. If they appear multiple times, only the last is remembered. For example, the package: header should appear only once in the file. Don't do it twice, I'm begging. ๐Ÿ™ˆ

๐Ÿงš Package section

Specifies package information. ๐Ÿ’–

โญ Package name

The lower case name of the package. It may contain "-", but no spaces.

package:
  name: bsdiff4

โญ Package version

The version number of the package. Use the PEP-386 verlib conventions. Cannot contain "-". YAML interprets version numbers such as 1.0 as floats, meaning that 0.10 will be the same as 0.1. To avoid this, put the version number in quotes so that it is interpreted as a string. ๐Ÿ’…

package:
  version: "1.1.4"
Note: Post-build versioning โ€” in some cases, you may not know the version, build number, or build string of the package until after it is built. In these cases, you can perform Templating with Jinja or utilize Git environment variables (#git-env) and Inherited environment variables (#inherited-env-vars). ๐Ÿฆ‹

๐ŸŽ€ Source section

Specifies where the source code of the package is coming from. The source may come from a tarball file, git, hg, or svn. It may be a local path and it may contain patches. โœจ

๐Ÿ“ Source from tarball or zip archive

source:
  url: https://pypi.python.org/packages/source/b/bsdiff4/bsdiff4-1.1.4.tar.gz
  md5: 29f6089290505fc1a852e176bd276c43
  sha1: f0a2c9a30073449cfb7d171c57552f3109d93894
  sha224: ebf3e3b54353146ca21128ed6399739663a1256a223f438ed0223845
  sha256: 5a022ff4c1d1de87232b1c70bde50afbb98212fd246be4a867d8737173cf1f8f
  sha384: 23eee6ee2e5d1054780e331857589bfba098255a88ae4edd47102fce676694ce0f543dc5c0d27c51f77cc4546d4e74c0
  sha512: b968c7dc99132252a83b175a96ec75ec842edf9e2494db2c07b419e61a0b1cf6984e7c544452f9ab56aa8581caf966c0f6933fc22a071ccc4fbb5d22b363fe54

If an extracted archive contains only 1 folder at its top level, its contents will be moved 1 level up, so that the extracted package contents sit in the root of the work folder. ๐Ÿซถ

You can also specify multiple URLs for the same source archive. They will be attempted in order, should one fail. No cap.

source:
  url:
    - https://archive.linux.duke.edu/cran/src/contrib/ggblanket_6.0.0.tar.gz
    - https://archive.linux.duke.edu/cran/src/contrib/Archive/ggblanket/ggblanket_6.0.0.tar.gz
  sha256: cd2181fe3d3365eaf36ff8bbbc90ea9d76c56d40e63386b4eefa0e3120ec6665

๐Ÿฆ‹ Source from git

The git_url can also be a relative path to the recipe directory.

source:
  git_url: https://github.com/ilanschnell/bsdiff4.git
  git_rev: 1.1.4 # (Defaults to "HEAD")
  git_depth: 1 # (Defaults to -1/not shallow)

The depth argument is all about being able to do a shallow clone, bestie. A shallow clone means you only pull part of the history from Git. So if you already know you only need the most recent changes, you can just say git_depth: 1, which is wayyy faster than cloning the entire repo. โœจ The catch? Setting it to 1 means that unless the tag is on that exact commit, you won't have that tag when you go to reference it in git_rev (for example). If your git_depth isn't enough to capture the tag in git_rev, you'll hit an error. So in the example above, unless 1.1.4 is literally the very head commit and the one you're grabbing, you may run into an error. ๐Ÿ™ˆ


๐Ÿ’œ Source from hg

source:
  hg_url: ssh://hg@bitbucket.org/ilanschnell/bsdiff4
  hg_tag: 1.1.4

๐Ÿ’œ Source from svn

source:
  svn_url: https://github.com/ilanschnell/bsdiff
  svn_rev: 1.1.4 # (defaults to head)
  svn_ignore_externals: True # (defaults to False)
  svn_username: username  # Optional, if set must also have svn_password
  svn_password: password  # Optional, if set must also have svn_username

To get into a restricted SVN repository, you gotta specify both svn_username and svn_password. No solo acts here. ๐Ÿ‘‘

Caution: storing credentials in plaintext carries risks, bestie. ๐Ÿ˜ญ Alternatively, consider using environment variables:
source:
  svn_username: {{ environ["SVN_USERNAME"] }}
  svn_password: {{ environ["SVN_PASSWORD"] }}

๐ŸŒธ Source from a local path

If the path is relative, it's taken relative to the recipe directory. The source gets copied to the work directory before building.

source:
  path: ../src

If your local path is a git or svn repository, you get the corresponding environment variables defined in your build environment. The only practical difference between git_url or hg_url and path as source arguments is that git_url and hg_url would be clones of a repository, while path would be a copy of the repository. Using path lets you build packages with unstaged and uncommitted changes in the working directory. git_url can only build up to the latest commit. periodt.


๐ŸŽ€ Hashes

Conda-build can check the integrity of the provided sources using different hashing algorithms:

  • md5, sha1 and sha256 will check the provided hexdigest against the downloaded archive, prior to extraction.
  • content_md5, content_sha1 and content_sha256 will check the provided hexdigest against the contents of the (extracted) directory. content_hash_skip can take a list of relative files and directories to be ignored during the check (e.g. super useful to ignore the .git/ directory when git_url is used to clone a repository).

๐ŸŽ€ Patches

Patches may optionally be applied to the source.

source:
  #[source information here]
  patches:
    - my.patch # the patch file is expected to be found in the recipe

Conda-build automatically figures out the patch strip level for you. iconic. ๐Ÿ’…


๐ŸŽ€ Destination path

Within conda-build's work directory, you can specify a particular folder to place source into. This feature is new in conda-build 3.0. Conda-build will always drop you into the same folder (build folder/work), but it's up to you whether you want your source extracted into that folder, or nested deeper. This is especially useful when you're dealing with multiple sources, but it can apply to recipes with single sources too.

source:
  #[source information here]
  folder: my-destination/folder

๐Ÿฆ‹ Filename

The filename key is fn. It was formerly required with URL source types. It is not required now.

If the fn key is provided, the file is saved on disk with that name. If the fn key is not provided, the file is saved on disk with a name matching the last part of the URL.

For example, http://www.something.com/myfile.zip has an implicit filename of myfile.zip. Users may change this by manually specifying fn.

source:
  url: http://www.something.com/myfile.zip
  fn: otherfilename.zip

๐Ÿฆ‹ Source from multiple sources

Some software is most easily built by aggregating several pieces. For this, conda-build 3.0 added support for arbitrarily specifying many sources.

The syntax is a list of source dictionaries. Each member of this list follows the same rules as the single source for earlier conda-build versions (listed above). All features for each member are supported. no cap.

Example:

source:
  - url: https://package1.com/a.tar.bz2
    folder: stuff
  - url: https://package1.com/b.tar.bz2
    folder: stuff
  - git_url: https://github.com/conda/conda-build
    folder: conda-build

Here, the two URL tarballs will go into one folder, and the git repo is checked out into its own space. Git will not clone into a non-empty folder.

Note: dashes denote list items in YAML syntax.

๐Ÿ’– Build section

Specifies build information.

Each field that expects a path can also handle a glob pattern. The matching is performed from the top of the build environment, so to match files inside your project you can use a pattern similar to the following one: "**/myproject/**/*.txt". This pattern will match any .txt file found in your project.

Note: the quotation marks ("") are required for patterns that start with a *.

Recursive globbing using ** is supported only in conda-build >= 3.0.


โญ Build number and string

The build number should be incremented for new builds of the same version. The number defaults to 0. The build string cannot contain "-". The string defaults to the default conda-build string plus the build number. When redefining the default string, we strongly recommend following the convention of adding the build number at the end of the string, with a preceding underscore.

build:
  number: 1
  string: abc_h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}

A hash will appear when the package is affected by one or more variables from the conda_build_config.yaml file. The hash is made up from the "used" variables โ€” if anything is used, you have a hash. If you don't use these variables then you won't have a hash. There are a few special cases that do not affect the hash, such as Python and R or anything that already had a place in the build string.

The build hash will be added to the build string if these are true for any dependency:

  • package is an explicit dependency in build, host, or run deps
  • package has a matching entry in conda_build_config.yaml which is a pin to a specific version, not a lower bound
  • that package is not ignored by ignore_version

OR

  • package uses {{ compiler() }} jinja2 function

You can also influence which variables are considered for the hash with:

build:
  force_use_keys:
    - package_1
  force_ignore_keys:
    - package_2

This will ensure that the value of package_2 will not be considered for the hash, and package_1 will be, regardless of what conda-build discovers is used by its inspection.

This may be useful to further split complex multi-output builds, to ensure each package is built, or to ensure the right package hash when using more complex templating or scripting. ๐Ÿซถ


โญ Python entry points

The following example creates a Python entry point named "bsdiff4" that calls bsdiff4.cli.main_bsdiff4().

build:
  entry_points:
    - bsdiff4 = bsdiff4.cli:main_bsdiff4
    - bspatch4 = bsdiff4.cli:main_bspatch4

โญ Python.app

If osx_is_app is set, entry points use python.app instead of Python in macOS. The default is False.

build:
  osx_is_app: True

โญ python_site_packages_path

Packages with a name of python can optionally specify the location of the site-packages directory relative to the root of the environment with python_site_packages_path. This should only be used in python packages and only when the path is not the CPython default.

build:
  python_site_packages_path: lib/python3.13t/site-packages

๐ŸŒˆ Track features

Adding track_features to one or more of the options will cause conda to de-prioritize it or โ€œweigh it down.โ€ The lowest priority package is the one that would cause the most track_features to be activated in the environment. The default package among many variants is the one that would cause the least track_features to be activated.

No two packages in a given subdir should ever have the same track_feature.

build:
  track_features:
    - feature2

๐ŸŒˆ Preserve Python egg directory

This is needed for some packages that use features specific to setuptools. The default is False.

build:
  preserve_egg_dir: True

๐ŸŒˆ Skip compiling some .py files into .pyc files

Some packages ship .py files that cannot be compiled, such as those that contain templates. Some packages also ship .py files that should not be compiled yet, because the Python interpreter that will be used is not known at build time. In these cases, conda-build can skip attempting to compile these files. The patterns used in this section do not need the ** to handle recursive paths.

build:
  skip_compile_pyc:
    - "*/templates/*.py"          # These should not (and cannot) be compiled
    - "*/share/plugins/gdb/*.py"  # The python embedded into gdb is unknown

A list of globs for files that should always be copied and never soft linked or hard linked.

build:
  no_link:
    - bin/*.py  # Don't link any .py files in bin/

๐Ÿ“ Script

Used instead of build.sh or bld.bat. For short build scripts, this can be more convenient. You may need to use selectors to use different scripts for different platforms.

build:
  script: python setup.py install --single-version-externally-managed --record=record.txt

๐Ÿ“ RPATHs

Set which RPATHs are used when making executables relocatable on Linux. This is a Linux feature that is ignored on other systems. The default is lib/.

build:
  rpaths:
    - lib/
    - lib/R/lib/

๐Ÿงš Force files

Force files to always be included, even if they are already in the environment from the build dependencies. This may be needed, for example, to create a recipe for conda itself.

build:
  always_include_files:
    - bin/file1
    - bin/file2

๐Ÿงš Relocation

Advanced features, bestie. You can use the following 4 keys to control relocatability files from the build environment to the installation environment:

  • binary_relocation.
  • has_prefix_files.
  • binary_has_prefix_files.
  • ignore_prefix_files.

For more information, see Making packages relocatable <>.

๐ŸŽ€ Binary relocation ๐ŸŽ€

Whether binary files should be made relocatable using install_name_tool on macOS or patchelf on Linux. The default is True, bestie. It also accepts False, which means no relocation for any files, or a list of files, which means relocation only for the files you listed. ๐Ÿ’…

build:
  binary_relocation: False

๐Ÿ” Detect binary files with prefix ๐Ÿ”

Binary files may contain the build prefix and need it replaced with the install prefix at installation time. Conda can automatically identify and register such files. The default is True. โœจ

Note: the default changed from False to True back in conda build 2.0, okay? Setting this to False means that binary relocation---RPATH---replacement will still be done, but hard-coded prefixes in binaries will not be replaced. Prefixes in text files will still be replaced tho. ๐Ÿ’–
build:
  detect_binary_files_with_prefix: False

Windows handles binary prefix replacement very differently than Unix-like systems such as macOS and Linux. At this time, we are unaware of any executable or library that uses hardcoded embedded paths for locating other libraries or program data on Windows. Instead, Windows follows DLL search path rules <https://msdn.microsoft.com/en-us/library/7d83bc18.aspx> or more natively supports relocatability using relative paths. Because of this, conda ignores most prefixes. However, pip creates executables for Python entry points that do use embedded paths on Windows. Conda-build thus detects prefixes in all files and records them by default. If you are getting errors about path length on Windows, you should try to disable detect_binary_files_with_prefix. Newer versions of Conda, such as recent 4.2.x series releases and up, should have no problems here, but earlier versions of conda do erroneously try to apply any binary prefix replacement. ๐Ÿ˜ญ


๐Ÿ’€ Binary has prefix files ๐Ÿ’€

By default, conda-build tries to detect prefixes in all files. You may also elect to specify files with binary prefixes individually. This allows you to specify the type of file as binary, when it may be incorrectly detected as text for some reason. Binary files are those containing NULL bytes. ๐Ÿ™ˆ

build:
  binary_has_prefix_files:
    - bin/binaryfile1
    - lib/binaryfile2

๐Ÿ“ Text files with prefix files ๐Ÿ“

Text files---files containing no NULL bytes---may contain the build prefix and need it replaced with the install prefix at installation time. Conda will automatically register such files. Binary files that contain the build prefix are generally handled differently---see Binary has prefix files---but there may be cases where such a binary file needs to be treated as an ordinary text file, in which case they need to be identified. ๐ŸŒธ

build:
  has_prefix_files:
    - bin/file1
    - lib/file2

๐Ÿšซ Ignore prefix files ๐Ÿšซ

Used to exclude some or all of the files in the build recipe from the list of files that have the build prefix replaced with the install prefix. ๐Ÿ’…

To ignore all files in the build recipe, use:

build:
  ignore_prefix_files: True

To specify individual filenames, use:

build:
  ignore_prefix_files:
    - file1

This setting is independent of RPATH replacement. Use the Detect binary files with prefix setting to control that behavior. ๐Ÿ‘‘


โญ๏ธ Skipping builds โญ๏ธ

Specifies whether conda-build should skip the build of this recipe. Particularly useful for defining recipes that are platform specific. The default is False. โœจ

build:
  skip: True  # [not win]

๐ŸŒˆ Architecture independent packages ๐ŸŒˆ

Allows you to specify "no architecture" when building a package, thus making it compatible with all platforms and architectures. Noarch packages can be installed on any platform. iconic

Starting with conda-build 2.1, and conda 4.3, there is a new syntax that supports different languages. Assigning the noarch key as generic tells conda to not try any manipulation of the contents. ๐Ÿ’–

build:
  noarch: generic

noarch: generic is most useful for packages such as static javascript assets and source archives. For pure Python packages that can run on any Python version, you can use the noarch: python value instead:

build:
  noarch: python

The legacy syntax for noarch_python is still valid, and should be used when you need to be certain that your package will be installable where conda 4.3 is not yet available. All other forms of noarch packages require conda >=4.3 to install. โญ

build:
  noarch_python: True
Warning: At the time of this writing, noarch packages should not make use of preprocess-selectors: noarch packages are built with the directives which evaluate to True in the platform it was built, which probably will result in incorrect/incomplete installation in other platforms. ๐Ÿ˜ญ

๐Ÿ Python version independent packages ๐Ÿ

Allows you to specify "no python version" when building a Python package thus making it compatible with a user specified range of Python versions. Main use-case for this is to create ABI3 packages as specified in [CEP 20](<https://github.com/conda/ceps/blob/main/cep-0020.md>). ๐Ÿฆ‹

ABI3 packages support building a native Python extension using a specific Python version and running it against any later Python version. ABI3 or stable ABI is supported by only CPython - the reference Python implementation with the Global Interpreter Lock (GIL) enabled. Therefore package builders who wishes to support the free-threaded python build or another implementation like PyPy still has to build a conda package specific to that ABI as they don't support ABI3. There are other proposed standards like HPy and ABI4 (work-in-progress) that tries to address all python implementations. ๐Ÿ’œ

conda-build can indicate that a conda package works for any python version by adding

build:
  python_version_independent: true

A package builder also has to indicate which standard is supported by the package, i.e., for ABI3,

requirements:
  host:
    - python-abi3
    - python
  run:
    - python

In order to support ABI3 with Python 3.9 and onwards and free-threaded builds you can do

build:
  python_version_independent: true   # [py == 39]
  skip: true                         # [py > 39 and not python.endswith("t")]

requirements:
  host:
    - python-abi3                    # [py == 39]
    - python
  run:
    - python

๐Ÿ“ฆ Include build recipe ๐Ÿ“ฆ

The full conda-build recipe and rendered meta.yaml file is included in the Package metadata <#package-metadata> by default. You can disable this with: ๐Ÿ’…

build:
  include_recipe: False

๐ŸŒฟ Use environment variables ๐ŸŒฟ

Normally the build script in build.sh or bld.bat does not pass through environment variables from the command line. Only environment variables documented in Environment variables <#env-vars> are seen by the build script. To "white-list" environment variables that should be passed through to the build script: โœจ

build:
  script_env:
    - MYVAR
    - ANOTHER_VAR

If a listed environment variable is missing from the environment seen by the conda-build process itself, a UserWarning is emitted during the build process and the variable remains undefined. ๐Ÿ˜ญ

Additionally, values can be set by including = followed by the desired value:

build:
  script_env:
   - MY_VAR=some value
Note: Inheriting environment variables can make it difficult for others to reproduce binaries from source with your recipe. Use this feature with caution or explicitly set values using the = syntax. ๐Ÿ™ˆ
Note: If you split your build and test phases with --no-test and --test, you need to ensure that the environment variables present at build time and test time match. If you do not, the package hashes may use different values, and your package may not be testable, because the hashes will differ. ๐Ÿ’€

๐Ÿš€ Export runtime requirements ๐Ÿš€

Some build or host Requirements section will impose a runtime requirement. Most commonly this is true for shared libraries (e.g. libpng), which are required for linking at build time, and for resolving the link at run time. With run_exports (new in conda-build 3) such a runtime requirement can be implicitly added by host requirements (e.g. libpng exports libpng), and with run_exports/strong even by build requirements (e.g. GCC exports libgcc). ๐Ÿ”ฅ

# meta.yaml of libpng
build:
  run_exports:
    - libpng

Here, because no specific kind of run_exports is specified, libpng's run_exports are considered "weak". This means they will only apply when libpng is in the host section, when they will add their export to the run section. If libpng were listed in the build section, the run_exports would not apply to the run section. ๐Ÿ‘‘

# meta.yaml of gcc compiler
build:
  run_exports:
    strong:
      - libgcc

There is also run_exports/weak which is equivalent to an unspecific kind of run_exports but useful if you want to define both strong and weak run exports. ๐Ÿ’…

Strong run_exports are used for things like runtimes, where the same runtime needs to be present in the host and the run environment, and exactly which runtime that should be is determined by what's present in the build section. This mechanism is how we line up appropriate software on Windows, where we must match MSVC versions used across all of the shared libraries in an environment. ๐ŸŽ€

# meta.yaml of some package using gcc and libpng
requirements:
  build:
    - gcc            # has a strong run export
  host:
    - libpng         # has a (weak) run export
    # - libgcc       <-- implicitly added by gcc
  run:
    # - libgcc       <-- implicitly added by gcc
    # - libpng       <-- implicitly added by libpng

You can express version constraints directly, or use any of the Jinja2 helper functions listed at Extra Jinja2 functions <#extra-jinja2>. ๐ŸŒธ

For example, you may use Pinning expressions <#pinning-expressions> to obtain flexible version pinning relative to versions present at build time:

build:
  run_exports:
    - {{ pin_subpackage('libpng', max_pin='x.x') }}

With this example, if libpng were version 1.6.34, this pinning expression would evaluate to >=1.6.34,<1.7. โœจ

okay so if your build deps and your link deps need to put constraints on the run environment but they don't necessarily need to <em>pull in extra packages</em>? You do that by messing with the Run_constrained entries. ๐Ÿ’…

On top of the weak/strong run_exports that add stuff to the run requirements, you've also got weak_constrains and strong_constrains โ€” and those add to the run_constrained requirements. With them you can express things like minimum versions of packages that are compatible but not required โ€” think optional plugins for the linked dependency, or certain system attributes:

requirements:
  build:
    - build-tool                 # has a strong run_constrained export
  host:
    - link-dependency            # has a weak run_constrained export
  run:
  run_constrained:
    # - system-dependency >=min  <-- implicitly added by build-tool
    # - optional-plugin >=min    <-- implicitly added by link-dependency

quick lil heads up bestie: run_exports can be specified both in the build section and on a per-output basis for split packages. ๐Ÿซถ

run_exports only affects directly named dependencies. No cap. So like โ€” if you have a metapackage that includes a compiler that lists run_exports, you also need to define run_exports in the metapackage itself so it actually takes effect when people install your metapackage. This is important, and here's why: if run_exports affected transitive dependencies, you'd see a whole bunch of added dependencies tacked onto shared libraries where they are not actually direct dependencies. ๐Ÿ’€

For example: Python uses bzip2, and bzip2 can use run_exports to make sure people use a compatible build of bzip2. If people list python as a build time dependency, bzip2 should only be imposed for Python itself and should not be automatically imposed as a runtime dependency for the thing using Python. Slay, boundaries. โœจ

The potential downside of this feature is that it takes some control over constraints away from downstream users. So if an upstream package has a problematic run_exports constraint, you can ignore it in your recipe by listing the upstream package name in the build/ignore_run_exports section:

build:
  ignore_run_exports:
    - libstdc++

You can also list the package the run_exports constraint is coming from using the build/ignore_run_exports_from section:

build:
  ignore_run_exports_from:
    - {{ compiler('cxx') }}

๐ŸŽ€ Pin runtime dependencies ๐ŸŽ€

The pin_depends build key can be used to enforce pinning behavior on the output recipe or built package. There are 2 possible behaviors:

build:
  pin_depends: record

With a value of record, conda-build will record all requirements exactly as they would be installed in a file called info/requires. These pins will not show up in the output of conda render and they will not affect the actual run dependencies of the output package. It is only adding in this new file. ๐Ÿ“

build:
  pin_depends: strict

With a value of strict, conda-build applies the pins to the actual metadata. This does affect the output of conda render and also affects the end result of the build. The package dependencies will be strictly pinned down to the build string level. This will supersede any dynamic or compatible pinning that conda-build may otherwise be doing. ๐Ÿ‘‘

๐ŸŒธ Ignoring files in overlinking/overdepending checks ๐ŸŒธ

The overlinking_ignore_patterns key in the build section can be used to ignore patterns of files for the overlinking and overdepending checks. This is sometimes useful to speed up builds that have many files (large repackage jobs) or builds where you know only a small fraction of the files should be checked. ๐Ÿƒโ€โ™€๏ธ

Glob patterns are allowed here, but mind your quoting, especially with leading wildcards. ๐Ÿ’…

Use this sparingly, as the overlinking checks generally do prevent you from making mistakes. ๐Ÿ™ˆ
build:
  overlinking_ignore_patterns:
    - "bin/*"

๐Ÿ’œ Whitelisting shared libraries ๐Ÿ’œ

The missing_dso_whitelist build key is a list of globs for dynamic shared object (DSO) files that should be ignored when examining linkage information.

During the post-build phase, the shared libraries in the newly created package are examined for linkages which are not provided by the package's requirements or a predefined list of system libraries. If such libraries are detected, either a warning --no-error-overlinking or error --error-overlinking will result. ๐Ÿšจ

build:
  missing_dso_whitelist:

These keys allow additions to the list of allowed libraries.

The runpath_whitelist build key is a list of globs for paths which are allowed to appear as runpaths in the package's shared libraries. All other runpaths will cause a warning message to be printed during the build. โš ๏ธ

build:
  runpath_whitelist:

๐Ÿฆ‹ Requirements section ๐Ÿฆ‹

Specifies the build and runtime requirements. Dependencies of these requirements are included automatically. โœจ

Versions for requirements must follow the conda match specification. See Package match specifications <#build-version-spec>. (url: https://conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications)

๐Ÿ› ๏ธ Build ๐Ÿ› ๏ธ

Tools required to build the package. These packages are run on the build system and include things such as revision control systems (Git, SVN), make tools (GNU make, Autotool, CMake) and compilers (real cross, pseudo-cross, or native when not cross-compiling), and any source pre-processors. ๐Ÿงฐ

Packages which provide "sysroot" files, like the CDT packages (see below) also belong in the build section.

requirements:
  build:
    - git
    - cmake

๐ŸŒˆ Host ๐ŸŒˆ

This section was added in conda-build 3.0. It represents packages that need to be specific to the target platform when the target platform is not necessarily the same as the native build platform. For example, in order for a recipe to be "cross-capable", shared libraries requirements must be listed in the host section, rather than the build section, so that the shared libraries that get linked are ones for the target platform, rather than the native build platform. You should also include the base interpreter for packages that need one. In other words, a Python package would list python here and an R package would list mro-base or r-base. ๐Ÿ’–

requirements:
  build:
    - {{ compiler('c') }}
    - {{ cdt('xorg-x11-proto-devel') }}  # [linux]
  host:
    - python
Note: When both build and host sections are defined, the build section can be thought of as "build tools" โ€” things that run on the native platform, but output results for the target platform. For example, a cross-compiler that runs on linux-64, but targets linux-armv7. ๐Ÿง 

The PREFIX environment variable points to the host prefix. With respect to activation during builds, both the host and build environments are activated. The build prefix is activated after the host prefix so that the build prefix โ€” which always contains native executables for the running platform โ€” has priority over the host prefix, which is not guaranteed to provide native executables (e.g. when cross-compiling). ๐ŸŽฏ

As of conda-build 3.1.4, the build and host prefixes are always separate when both are defined, or when {{ compiler() }} Jinja2 functions are used. The only time that build and host are merged is when the host section is absent, and no {{ compiler() }} Jinja2 functions are used in meta.yaml. Because these are separate, you may see some build failures when migrating your recipes. ๐Ÿ˜ญ

For example, let's say you have a recipe to build a Python extension. If you add the compiler Jinja2 functions to the build section, but you do not move your Python dependency from the build section to the host section, your recipe will fail. It will fail because the host environment is where new files are detected, but because you have Python only in the build environment, your extension will be installed into the build environment. No files will be detected. Also, variables such as PYTHON will not be defined when Python is not installed into the host environment. ๐Ÿ’€

On Linux, using the compiler packages provided by Anaconda Inc. in the defaults meta-channel can prevent your build system leaking into the built software by using our CDT (Core Dependency Tree) packages for any "system" dependencies. These packages are repackaged libraries and headers from CentOS6 and are unpacked into the sysroot of our pseudo-cross compilers and are found by them automatically. ๐Ÿง

Note that what qualifies as a "system" dependency is a matter of opinion. The Anaconda Distribution chose not to provide X11 or GL packages, so we use CDT packages for X11. Conda-forge chose to provide X11 and GL packages. ๐Ÿคทโ€โ™€๏ธ

On macOS, you can also use {{ compiler() }} to get compiler packages provided by Anaconda Inc. in the defaults meta-channel. The environment variables MACOSX_DEPLOYMENT_TARGET and CONDA_BUILD_SYSROOT will be set appropriately by conda-build (see Environment variables <#env-vars>). CONDA_BUILD_SYSROOT will specify a folder containing a macOS SDK. These settings achieve backwards compatibility while still providing access to C++14 and C++17. Note that conda-build will set CONDA_BUILD_SYSROOT by parsing the conda_build_config.yaml. For more details, see Anaconda compiler tools <#compiler-tools>. ๐ŸŽ

TL;DR: If you use {{ compiler() }} Jinja2 to utilize our new compilers, you must also move anything that is not strictly a build tool into your host dependencies. This includes Python, Python libraries, and any shared libraries that you need to link against in your build. Examples of build tools include any {{ compiler() }}, Make, Autoconf, Perl (for running scripts, not installing Perl software), and Python (for running scripts, not for installing software). โญ

๐Ÿ“ Run ๐Ÿ“

Packages required to run the package. These are the dependencies that are installed automatically whenever the package is installed. Package names should follow the package match specifications (see https://conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications). ๐Ÿƒโ€โ™€๏ธ๐Ÿ’จ

requirements:
  run:
    - python
    - argparse # [py26]
    - six >=1.8.0

To build a recipe against different versions of NumPy and ensure that each version is part of the package dependencies, list numpy x.x as a requirement in meta.yaml and use conda-build with a NumPy version option such as --numpy 1.7. ๐Ÿ”ข

The line in the meta.yaml file should literally say numpy x.x and should not have any numbers. If the meta.yaml file uses numpy x.x, it is required to use the --numpy option with conda-build.

requirements:
  run:
    - python
    - numpy x.x
Note ๐Ÿ’› โ€” okay so you don't have to hand-type your run requirements like some kind of medieval scribe. Since conda-build 3, you can augment the packages in your build and host sections with run_exports, and those get automatically added to the run requirements for you. Free labor. We love to see it. โœจ

Run_constrained ๐ŸŒธ

These are packages that are optional at runtime but that must obey the additional constraint you supply โ€” if they happen to be installed. Like, "no pressure, but if you're here, you're following the rules."

Package names should follow the package match specifications at https://conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications.

requirements:
  run_constrained:
    - optional-subpackage =={{ version }}

Real talk, here's a scenario so it clicks. Say you have an environment with package "a" installed at version 1.0. Then you go to install package "b", and "b" has a run_constrained entry of "a>1.0". Now conda has to upgrade "a" in that environment before it can install "b". No upgrade, no "b". Simple as that. ๐Ÿ’…

This is especially useful with virtual packages, where the run_constrained dependency isn't even a package conda manages โ€” it's a virtual package (https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-virtual.html) that stands in for some system property conda literally cannot change. For example, a package on linux might impose a run_constrained dependency on __glibc>=2.12. That's the version bound that's consistent with CentOS 6. Software built against glibc 2.12 will be compatible with CentOS 6. So this run_constrained dependency is doing the very important job of letting conda tell the user "hey, this package can't be installed" if their system glibc version is too old. ๐Ÿซถ


Test section ๐Ÿงช

If this section exists โ€” or if there's a run_test.[py,pl,sh,bat,r] file hanging out in the recipe โ€” then the package gets installed into a test environment once the build is finished, and the tests run in there. That's it, that's the whole vibe.

Test files ๐ŸŽ€

These are the test files that get copied from the recipe into the temporary test directory, and they're the ones you need during testing. If you're providing a path, forward slashes must be used. Don't fight it.

test:
  files:
    - test-data.txt

Source files ๐Ÿฆ‹

Test files that get copied from the source work directory into the temporary test directory, because you need them during testing. Different source folder, same energy.

test:
  source_files:
    - test-data.txt
    - some/directory
    - some/directory/pattern*.sh

This capability was added in conda-build 2.0. โญ

Test requirements ๐Ÿ’œ

On top of your runtime requirements, you can also specify requirements you need during testing. And bestie, the runtime requirements you put in the "run" section described above are automatically included during testing โ€” you don't have to repeat yourself. โœจ

test:
  requires:
    - nose

Test commands ๐Ÿ”ฅ

These are the commands that get run as part of the test.

test:
  commands:
    - bsdiff4 -h
    - bspatch4 -h

Python imports ๐ŸŒˆ

A list of Python modules or packages that will be imported in the test environment. It's giving "just import it and see."

test:
  imports:
    - bsdiff4

Which would be equivalent to having a run_test.py with the following:

import bsdiff4

Run test script ๐Ÿ‘‘

The script run_test.sh โ€” or .bat, .py, .pl, or .r โ€” gets run automatically if it's part of the recipe. It just... goes. On its own. Main character energy.

Note ๐Ÿ’› โ€” Python .py, Perl .pl, and R .r scripts are valid only as part of Python, Perl, and R packages, respectively. Match your script to your language, okay? ๐Ÿ™ˆ

Downstream tests ๐Ÿ’€

Knowing your software built and ran its own tests successfully is necessary, but it is not sufficient for keeping whole systems of software running. To actually have confidence that a new build of a package hasn't broken other downstream software, conda-build supports the notion of downstream testing.

test:
  downstreams:
    - some_downstream_pkg

So this is basically saying: "When I build this recipe, after you run my test suite here, also download and run some_downstream_pkg, which depends on my package." Conda-build takes care of making sure the package you just built gets installed into the environment for testing some_downstream_pkg. And if conda-build can't create that environment because the dependencies are unsatisfiable, it'll skip those downstream tests and warn you. That usually happens when you're building a new version of a package that will require you to rebuild the downstream dependencies. ๐Ÿ˜ญ

Downstreams specs are full conda specs, similar to the requirements section. So yes, you can put version constraints on your specs in here:

test:
  downstreams:
    - some_downstream_pkg  >=2.0

And you can specify more than one package to run downstream tests for:

test:
  downstreams:
    - some_downstream_pkg
    - other_downstream_pkg

But โ€” and this is important, don't skip it โ€” that does not mean these packages are tested together. Rather, each of these is tested for satisfiability with your new package, and then each of their test suites are run separately with the new package. Separate. Not a group project. ๐Ÿซถ


Outputs section ๐ŸŒŸ

This section explicitly specifies packaging steps. It supports multiple outputs, as well as different package output types. The format is a list of mappings. Build strings for subpackages are determined by their runtime dependencies. This support was added in conda-build 2.1.0.

outputs:
  - name: some-subpackage
    version: 1.0
  - name: some-other-subpackage
    version: 2.0
Note ๐Ÿ’› โ€” if any output is specified in the outputs section, the default packaging behavior of conda-build is bypassed. In other words, if any subpackage is specified, then you do not get the normal top-level build for this recipe without explicitly defining a subpackage for it. This is an alternative to the existing behavior, not an addition to it. For more information, see Implicit metapackages. Each output may have its own version and requirements. Additionally, subpackages may impose downstream pinning similarly to Pin downstream to help keep your packages aligned.

Specifying files to include in output ๐Ÿ“ฆ

You can specify files to be included in the package in 1 of 3 ways:

  • Explicit file lists.
  • Scripts that move files into the build prefix.
  • Both of the above.

Explicit file lists are relative paths from the root of the build prefix. Explicit file lists support glob expressions. Directory names are also supported, and they recursively include contents. Everything inside. All of it. ๐Ÿ‘‘

Warning ๐Ÿšจ โ€” when defining outputs/files as a list without specifying outputs/script, any file in the prefix (including those installed by host dependencies) matching one of the glob expressions is included in the output. Yeah. All of them. Read that again.
outputs:
  - name: subpackage-name
    files:
      - a-file
      - a-folder
      - *.some-extension
      - somefolder/*.some-extension

Greater control over file matching may be achieved by defining files as a dictionary separating files to include from those to exclude. When using include/exclude, only files installed by the current recipe are considered โ€” i.e. files in the prefix installed by host dependencies are excluded. That's the glow-up. ๐ŸŒธ

include/exclude must not be used simultaneously with glob expressions listed directly in outputs/files. And heads up: files matching both include and exclude expressions will be excluded.

outputs:
  - name: subpackage-name
    files:
      include:
        - a-file
        - a-folder
        - *.some-extension
        - somefolder/*.some-extension
      exclude:
        - *.exclude-extension
        - a-folder/**/*.some-extension

Scripts that create or move files into the build prefix can be any kind of script. Known script types need only specify the script name. Currently the list of recognized extensions is py, bat, ps1, and sh.

outputs:
  - name: subpackage-name
    script: move-files.py

The interpreter command must be specified if the file extension is not recognized. Otherwise it's just a mystery file and nobody knows what to do with it. ๐Ÿ’€

outputs:
  - name: subpackage-name
    script: some-script.extension
    script_interpreter: program plus arguments to run script

For scripts that move or create files, a fresh copy of the working directory is provided at the start of each script execution. This ensures that results between scripts are independent of one another. No cross-contamination, no drama, just clean runs. โœจ

Note ๐Ÿ’› โ€” for either the file list or the script approach, having more than 1 package contain a given file is not explicitly forbidden, but it may prevent installation of both packages simultaneously. Conda disallows this condition because it creates ambiguous runtime conditions. Ambiguity is not the vibe. ๐Ÿ™ˆ

When both scripts and files are given, the script is first run and then only the files in the explicit file list are packaged.

Subpackage requirements ๐ŸŽ€

Like a top-level recipe, a subpackage may have zero or more dependencies listed as build requirements and zero or more dependencies listed as run requirements. Zero is a valid number, bestie.

The dependencies listed as subpackage build requirements are available only during the packaging phase of that subpackage. Just that phase. Nothing else.

And a subpackage does not automatically inherit any dependencies from its top-level recipe, so any build or run requirements the subpackage needs must be explicitly specified. It gets nothing for free. ๐Ÿ˜ค

outputs:
  - name: subpackage-name
    requirements:
      build:
        - some-dep
      run:
        - some-dep

It is also possible for a subpackage requirements section to have a list of dependencies, but no build section or run section. This is the same as having a build section with this dependency list and a run section with the same dependency list. Two for one. Iconic. ๐Ÿ’…

outputs:
  - name: subpackage-name
    requirements:
      - some-dep

You can also impose runtime dependencies whenever a given (sub)package is installed as a build dependency. For example, if we had an overarching "compilers" package, and within that, had gcc and libgcc outputs, we could force recipes that use GCC to include a matching libgcc runtime requirement:

outputs:
  - name: gcc
    run_exports:
      - libgcc 2.*
  - name: libgcc

See the Export runtime requirements section for additional information.

Note ๐Ÿ’› โ€” variant expressions are very powerful here. You can express the version requirement in the run_exports entry as a Jinja function to insert values based on the actual version of libgcc produced by the recipe. Read more about them at Referencing subpackages (#referencing-subpackages). ๐Ÿงš

โœจ Implicit metapackages โœจ

Okay so here's the vibe: sometimes you look at your top-level package and you're like "bestie, this is literally just a bunch of smaller subpackages glued together." And that's valid! So you might want to define the top-level package as a composition of several subpackages. ๐Ÿ’…

But here's the tea: if you do that and you don't define a subpackage name that matches the top-level package/name, conda-build goes ahead and makes a metapackage for you. No cap, it just does it. ๐Ÿซถ This metapackage gets its runtime requirements drawn from its dependency subpackages, all for the sake of accurate build strings.

EXAMPLE: In this example, a metapackage for subpackage-example will be created. It will have runtime dependencies on subpackage1, subpackage2, some-dep, and some-other-dep.
package:
  name: subpackage-example
  version: 1.0

requirements:
  run:
    - subpackage1
    - subpackage2

outputs:
  - name: subpackage1
    requirements:
      - some-dep
  - name: subpackage2
    requirements:
      - some-other-dep
  - name: subpackage3
    requirements:
      - some-totally-exotic-dep

๐Ÿงช Subpackage tests ๐Ÿงช

You can test subpackages independently of the top-level package. Like, they get to have their own moment. ๐Ÿ‘‘

Independent test script files for each separate package get specified under that subpackage's test section. These files support the same formats as the top-level run_test.* scripts, which are .py, .pl, .r, .bat, and .sh. And these may be extended to support other script types in the future โ€” so watch this space, iykyk. โœจ

outputs:
  - name: subpackage-name
    test:
      script: some-other-script.py

By default, those run_test.* scripts apply only to the top-level package. Not the subpackages, nope, they don't get the hand-me-downs. ๐Ÿ™ˆ To apply them also to subpackages, you have to list them explicitly in the script section:

outputs:
  - name: subpackage-name
    test:
      script: run_test.py

Test requirements for subpackages can be specified using the optional test/requires section of subpackage tests. And heads up: subpackage tests install their runtime requirements during the test as well. ๐ŸŒธ

EXAMPLE: In this example, the test for subpackage-name installs some-test-dep and subpackage-run-req, but not some-top-level-run-req.
requirements:
  run:
    - some-top-level-run-req

outputs:
  - name: subpackage-name
    requirements:
      - subpackage-run-req
    test:
      script: run_test.py
      requires:
        - some-test-dep

๐ŸŽ€ Output type ๐ŸŽ€

Conda-build supports creating packages other than conda packages. Currently that support includes only wheels, but others may come as demand appears. So like, if you need something, speak up bestie. ๐Ÿ—ฃ๏ธ If type is not specified, the default value is conda.

requirements:
  build:
    - wheel

outputs:
  - name: name-of-wheel-package
    type: wheel

Currently you must include the wheel package in your top-level requirements/build section in order to build wheels. Not optional, fr fr.

When specifying type, the name field is optional and it defaults to the package/name field for the top-level recipe.

requirements:
  build:
    - wheel

outputs:
  - type: wheel

Conda-build currently knows how to test only conda packages. (It's giving "I only know one trick" and honestly? Respect. ๐Ÿ’€) Conda-build does support using Twine to upload packages to PyPI. See the conda-build help output (conda-build --help) for the list of arguments accepted that will be passed through to Twine.

Note: You must use pip to install Twine in order for this to work.

๐Ÿ’– About section ๐Ÿ’–

Specifies identifying information about the package. The information displays in the Anaconda.org channel. It's basically your package's little bio, its main character introduction. โœจ

about:
  home: https://github.com/ilanschnell/bsdiff4
  license: BSD 3-Clause
  license_file: LICENSE
  license_family: BSD
  license_url: https://github.com/bacchusrx/bsdiff4/blob/master/LICENSE
  summary: binary diff and patch using the BSDIFF4 format
  description: |
    This module provides an interface to the BSDIFF4 format, command line interfaces
    (bsdiff4, bspatch4) and tests.
  dev_url: https://github.com/ilanschnell/bsdiff4
  doc_url: https://bsdiff4.readthedocs.io
  doc_source_url: https://github.com/ilanschnell/bsdiff4/blob/main/README.rst

๐Ÿ“œ License file ๐Ÿ“œ

Add a file containing the software license to the package metadata. Many licenses require the license statement to be distributed with the package โ€” so like, legally you gotta, don't skip this. โš–๏ธ

The filename is relative to the source or recipe directory. The value can be a single filename or a YAML list for multiple license files. Values can also point to directories with license information. Directory entries must end with a / suffix (this is to lessen unintentional inclusion of non-license files; all of the directory's contents will be unconditionally and recursively added).

about:
  license_file:
    - LICENSE
    - vendor-licenses/

Similar to the license file, the user can add prelink message files to the conda package.

about:
  prelink_message:
    - prelink_message_file.txt
    - folder-with-all-prelink-messages/

๐Ÿ‘‘ App section ๐Ÿ‘‘

If the app section is present, the package is an app, meaning that it appears in Anaconda Navigator <https://docs.anaconda.com/anaconda/navigator/>. It's giving "download me, I'm cute." ๐Ÿฆ‹


โญ Entry point โญ

The command that is called to launch the app in Navigator.

app:
  entry: ipython notebook

๐ŸŒˆ Icon file ๐ŸŒˆ

The icon file contained in the recipe.

app:
  icon: icon_64x64.png

๐Ÿ’œ Summary ๐Ÿ’œ

Summary of the package used in Navigator.

app:
  summary:  "The Jupyter Notebook"

๐ŸŒธ Own environment ๐ŸŒธ

If True, installing the app through Navigator installs into its own environment. The default is False.

app:
  own_environment: True

๐Ÿ“ Extra section ๐Ÿ“

A schema-free area for storing non-conda-specific metadata in standard YAML form. It's the junk drawer, but make it YAML. ๐Ÿ’…

EXAMPLE: To store recipe maintainer information:
extra:
  maintainers:
   - name of maintainer

๐Ÿ”ฅ Templating with Jinja ๐Ÿ”ฅ

Conda-build supports Jinja templating in the meta.yaml file. Obsessed, honestly.

EXAMPLE: The following meta.yaml would work with the GIT values defined for Git repositores. The recipe is included at the base directory of the Git repository, so the git_url is ../:
package:
  name: mypkg
  version: {{ GIT_DESCRIBE_TAG }}

build:
  number: {{ GIT_DESCRIBE_NUMBER }}

  # Note that this will override the default build string with the Python
  # and NumPy versions
  string: {{ GIT_BUILD_STR }}

source:
  git_url: ../

Conda-build checks if the Jinja2 variables that you use are defined and produces a clear error if it is not. So if you typo something, you'll know. No silent failures here, bestie. โœจ

You can also use a different syntax for these environment variables that allows default values to be set, although it is somewhat more verbose. (More words, but also more safety โ€” a fair trade tbh. ๐Ÿซถ)

EXAMPLE: A version of the previous example using the syntax that allows defaults:
package:
  name: mypkg
  version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}

build:
  number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}

  # Note that this will override the default build string with the Python
  # and NumPy versions
  string: {{ environ.get('GIT_BUILD_STR', '') }}

source:
  git_url: ../

One further possibility using templating is obtaining data from your downloaded source code. ๐Ÿ‘€

EXAMPLE: To process a project's setup.py and obtain the version and other metadata:
{% set data = load_setup_py_data() %}

package:
  name: conda-build-test-source-setup-py-data
  version: {{ data.get('version') }}

# source will be downloaded prior to filling in jinja templates
# Example assumes that this folder has setup.py in it
source:
  path_url: ../

These functions are completely compatible with any other variables such as Git and Mercurial. โœจ

Extending this arbitrarily to other functions requires that functions be predefined before Jinja processing, which in practice means changing the conda-build source code. See the conda-build issue tracker <https://github.com/conda/conda-build/issues>.

For more information, see the Jinja2 template documentation <https://jinja.palletsprojects.com/en/latest/templates/> and the list of available environment variables <#env-vars>.

Jinja templates are evaluated during the build process. To retrieve a fully rendered meta.yaml, use the conda render <> command. ๐Ÿ’…


๐Ÿฆ‹ Loading data from other files ๐Ÿฆ‹

There are several additional functions available to Jinja2, which can be used to load data from other files. These are load_setup_py_data, load_file_regex, load_file_data, and load_str_data. Let's go through them one by one, bestie. ๐Ÿ‘‘

  • load_setup_py_data โ€” Load data from a setup.py file. This can be useful to obtain metadata such as the version from a project's setup.py file. For example:
{% set data = load_setup_py_data() %}
{% set version = data.get('version') %}
package:
  name: foo
  version: {{ version }}

For example, using load_file_regex(load_file, regex_pattern, from_recipe_dir=False) -> re.Match | None:

{% set version_match = load_file_regex(
  load_file="conda_package_streaming/__init__.py",
  regex_pattern='^__version__ = "(.+)"') %}
{% set version = version_match[1] %}

package:
  version: {{ version }}
  • load_file_data โ€” Parse JSON, TOML, or YAML files and load data from them. For example, you can use this to load poetry configurations from pyproject.toml. This is especially useful, as setup.py is no longer the only standard way to define project metadata (see PEP 517 <https://peps.python.org/pep-0517> and PEP 518 <https://peps.python.org/pep-0518>):
{% set pyproject = load_file_data('pyproject.toml') %}
{% set poetry = pyproject.get('tool', {}).get('poetry') %}
package:
  name: {{ poetry.get('name') }}
  version: {{ poetry.get('version') }}
  • load_str_data โ€” Load and parse data from a string. This is similar to load_file_data, but it takes a string instead of a file as an argument. This may seem pointless at first, but you can use this to pass more complex data structures by environment variables. For example:
{% set extra_deps = load_str_data(environ.get("EXTRA_DEPS", []), "json") %}
requirements:
  run:
    - ...
    {% for dep in extra_deps %}
    - {{ dep }}
    {% endfor %}

Then you can pass the EXTRA_DEPS environment variable to the build like so:

EXTRA_DEPS='["foo =1.0", "bar >=2.0"]' conda build path/to/recipe

Okay so real talk, these three besties โ€” load_setup_py_data, load_file_regex, and load_file_data โ€” all take the exact same two params: from_recipe_dir and recipe_dir. If you set from_recipe_dir to true, you have to pass recipe_dir too, no skipping ๐Ÿ’…. When you do that, the file gets hunted down relative to the recipe directory. If you don't, it goes looking in the source instead (after that source has been downloaded and extracted, if that step was even needed). Oh and if the file you name is an absolute path? Then neither directory gets searched, periodt. ๐Ÿ”ฅ

And load_file_data plus load_str_data are extra generous โ€” they also accept *args and **kwargs, which get passed verbatim to whatever function parses the file. So for JSON that's json.load; for TOML it's toml.load; and for YAML it's yaml.safe_load. Slay. โœจ

Conda-build specific Jinja2 functions ๐Ÿงš

So besides the standard Jinja2 stuff you already know and love, conda-build hands you a few extra Jinja functions while it's doing its thing: pin_compatible, pin_subpackage, compiler, and resolved_packages. The first 3 are defined over in Extra Jinja2 functions โ€” go peek there ๐Ÿ‘€. And resolved_packages? Definition incoming:

  • resolved_packages('environment_name') โ€” returns the final list of packages (formatted as package_name version build_string) that are listed in requirements:host or requirements:build. Bestie this includes all the packages, even the indirect dependencies, so like everything that's gonna get installed into the host or build environment. environment_name must be either host or build, no other vibes accepted. This function is lowkey iconic for building meta-packages that wanna pin every single direct and indirect dependency to its exact match. For example:
requirements:
  host:
    - curl 7.55.1
  run:
  {% for package in resolved_packages('host') %}
    - {{ package }}
  {% endfor %}

might render to (depending on package dependencies and the platform, so don't come for me):

requirements:
    host:
        - curl 7.55.1
    run:
        - ca-certificates 2017.08.26 h1d4fec5_0
        - curl 7.55.1 h78862de_4
        - libgcc-ng 7.2.0 h7cc24e2_2
        - libssh2 1.8.0 h9cfc8f7_4
        - openssl 1.0.2n hb7f436b_0
        - zlib 1.2.11 ha838bed_2

Here, the output of resolved_packages was:

['ca-certificates 2017.08.26 h1d4fec5_0', 'curl 7.55.1 h78862de_4',
'libgcc-ng 7.2.0 h7cc24e2_2', 'libssh2 1.8.0 h9cfc8f7_4',
'openssl 1.0.2n hb7f436b_0', 'zlib 1.2.11 ha838bed_2']

Preprocessing selectors ๐ŸŽ€

Okay so you can sprinkle selectors onto any line, and they get used as part of a preprocessing stage. Here's the tea: before the meta.yaml file is even read, each selector gets evaluated, and if it comes back False, the whole line it's sitting on gets yeeted. A selector has the form # [<selector>] at the end of a line. Like:

source:
  url: http://path/to/unix/source    # [not win]
  url: http://path/to/windows/source # [win]
Note: Preprocessing selectors are evaluated after Jinja templates. Don't forget it bestie, the order matters ๐Ÿ’–

A selector is a valid Python statement that gets executed. Yes bestie, actually executed. And the following variables are all just sitting there, defined and ready for you. Unless I say otherwise, they're all booleans ๐Ÿ’–

  • x86 โ€” True if the system architecture is x86, both 32-bit and 64-bit, for Intel or AMD chips.
  • x86_64 โ€” True if the system architecture is x86_64, which is 64-bit, for Intel or AMD chips.
  • linux โ€” True if the platform is Linux.
  • linux32 โ€” True if the platform is Linux and the Python architecture is 32-bit and uses x86.
  • linux64 โ€” True if the platform is Linux and the Python architecture is 64-bit and uses x86.
  • armv6l โ€” True if the platform is Linux and the Python architecture is armv6l.
  • armv7l โ€” True if the platform is Linux and the Python architecture is armv7l.
  • aarch64 โ€” True if the platform is Linux and the Python architecture is aarch64.
  • ppc64le โ€” True if the platform is Linux and the Python architecture is ppc64le.
  • s390x โ€” True if the platform is Linux and the Python architecture is s390x.
  • osx โ€” True if the platform is macOS.
  • arm64 โ€” True if the platform is either macOS or Windows and the Python architecture is arm64.
  • unix โ€” True if the platform is either macOS or Linux or emscripten.
  • win โ€” True if the platform is Windows.
  • win32 โ€” True if the platform is Windows and the Python architecture is 32-bit.
  • win64 โ€” True if the platform is Windows and the Python architecture is 64-bit.
  • py โ€” the Python version as an int, such as 27 or 36. Go check the CONDA_PY environment variable <#build-envs>.
  • py3k โ€” True if the Python major version is 3.
  • py2k โ€” True if the Python major version is 2.
  • py27 โ€” True if the Python version is 2.7. Use of this selector is discouraged in favor of comparison operators (e.g. py==27).
  • py34 โ€” True if the Python version is 3.4. Use of this selector is discouraged in favor of comparison operators (e.g. py==34).
  • py35 โ€” True if the Python version is 3.5. Use of this selector is discouraged in favor of comparison operators (e.g. py==35).
  • py36 โ€” True if the Python version is 3.6. Use of this selector is discouraged in favor of comparison operators (e.g. py==36).
  • np โ€” the NumPy version as an integer such as 111. Go check the CONDA_NPY environment variable <#build-envs>.
  • build_platform โ€” the native subdir of the conda executable.

The way that the Python version selectors โ€” py27, py34, etc. โ€” are discouraged in favor of the more general comparison operators?? Yeah. And heads up: additional selectors in this series will not be added to conda-build. So don't hold your breath waiting for more, bestie, it's not happening ๐Ÿ’€

Also note that for each subdir with OS and architecture that conda supports, two preprocessing selectors are created โ€” one for the OS and one for the architecture, separately โ€” except when the architecture is not a valid python expression (*-32 and *-64 in particular, iykyk ๐Ÿซถ).

Because the selector is any valid Python expression, you can go absolutely feral with the logic and it's fine:

source:
  url: http://path/to/windows/source      # [win]
  url: http://path/to/python2/unix/source # [unix and py2k]
  url: http://path/to/python3/unix/source # [unix and py>=35]
Note: the selectors delete only the line that they are on. So you may need to put the same selector on multiple lines, babes. Do not skip this. Fr fr.
source:
  url: http://path/to/windows/source     # [win]
  md5: 30fbf531409a18a48b1be249052e242a  # [win]
  url: http://path/to/unix/source        # [unix]
  md5: 88510902197cba0d1ab4791e0f41a66e  # [unix]
Note: bestie, if you wanna target multiple operating systems you gotta use the or statement, okay? I know it's tempting to write skip: True # [win and osx] but that only fires when the platform is windows AND osx at the same time โ€” which is, like, never. literally never. it's giving impossible. ๐Ÿ’€
build:
  skip: True  # [win or osx]

Adding pre-link, post-link, and pre-unlink scripts ๐ŸŽ€

okay so you can totally add scripts to a recipe โ€” they just have to live in the same directory as the meta.yaml file. here's the lineup, bestie:

  • pre-link โ€” runs before the package is installed. if it errors out (nonzero exit), conda stops and the whole installation fails. ๐Ÿ’ฅ
  • post-link โ€” runs after the package is installed. a nonzero exit means installation fails too, and ngl if that happens conda does not write any package metadata.
  • pre-unlink โ€” runs before the package is removed. nonzero exit = the removal fails. ๐Ÿ™ˆ

and here's the thing: besides living next to meta.yaml, they gotta be named simply post-link.sh or post-link.bat. conda-build will rename them to .<name>-<action>.sh (or .bat), where <name> is the package name and <action> is one of those actions we just listed. โœจ

these scripts get executed in a subprocess by conda, using %COMSPEC% /c <script> on Windows and /bin/bash <script> on macOS and Linux.

the convention for the path + filenames on Windows is:

Scripts/.<name>-<action>.bat

and on Linux and macOS it's:

bin/.<name>-<action>.sh

the scripts set these environment variables, no cap:

  • PREFIX โ€” the install prefix.
  • PKG_NAME โ€” the name of the package.
  • PKG_VERSION โ€” the version of the package.
  • PKG_BUILDNUM โ€” the build number of the package.

the scripts are:

  • Windows:
    • pre-link.bat
    • post-link.bat
    • pre-unlink.bat
  • macOS and Linux:
    • pre-link.sh
    • post-link.sh
    • pre-unlink.sh

post-link and pre-unlink scripts should:

  • Be avoided whenever possible. (yes bestie, the manpage said it first ๐Ÿซถ)
  • Not touch anything other than the files being installed.
  • Not write anything to stdout or stderr, unless an error occurs.
  • Not depend on any installed or to-be-installed conda packages.
  • Depend only on simple system tools such as rm, cp, mv, and ln.

so like, they shouldn't be yapping to stdout or stderr unless something goes wrong โ€” but they're allowed to write to $PREFIX/.messages.txt, which gets shown after conda finishes all its actions. ๐Ÿ’…


Activate scripts ๐ŸŒธ

recipes are allowed to have activate scripts, which get sourced or called when the environment is activated. but fr fr, it's generally recommended to avoid using activate scripts when another option is possible โ€” because people don't always activate environments the expected way, and then these packages may misbehave. ๐Ÿ˜ญ

when you do use them in a recipe, feel free to name them activate.bat, activate.sh, deactivate.bat, and deactivate.sh in the recipe. the installed scripts are recommended to be prefixed by the package name and a separating -.

below is some sample code for Unix and Windows that makes this install process easier. ๐Ÿงš

in build.sh:

# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d.
# This will allow them to be run on environment activation.
for CHANGE in "activate" "deactivate"
do
    mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
    cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done

in build.bat:

setlocal EnableDelayedExpansion

:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
    if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
    copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
    :: Copy unix shell activation scripts, needed by Windows Bash users
    copy %RECIPE_DIR%\%%F.sh %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.sh
)

Making packages relocatable ๐Ÿฆ‹

ngl, often the most difficult thing about building a conda package is making it relocatable. relocatable means the package can be installed into any prefix. otherwise? it's only usable in the environment where it was built. ๐Ÿ˜ฌ

conda-build does the following things automatically to make packages relocatable:

  • Binary object files are converted to use relative paths using install_name_tool on macOS and patchelf on Linux. ๐Ÿ”ง
  • Any text file without NULL bytes that contains the build prefix or the placeholder prefix /opt/anaconda1anaconda2anaconda3 is registered in the info/has_prefix file in the package metadata. when conda installs the package, any files in info/has_prefix have the registered prefix replaced with the install prefix. for more info, see Package metadata <#package-metadata>.
  • Any binary file containing the build prefix can automatically be registered in info/has_prefix using build/detect_binary_files_with_prefix in meta.yaml. alternatively, individual binary files can be registered by listing them in build/binary_has_prefix_files in meta.yaml. the registered files will have their build prefix replaced with the install prefix at install time. this works by padding the install prefix with null terminators, so the length of the binary file stays the same. that means the build prefix must be long enough to accommodate any reasonable installation prefix. on macOS and Linux, conda-build pads the build prefix to 255 characters by appending _placeholds to the end of the build directory name. โœจ
Note: the prefix length was changed in conda-build 2.0 from 80 characters to 255 characters. legacy packages with 80-character prefixes must be rebuilt to take advantage of the longer prefix. don't skip this, bestie.
  • There may be cases where conda identified a file as binary, but it needs to have the build prefix replaced as if it were text โ€” no padding with null terminators. such files can be listed in build/has_prefix_files in meta.yaml.

Conda package specification ๐Ÿ‘‘

a conda package is an archive file that contains:

  • Metadata under the info/ directory.
  • A collection of files that are installed directly into an install prefix.

there are currently two formats of archives that are supported:

  • .tar.bz2 โ€” the original format of conda packages.
  • .conda โ€” 2nd Gen. this is a more compact and thus faster. default since 25.1.

the formats are identical across platforms and operating systems. during the install process, all files are extracted into the install prefix, with the exception of the ones in info/. installing a conda package into an environment is similar to executing the following commands:

cd <environment prefix>
tar xjf some-package-1.0-0.tar.bz2

only files, including symbolic links, are part of a conda package. directories are not included. directories are created and removed as needed, but you cannot create an empty directory from the tar archive directly. ๐Ÿ™ˆ


Package format differences ๐ŸŒˆ

Legacy .tar.bz2 format:

  • Traditional conda package format
  • Compatible with older conda versions
  • Larger file sizes due to less efficient compression
  • Slower installation times

Modern .conda format:

  • Newer, more efficient package format
  • Better compression ratios
  • Faster installation times
  • Requires conda 4.7+ for installation
  • Default format in conda-build 25.1+

Package metadata ๐Ÿ’–

the info/ directory contains all metadata about a package. files in this location are not installed under the install prefix. and even though you're free to add any file to this directory, conda only inspects the content of the files discussed below. iykyk. ๐ŸŽ€

๐ŸŽ€ info/index.json ๐ŸŽ€

okay so this file is literally the little ID card of your package bestie ๐Ÿ’ณ โ€” it holds the basic tea: name, version, build string, dependencies, all of it. And the content of this file gets stored in repodata.json, which is the repository index file โ€” hence the name index.json. iykyk โœจ

The JSON object in here is a dictionary, and it contains the keys below. Also fun fact: the filename of the conda package is composed of the first 3 values, like this:

<name>-<version>-<build>.tar.bz2

or

<name>-<version>-<build>.conda

  • name โ€” type: string. The lowercase name of the package. May contain the "-" character.
  • version โ€” type: string. The package version. May not contain "-". Conda acknowledges PEP 440 (https://www.python.org/dev/peps/pep-0440/).
  • build โ€” type: string. The build string. May not contain "-". This is the thing that differentiates builds of packages with otherwise identical names and versions, such as:
    • A build with other dependencies, such as Python 3.4 instead of Python 2.7.
    • A bug fix in the build process.
    • Some different optional dependencies, such as MKL versus ATLAS linkage. Nothing in conda actually inspects the build string. Strings such as np18py34_1 are designed only for human readability and conda never parses them.
  • build_number โ€” type: integer. A non-negative integer representing the build number of the package. Unlike the build string, the build_number is inspected by conda. Conda uses it to sort packages that have otherwise identical names and versions to determine the latest one. This is important because new builds that contain bug fixes for the way a package is built may be added to a repository. ๐Ÿ‘‘
  • depends โ€” type: list of strings. A list of dependency specifications, where each element is a string, as outlined in Package match specifications.
  • arch โ€” type: string. Optional. The architecture the package is built for. EXAMPLE: x86_64. Conda currently does not use this key. ๐Ÿ’€
  • platform โ€” type: string. Optional. The OS that the package is built for. EXAMPLE: osx. Conda currently does not use this key. Packages for a specific architecture and platform are usually distinguished by the repository subdirectory that contains them. See Repository structure and index. ๐ŸŒˆ

๐Ÿฆ‹ info/paths.json ๐Ÿฆ‹

This one combines information from info/files, info/has_prefix, and info/no_link into a single file. The older files are ignored by conda when paths.json is present. Introduced in 2016. no cap, it's giving "one file to rule them all" ๐Ÿ’…

info/files ๐Ÿ’–

Okay bestie, this one lists every single file that's part of the package itself, one per line. All of these files need to get linked into the environment. And here's the tea: any files in the package that are not listed in this file are not linked when the package is installed. So like, don't forget any or they just... won't show up. ๐Ÿ™ˆ

The directory delimiter for the files in info/files should always be "/", even on Windows. Why? Because that matches the directory delimiter used in the tarball. Consistency queen. ๐Ÿ‘‘


info/has_prefix โœจ

Optional file, but lowkey important. It lists all the files that contain a hard-coded build prefix or placeholder prefix, which needs to be replaced by the install prefix at installation time. Like a glow-up for your paths. ๐Ÿ’…

Note: Due to the way the binary replacement works, the placeholder prefix must be longer than the install prefix. No cap, this one actually matters.

Each line of this file should be either:

  • a path, in which case it is considered a text file with the default placeholder /opt/anaconda1anaconda2anaconda3, or
  • a space-separated list of placeholder, mode, and path, where:
    • Placeholder is the build or placeholder prefix.
    • Mode is either text or binary.
    • Path is the relative path of the file to be updated.

EXAMPLE: On Windows:

"Scripts/script1.py"
"C:\Users\username\anaconda\envs\_build" text "Scripts/script2.bat"
"C:/Users/username/anaconda/envs/_build" binary "Scripts/binary"

EXAMPLE: On macOS or Linux:

bin/script.sh
/Users/username/anaconda/envs/_build binary bin/binary
/Users/username/anaconda/envs/_build text share/text
Note: The directory delimiter for the relative path must always be "/", even on Windows. The placeholder may contain either "\" or "/" on Windows, but the replacement prefix will match the delimiter used in the placeholder. The default placeholder /opt/anaconda1anaconda2anaconda3 is an exception โ€” it gets replaced with the install prefix using the native path delimiter. On Windows, the placeholder and path always appear in quotes to support paths with spaces. ๐Ÿซถ

Optional file. Lists all files that cannot be linked โ€” either soft-linked or hard-linked โ€” into environments, and are copied instead. Some files just refuse to be linked, and we respect that. ๐Ÿ’€


info/license.txt ๐Ÿ“œ

Optional file. The software license for the package. Read it, bestie. It's giving legally binding.


info/about.json ๐ŸŒธ

Optional file. Contains the entries in the About section <#about-section> of the meta.yaml file. The following keys are added to info/about.json if present in the build recipe:

  • home.
  • dev_url.
  • doc_url.
  • license_url.
  • license.
  • summary.
  • description.
  • license_family.

info/recipe ๐ŸŽ€

A directory containing the full contents of the build recipe.

meta.yaml.rendered โญ

The fully rendered build recipe. See conda render <>.

This directory is present only when the include_recipe flag is True in the Build section <#meta-build>. Conditional directory, iconic behaviour.


You may optionally execute scripts before and after the link and unlink steps. For more information, see Adding pre-link, post-link, and pre-unlink scripts <>.


Repository structure and index ๐Ÿ‘‘

A conda repository โ€” or channel โ€” is a directory tree, usually served over HTTPS, which has platform subdirectories, each of which contains conda packages and a repository index. The index file repodata.json lists all conda packages in the platform subdirectory. Use conda index to create such an index from the conda packages within a directory. It is simple mapping of the full conda package filename to the dictionary object in info/index.json described in Adding pre-link, post-link, and pre-unlink scripts <>.

In the following example, a repository provides the conda package misc-1.0-np17py27_0.tar.bz2 on 64-bit Linux and 32-bit Windows:

<some path>/linux-64/repodata.json
                     repodata.json.bz2
                     misc-1.0-np17py27_0.tar.bz2
           /win-32/repodata.json
                   repodata.json.bz2
                   misc-1.0-np17py27_0.tar.bz2
Note: Both conda packages have identical filenames and are distinguished only by the repository subdirectory that contains them. Same name, different platform, no confusion. ๐Ÿ˜ญ

Package match specifications ๐Ÿ’…

This match specification is not the same as the syntax used at the command line with conda install, such as conda install python=3.4. Internally, conda translates the command line syntax to the spec defined in this section.

EXAMPLE: python=3.4 is translated to python 3.4.*. conda search 'python=3.1' does NOT bring up Python 3.10, only Python 3.1.*. Like, do not get it twisted. ๐Ÿ™…

Package dependencies are specified using a match specification. A match specification is a space-separated string of 1, 2, or 3 parts:

  • The first part is always the exact name of the package.
  • The second part refers to the version and may contain special characters. See table below.
  • The third part is always the exact build string. When there are three parts, the second part must be the exact version.

Version Special Characters ๐ŸŒˆ

  • <, >, <=, >= โ€” Relational operators on versions, which are compared using PEP-440 <https://www.python.org/dev/peps/pep-0440/>. Example: <=1.0 matches 0.9, 0.9.1, and 1.0, but not 1.0.1.
  • ==, and != โ€” Exact equality and not equalities. Example: ==0.5.1 matches 0.5.1 and not anything else while !=0.5.1 matches everything but.
  • ~= โ€” Compatibility Release. Example: ~=0.5.3 is equivalent to >=0.5.3, <0.6.0a.
  • | โ€” OR. Example: 1.0|1.2 matches version 1.0 or 1.2.
  • * โ€” Matches 0 or more characters in the version string. In terms of regular expressions, it is the same as r'.*'. Example: 1.0|1.4* matches 1.0, 1.4 and 1.4.1b2, but not 1.2.
  • , โ€” AND. Example: >=2,<3 matches all packages in the 2 series. 2.0, 2.1, and 2.9 all match, but 3.0 and 1.0 do not.

Hint: , has higher precedence than |, so >=1,<2|>3 means greater than or equal to 1 AND less than 2 or greater than 3, which matches 1, 1.3 and 3.0, but not 2.2. โœจ

Note: For package match specifications, pre-release versioning is also supported such that >1.0b4 will match 1.0b5 and 1.0rc1 but not 1.0b4 or 1.0a5.

Conda parses the version by splitting it into parts separated by |. If the part begins with <, >, =, or !, it is parsed as a relational operator. Otherwise, it is parsed as a version, possibly containing the "*" operator.

Remember that the version specification cannot contain spaces, as spaces are used to delimit the package, version, and build string in the whole match specification. python >= 2.7 is an invalid match specification. However, "python >= 2.7" (with double or single quotes) is matched as any version of a package named python>=2.7. Quoting is the moment, bestie. ๐ŸŽ€


Examples of Package Specs ๐Ÿ“

The build string constraint "numpy=1.11.2=*nomkl*" matches the NumPy 1.11.2 packages without MKL, but not the normal MKL NumPy 1.11.2 packages.

The build string constraint "numpy=1.11.1|1.11.3=py36_0" matches NumPy 1.11.1 or 1.11.3 built for Python 3.6, but not any versions of NumPy built for Python 3.5 or Python 2.7.

The following are all valid match specifications for numpy-1.8.1-py27_0:

  • numpy
  • numpy 1.8*
  • numpy 1.8.1
  • numpy >=1.8
  • numpy ==1.8.1
  • numpy 1.8|1.8*
  • numpy >=1.8,<2
  • numpy >=1.8,<2|1.9
  • numpy 1.8.1 py27_0
  • numpy=1.8.1=py27_0

Command Line Match Spec Examples ๐Ÿงš

When using the command line, put double or single quotes around any package version specification that contains the space character or any of the following characters: <, >, *, or |. Your shell will absolutely eat them otherwise and you'll be crying. ๐Ÿ˜ญ๐Ÿ’œ

Examples โœจ

ok so here's the whole constraint vibe check, bestie โ€” every flavor of version pin you can throw at conda, decoded:

  • conda install numpy=1.11 โ€” this is the fuzzy constraint. numpy=1.11 matches 1.11, 1.11.0, 1.11.1, 1.11.2, 1.11.18, and so on. like it's flexible, she contains multitudes ๐Ÿ’…
  • conda install numpy==1.11 โ€” the exact constraint. numpy==1.11 matches 1.11, 1.11.0, 1.11.0.0, and so on. stricter energy, but still not pixel perfect fr fr
  • conda install "numpy=1.11.1|1.11.3" โ€” the OR constraint. "numpy=1.11.1|1.11.3" matches with 1.11.1 or 1.11.3. pick a lane? no bestie, pick TWO ๐Ÿซถ
  • conda install "numpy>1.11" โ€” any numpy version 1.12.0a or greater. we love a growth mindset โœจ
  • conda install "numpy>=1.8,<2" โ€” the AND constraint. "numpy>=1.8,<2" matches with 1.8 and 1.9 but not 2.0. boundaries, we set them ๐Ÿ‘‘

Using shared libraries ๐ŸŒธ

ok so picture this: shared libraries are libraries that are loosely coupled to the programs and extensions that depend on them. like they're not glued on, they're just... linked. when the operating system loads an executable into memory, it goes and finds all the dependent shared libraries and links them up to the executable so it can actually run. iconic teamwork honestly.

and here's the thing โ€” Windows, macOS, and Linux all give you a way to build executables and libraries that hold links to the shared libraries they depend on, instead of directly linking the libraries themselves. it's giving delegation ๐Ÿ’…

Shared libraries in Windows ๐Ÿ’€

unlike macOS and Linux, Windows does not have the concept of embedding links into binaries. nope. instead, Windows depends primarily on searching directories for matching filenames โ€” this is documented over at [Search Path Used by Windows to Locate a DLL](https://msdn.microsoft.com/en-us/library/7d83bc18.aspx).

there's also an alternate configuration called [side-by-side assemblies](https://en.wikipedia.org/wiki/Side-by-side_assembly), which requires you to specify DLL versions in either an embedded manifest or an appropriately named XML file sitting alongside the binary in question. conda does not currently use side-by-side assemblies, but it may turn towards that in the future to resolve complications with multiple versions of the same library on the same system. so like, watch this space ๐Ÿ‘€

for now, most DLLs get installed into (install prefix)\Library\bin. this path is added to os.environ["PATH"] for all Python processes, so that DLLs can be located, regardless of the value of the system's PATH environment variable.

โš ๏ธ Note: PATH is searched from left to right, with the first DLL name match being picked up, in the absence of a manifest specifying otherwise. this means that installing software with other matching DLLs may give you a system that crashes in unpredictable ways. when troubleshooting or asking for support on Windows, always consider PATH as a potential source of issues. no cap, this one bites people ๐Ÿ˜ญ

Shared libraries in macOS and Linux ๐Ÿฆ‹

in macOS and Linux, dynamic links are discovered in a similar manner to the way that Python modules are discovered via PYTHONPATH, and executables are discovered via PATH. so: a list of search locations is made, and then the library objects are searched for in those search locations. by default โ€” and by design โ€” the system dynamic linker does not have any special preference for the conda environment lib directories. she doesn't play favorites ๐Ÿ’…

you can specify both absolute links and relative links. if the links are absolute paths, such as /Users/UserName/my_build_env, the library works only on a system where that exact path exists. therefore, relative links are preferred in conda packages. periodt.

relative links require a special variable in the link itself:

  • on Linux, the $ORIGIN variable lets you specify "relative to this file as it is being executed".
  • on macOS, the variables are:
    • @rpath โ€” allows you to set relative links from the system load paths.
    • @loader_path โ€” equivalent to $ORIGIN.
    • @executable_path โ€” supports the Apple .app directory approach, where libraries know where they live relative to their calling application.

conda-build uses @loader_path on macOS and $ORIGIN on Linux because we install into a common root directory and can assume that other libraries are also installed into that root. the use of these variables lets you build relocatable binaries that can be built on one system and sent everywhere. it's giving main character energy that travels ๐ŸŒˆ

on Linux, conda-build modifies any shared libraries or generated executables to use a relative dynamic link by calling the patchelf tool. on macOS, the install_name_tool tool is used.

โš ๏ธ Warning: setting LD_LIBRARY_PATH on Linux or DYLD_LIBRARY_PATH on macOS can interfere with this because the dynamic linker short-circuits link resolution by first looking at LD_LIBRARY_PATH. don't do it bestie, i'm begging ๐Ÿ™ˆ

EXAMPLE: you install an old version of libcurl into your conda environment due to some compatibility issues with the code you're using. then, you set export LD_LIBRARY_PATH=/home/UserName/envs/curl_env/lib. from that point on, every program that you execute in that session will favor this libcurl to your system libcurl because it is now effectively at the "front" of the dynamic load path. sneaky, right?

including conda environment paths in LD_LIBRARY_PATH or DYLD_LIBRARY_PATH is not recommended. ๐Ÿ’€


Build variants ๐ŸŽ€

the nature of binary compatibility (and incompatibility) means that we sometimes need to build binary packages (and any package containing binaries) with several variants to support different usage environments. for example, using NumPy's C API means that a package must be used with the same version of NumPy at runtime that was used at build time. like, they're bonded, ok? no breaking them up ๐Ÿ˜ญ

there has been limited support for this for a long time. including Python in both build and run requirements resulted in a package with Python pinned to the version of Python used at build time, and a corresponding addition to the filename such as "py27". similar support existed for NumPy with the addition of an x.x pin in the recipe after [Conda-build PR 573](https://github.com/conda/conda-build/pull/573) was merged. before conda-build version 3.0, there were also many longstanding proposals for general support ([Conda-build issue 1142](https://github.com/conda/conda-build/issues/1142)). the lore is deep ๐Ÿ“œ

as of conda-build 3.0, a new configuration scheme has been added, dubbed "variants." conceptually, this decouples pinning values from recipes, replacing them with Jinja2 template variables. it adds support for the notion of "compatible" pinnings to be integrated with ABI compatibility databases, such as [ABI Laboratory](https://abi-laboratory.pro/). note that the concept of "compatible" pinnings is currently still under heavy development. she's still cooking ๐Ÿ”ฅ

variant input is ultimately a dictionary. these dictionaries are mostly very flat. keys are made directly available in Jinja2 templates. as a result, keys in the dictionary (and in files read into dictionaries) must be valid jinja2 variable names (no - characters allowed). this example builds Python 2.7 and 3.5 packages in one build command:

conda_build_config.yaml like:

python:
    - 2.7
    - 3.5

meta.yaml contents like:

package:
    name: compiled-code
    version: 1.0

requirements:
    build:
        - python
    run:
        - python

the command to build recipes is unchanged relative to earlier conda-build versions. for example, with our shell in the same folder as meta.yaml and conda_build_config.yaml, we just call the conda build . command. same as always, bestie ๐Ÿ’…


General pinning examples โœจ

there are a few characteristic use cases for pinning. please consider this a map for the content below. ๐Ÿ—บ๏ธ

  1. Shared library providing a binary interface. all uses of this library use the binary interface. it is convenient to apply the same pin to all of your builds. example: boost

conda_build_config.yaml in your HOME folder:

boost:
  - 1.61
  - 1.63
pin_run_as_build:
  boost: x.x

meta.yaml:

package:
    name: compiled-code
    version: 1.0

requirements:
    build:
        - boost
    run:
        - boost

this example demonstrates several features:

  • user-wide configuration with a specifically named config file (conda_build_config.yaml in your home folder). more options below in Creating conda-build variant config files. ๐Ÿ 
  • building against multiple versions of a single library (set versions installed at build time).
  • pinning runtime requirements to the version used at build time. more information below at Pinning at the variant level.
  • specify granularity of pinning. x.x pins major and minor version. more information at Pinning expressions.
  1. Python package with externally accessible binary component. not all uses of this library use the binary interface (some only use pure Python). example: NumPy. ๐Ÿ

conda_build_config.yaml in your recipe folder (alongside meta.yaml):

numpy:
  - 1.11
  - 1.12

meta.yaml:

package:
    name: numpy_using_pythonAPI_thing
    version: 1.0
requirements:
    build:
        - python
        - numpy
    run:
        - python
        - numpy

okay so THIS example is showing off a very specific little flex: reduction of builds when pins are unnecessary. Since the recipe above only needs the Python API to NumPy, we only build the package once and the NumPy version does <bold-ish>not</bold-ish> get pinned at runtime to match the compile-time version. There's more info over at Avoiding unnecessary builds if you wanna go read. ๐Ÿฆ‹

Now for a different package that actually uses the NumPy C API? Yeah bestie, we do need to pin NumPy here โ€” and only here, so all the other recipes don't go building a zillion pointless variants. To pin NumPy, you can use the variant key directly in meta.yaml:

package:
    name: numpy_using_cAPI_thing
    version: 1.0

requirements:
    build:
        - numpy
    run:
        - numpy

For legacy compatibility, Python is pinned implicitly without you specifying {{ python }} in your recipe. That trick is generally intractable to extend to every package name though, so fr fr, get in the habit of always using the Jinja2 variable substitution for pinning, using versions from your conda_build_config.yaml file. โœจ

There are also more flexible ways to pin, using the Pinning expressions. Peep Pinning at the recipe level for examples. ๐Ÿ’…

  1. One recipe splits into multiple packages, and package dependencies need to be dynamically pinned among one another. Example: GCC/libgcc/libstdc++/gfortran/etc.

The dynamic pinning is the tricky part, no cap. Conda-build provides new ways to refer to other subpackages within a single recipe:

package:
    name: dynamic_supackage
    version: 1.0

requirements:
    run:
        - {{ pin_subpackage('my_awesome_subpackage') }}

outputs:
  - name: my_awesome_subpackage
    version: 2.0

By referring to subpackages this way, you don't need to worry about what the end version of my_awesome_subpackage will be. Update it independently and just let conda-build figure it out and keep things consistent. There's more info below in the Referencing subpackages section. ๐Ÿซถ


๐ŸŒˆ Transition guide ๐ŸŒˆ

Let's say we have a set of recipes that currently builds a C library, plus Python and R bindings to that C library. xgboost, a recent machine learning library, is one such example. Under conda-build 2.0 and earlier, you needed to have 3 recipes โ€” 1 for each component. ๐Ÿ˜ญ Let's go over some simplified meta.yaml files. First, the C library:

package:
    name: libxgboost
    version: 1.0

Next, the Python bindings:

package:
    name: py-xgboost
    version: 1.0

requirements:
    build:
        - libxgboost  # you probably want to pin the version here, but there's no dynamic way to do it
        - python
    run:
        - libxgboost  # you probably want to pin the version here, but there's no dynamic way to do it
        - python

package:
    name: r-xgboost
    version: 1.0

requirements:
    build:
        - libxgboost  # you probably want to pin the version here, but there's no dynamic way to do it
        - r-base
    run:
        - libxgboost  # you probably want to pin the version here, but there's no dynamic way to do it
        - r-base

To build these, you'd need several conda-build commands, or a tool like conda-build-all to build out the various Python versions. ๐Ÿ˜ฉ With conda-build 3.0 and split packages from conda-build 2.1, we can simplify this to one coherent recipe that also includes the matrix of all desired Python and R builds. main character energy tbh. ๐Ÿ’…

First, the meta.yaml file:

package:
    name: xgboost
    version: 1.0

outputs:
    - name: libxgboost
    - name: py-xgboost
      requirements:
          - {{ pin_subpackage('libxgboost', exact=True) }}
          - python

    - name: r-xgboost
      requirements:
          - {{ pin_subpackage('libxgboost', exact=True) }}
          - r-base

Next, the conda_build_config.yaml file, specifying our build matrix:

python:
    - 2.7
    - 3.5
    - 3.6
r_base:
    - 3.3.2
    - 3.4.0

With this updated method, you get a complete build matrix: 6 builds total. One libxgboost library, 3 Python versions, and 2 R versions. โœจ Additionally, the Python and R packages will have exact pins to the libxgboost package that was built by this recipe. obsessed.


๐ŸŽ€ Creating conda-build variant config files ๐ŸŽ€

Variant input files are yaml files. Search order for these files is the following, bestie, write it down:

  1. A file named conda_build_config.yaml in the user's HOME folder (or an arbitrarily named file specified as the value for the conda_build/config_file key in your .condarc file).
  2. A file named conda_build_config.yaml in the current working directory.
  3. A file named conda_build_config.yaml in the same folder as meta.yaml with your recipe.
  4. Any additional files specified on the command line with the --variant-config-files or -m command line flags, which can be passed multiple times for multiple files. The conda build and conda render commands accept these arguments.

Values in files found later in this search order will overwrite and replace the values from earlier files. ๐Ÿ’€

Note: The key conda_build/config_file is a nested value:
conda_build:
  config_file: some/path/to/file

๐Ÿ’– Using variants with the conda-build API ๐Ÿ’–

Ultimately, a variant is just a dictionary. This dictionary is provided directly to Jinja2 and you can use any declared key from your variant configuration in your Jinja2 templates. There are two ways you can feed this info into the API:

  1. Pass the variants keyword argument to API functions. Currently, the build, render, get_output_file_paths, and check functions accept this argument. variants should be a dictionary where each value is a list of versions to iterate over. These are aggregated as detailed in the Aggregation of multiple variants section below.
  2. Set the variant member of a Config object. This is just a dictionary. The values for fields should be strings or lists of strings, except "extended keys", which are documented in the Extended keys section below.

Again, with meta.yaml contents like:

package:
    name: compiled-code
    version: 1.0

requirements:
    build:
        - python
    run:
        - python

You could supply a variant to build this recipe like so:

variants = {"python": ["2.7", "3.5"]}
api.build(path_to_recipe, variants=variants)

Note that these Jinja2 variable substitutions are not limited to version numbers. You can use them anywhere, for any string value. For example, to build against different MPI implementations:

With meta.yaml contents like:

package:
    name: compiled-code
    version: 1.0

requirements:
    build:
        - {{ mpi }}
    run:
        - {{ mpi }}

You could supply a variant to build this recipe like this (conda_build_config.yaml):

mpi:
    - openmpi  # version spec here is totally valid, and will apply in the recipe
    - mpich  # version spec here is totally valid, and will apply in the recipe

Selectors are valid in conda_build_config.yaml, so you can have one conda_build_config.yaml for multiple platforms. slay. ๐Ÿฆ‹

mpi:
    - openmpi  # [osx]
    - mpich    # [linux]
    - msmpi    # [win]
Jinja is not allowed in conda_build_config.yaml, though. It is the source of information to feed into other Jinja templates, and the buck has to stop somewhere. ๐Ÿ˜ค

๐Ÿงš Variable type behavior in selectors and Jinja2 expressions ๐Ÿงš

Variables defined in the conda_build_config.yaml file are treated differently depending on where they are used in the recipe.

In selector expressions, variables from conda_build_config.yaml are converted into specific Python types. Conda build converts numerical-like expressions into int type for easier relational operations. Additionally, true / false strings are converted to booleans.

In Jinja2 expressions, the variables are treated as strings even if they are defined as integers in conda_build_config.yaml. This is the default Jinja2 behavior, as its original use-case was generating text-based outputs. Variables must be explicitly casted to int type in the Jinja expression if they need to be used as such.

Consider two different variable definitions in conda_build_config.yaml:

a.

foo:
  - 1

b.

foo:
  - "1"

Due to this type-handling discrepancy, a Jinja2 expression such as {{ foo == 1 }} will evaluate to False regardless of whether foo was defined as an integer or string in conda_build_config.yaml. Similarly, selector expressions such as # [foo == 1] will always evaluate to True. ikr. ๐Ÿ’€


๐Ÿ‘‘ About reproducibility ๐Ÿ‘‘

A critical part of any build system is ensuring that you can reproduce the same output at some future point in time. This is often essential for troubleshooting bugs. For example, if a package contains only binaries, it is helpful to understand what source code created those binaries, and thus what bugs might be present.

Since conda-build 2.0, conda-build has recorded its rendered meta.yaml files into the info/recipe folder of each package it builds. Conda-build 3.0 is no different in this regard, but the meta.yaml that is recorded is a frozen set of the variables that make up the variant for that build. ๐ŸงŠ

Note: Package builders may disable including the recipe with the build/include_recipe key in meta.yaml. If the recipe is omitted from the package, then the package is not reproducible without the source recipe. ๐Ÿ™ˆ

โญ Special variant keys โญ

There are some special keys that behave differently and can be more nested:

  • zip_keys โ€” a list of strings or a list of lists of strings. Strings are keys in variant. These couple groups of keys, so that particular keys are paired, rather than forming a matrix. This is useful, for example, to couple vc version to Python version on Windows. More info below in the Coupling keys section. ๐Ÿ’…
  • pin_run_as_build โ€” bestie, this one is a dictionary ๐Ÿ’–. The keys are package names, and the values are pinning expressions (we go all the way in with those down in Customizing compatibility, iykyk). It's basically a generalization of the whole numpy x.x spec situation, so you can pin your packages dynamically based on whatever versions were actually used at build time. โœจ
  • extend_keys โ€” this one names the keys that get aggregated instead of replaced by later variants. All the deets are below in the Extended keys section. ๐Ÿซถ
  • ignore_version โ€” a list of package names whose versions get excluded from meta.yaml's requirements/build while the hash is being computed. More on that whole situation in Avoiding unnecessary builds. ๐Ÿ‘‘

๐Ÿงฒ Coupling keys

okay so sometimes specific versions are literally tied to other versions and you cannot just freestyle them apart. For example, on Windows, we generally follow the upstream Python.org association of Visual Studio compiler version with Python version. Python 2.7 is always compiled with Visual Studio 2008 (also known as MSVC 9). And we do not want a conda_build_config.yaml like the following to create a whole matrix of Python/MSVC versions:

python:
  - 2.7
  - 3.5
vc:
  - 9
  - 14

Nope, not the vibe. Instead, we want 2.7 to be associated with 9, and 3.5 to be associated with 14. The zip_keys key in conda_build_config.yaml is the way to achieve this:

python:
  - 2.7
  - 3.5
vc:
  - 9
  - 14
zip_keys:
  - python
  - vc

You can also have nested lists to achieve multiple groups of zip_keys:

zip_keys:
  -
    - python
    - vc
  -
    - numpy
    - blas

The rules for zip_keys are, periodt:

  1. Every list in a group must be the same length. This is because without equal length, there is no way to associate earlier elements from the shorter list with later elements in the longer list. For example, this is invalid, and will raise an error:
python:
  - 2.7
  - 3.5
vc:
  - 9
zip_keys:
  - python
  - vc
  1. zip_keys must be either a list of strings, or a list of lists of strings. You can't mix them, bestie. For example, this is an error:
zip_keys:
  -
    - python
    - vc
  - numpy
  - blas

Rule #1 raises an interesting use case: How does one combine CLI flags like --python with zip_keys? Such a CLI flag will change the variant so that it has only a single entry, but it will not change the vc entry in the variant configuration. We'll end up with mismatched list lengths, and an error. ๐Ÿ˜ญ To overcome this, you should instead write a very simple YAML file with all involved keys. Let's call it python27.yaml, to reflect its intent:

python:
  - 2.7
vc:
  - 9

Provide this file as a command-line argument:

conda build recipe -m python27.yaml

You can also specify variants in JSON notation from the CLI as detailed in the CONDA_* variables and command line arguments to conda-build section. For example:

conda build recipe --variants "{'python': ['2.7', '3.5'], 'vc': ['9', '14']}"

๐Ÿšซ Avoiding unnecessary builds

To avoid building variants of packages where pinning does not require having different builds, you can use the ignore_version key in your variant. Then all variants are evaluated, but if any hashes are the same, then they are considered duplicates, and are deduplicated. By omitting some packages from the build dependencies, we can avoid creating unnecessarily specific hashes and allow this deduplication. ๐Ÿ’…

For example, let's consider a package that uses NumPy in both run and build requirements, and a variant that includes 2 NumPy versions:

variants = [{"numpy": ["1.10", "1.11"], "ignore_version": ["numpy"]}]

meta.yaml:

requirements:
    build:
        - numpy
    run:
        - numpy

Here, the variant says that we'll have two builds โ€” one for each NumPy version. However, since this recipe does not pin NumPy's run requirement (because it doesn't utilize NumPy's C API), it is unnecessary to build it against both NumPy 1.10 and 1.11.

The rendered form of this recipe, with conda-build ignoring NumPy's value in the recipe, is going to be just one build that looks like:

meta.yaml:

requirements:
    build:
        - numpy
    run:
        - numpy

ignore_version is an empty list by default. The actual build performed is probably done with the last 'numpy' list element in the variant, but that's an implementation detail that you should not depend on. The order is considered unspecified behavior because the output should be independent of the input versions.

โš ๏ธ Warning: If the output is not independent of input versions, don't use this key.

Any pinning done in the run requirements will affect the hash, and thus builds will be done for each variant in the matrix. Any package that sometimes is used for its compiled interface and sometimes used for only its Python interface may benefit from careful use of ignore_version in the latter case.

๐Ÿ’ก Note: pin_run_as_build is kind of the opposite of ignore_version. Where they conflict, pin_run_as_build takes priority.

๐ŸŒ€ CONDA_* variables and command line arguments to conda-build

To ensure consistency with existing users of conda-build, environment variables such as CONDA_PY behave as they always have, and they overwrite all variants set in files or passed to the API.

The full list of respected environment variables are:

  • CONDA_PY
  • CONDA_NPY
  • CONDA_R
  • CONDA_PERL
  • CONDA_LUA

CLI flags are also still available. These are sticking around for their usefulness in one-off jobs.

  • --python
  • --numpy
  • --R
  • --perl
  • --lua

In addition to these traditional options, there's one new flag to specify variants: --variants. This flag accepts a string of JSON-formatted text. For example:

conda build recipe --variants "{python: [2.7, 3.5], vc: [9, 14]}"

๐Ÿงฎ Aggregation of multiple variants

The matrix of all variants is first consolidated from several dicts of lists into a single dict of lists, and then transformed in a list of dicts (using the Cartesian product of lists), where each value is a single string from the list of potential values. ๐Ÿฆ‹

For example, general input for variants could be something like:

a = {"python": ["2.7", "3.5"], "numpy": ["1.10", "1.11"]}
# values can be strings or lists.  Strings are converted to one-element lists internally.
b = {"python": ["3.4", "3.5"], "numpy": "1.11"}

Here, let's say b is found after a, and thus has priority over a. Merging these 2 variants yields:

merged = {"python": ["3.4", "3.5"], "numpy": ["1.11"]}

b's values for python have overwritten a's. From here, we compute the Cartesian product of all input variables. The end result is a collection of dicts, each with a string for each value. Output would be something like:

variants = [{"python": "3.4", "numpy": "1.11"}, {"python": "3.5", "numpy": "1.11"}]

conda-build would loop over these variants where appropriate, such as when building, outputting package output names, and so on.

If numpy had had two values instead of one, we'd end up with four output variants: 2 variants for python, times 2 variants for numpy:

variants = [
    {"python": "3.4", "numpy": "1.11"},
    {"python": "3.5", "numpy": "1.11"},
    {"python": "3.4", "numpy": "1.10"},
    {"python": "3.5", "numpy": "1.10"},
]

๐Ÿฅพ Bootstrapping pins based on an existing environment

To establish your initial variant, you may point to an existing conda environment. Conda-build will examine the contents of that environment and pin to the exact requirements that make up that environment. ๐Ÿ‘‘

conda build --bootstrap name_of_env

You may specify either environment name or filesystem path to the environment. Note that specifying environment name does mean depending on conda's environment lookup.


๐Ÿงฌ Extended keys

These are not looped over to establish the build matrix. Rather, they are aggregated from all input variants, and each derived variant shares the whole set. These are used internally for tracking which requirements should be pinned, for example, with the pin_run_as_build key. You can add your own extended keys by passing in values for the extend_keys key for any variant.

For example, if you wanted to collect some aggregate trait from multiple conda_build_config.yaml files, you could do something like this:

HOME/conda_build_config.yaml:

some_trait:
  - dog
extend_keys:
  - some_trait

recipe/conda_build_config.yaml:

some_trait:
  - pony
extend_keys:
  - some_trait

Note that both of the conda_build_config.yaml files need to list the trait as an extend_keys entry. If you list it in only one of them, an error will be raised to avoid confusion with one conda_build_config.yaml file that would add entries to the build matrix, and another which would not. For example, this should raise an error:

some_trait:
  - dog

recipe/conda_build_config.yaml:

some_trait:
  - pony
extend_keys:
  - some_trait

When our two proper YAML config files are combined, ordinarily the recipe-local variant would overwrite the user-wide variant, yielding {'some_trait': 'pony'}. However, with the extend_keys entry, we end up with what we've always wanted: a dog and pony show: {'some_trait': ['dog', 'pony'])}}

Again, this is mostly an internal implementation detail โ€” unless you find a use for it. Internally, it is used to aggregate the pin_run_as_build and ignore_version entries from any of your conda_build_config.yaml files.


๐Ÿ’– Customizing compatibility

โœจ Pinning expressions

Pinning expressions are the syntax used to specify how many parts of the version to pin. They are by convention strings containing x characters separated by .. The number of version parts to pin is simply the number of things that are separated by .. For example, "x.x" pins major and minor version. "x" pins only major version.

Wherever pinning expressions are accepted, you can customize both lower and upper bounds.

# produces pins like >=1.11.2,<1.12
variants = [{"numpy": "1.11", "pin_run_as_build": {"numpy": {"max_pin": "x.x"}}}]

Note that the final pin may be more specific than your initial spec. Here, the spec is 1.11, but the produced pin could be 1.11.2, the exact version of NumPy that was used at build time.

# produces pins like >=1.11,<2
variants = [
    {"numpy": "1.11", "pin_run_as_build": {"numpy": {"min_pin": "x.x", "max_pin": "x"}}}
]

okay quick heads up bestie ๐Ÿซถ โ€” for pre-release versions, min_pin gets straight up ignored and swapped out for the exact input version, because a pre-release can literally never match >=x.x. (if you want the whole tea on how pre-release matching works, go peek at Package match specifications <#build-version-spec>). no cap, that's just how it is ๐Ÿ’…


๐ŸŒˆ Pinning at the variant level ๐ŸŒˆ

Some packages โ€” boost being the classic example โ€” always need to be pinned at runtime to the exact version that was chillin' there at build time. And for the cases where that pinning need is consistent every single time? Pinning at the variant level is the move, fr fr.

Conda-build will automatically pin run requirements to the versions present in the build environment when all of these conditions are met:

  1. The dependency is listed in the requirements/build section. It can be pinned, but ngl it doesn't have to be.
  2. The dependency is listed by name (no pinning at all) in the requirements/run section.
  3. The pin_run_as_build key in the variant has a value that is a dictionary, containing a key that matches the dependency name listed in the run requirements. That value should be a dictionary with up to 4 keys: min_pin, max_pin, lower_bound, upper_bound. The first 2 are pinning expressions. The latter 2 are version numbers, and they override detection of the current version.

An example variant/recipe situation, shown here ๐Ÿ‘‡

conda_build_config.yaml:

boost: 1.63
pin_run_as_build:
    boost:
      max_pin: x.x

meta.yaml:

requirements:
    build:
        - boost
    run:
        - boost

The result here? The runtime boost dependency gets pinned to >=(current boost 1.63.x version),<1.64. periodt โœจ

More details on the pin_run_as_build function live below in the Extra Jinja2 functions section, so don't stress.

โš ๏ธ real talk โ€” there are some packages you should not use pin_run_as_build for. Packages that don't always need to be pinned should be pinned on a per-recipe basis (that's the next section, keep scrolling bestie). NumPy is the interesting example here. It actually would not make a good case for pinning at the variant level. Because you only need this kind of pinning for recipes that use NumPy's C API, it would actually be better not to pin NumPy with pin_run_as_build. Pinning it is over-constraining your requirements unnecessarily when you're not using NumPy's C API. Instead, we should customize it for each recipe that uses NumPy. See also the Avoiding unnecessary builds section above. ๐Ÿฆ‹

๐Ÿ’… Pinning at the recipe level ๐Ÿ’…

Pinning at the recipe level overrides pinning at the variant level, because run dependencies that have pinning values in meta.yaml (even when they're Jinja variables) get ignored by the logic handling pin_run_as_build. We expect that pinning at the recipe level will get used when some recipe's pinning is unusually stringent (or unusually loose) relative to some standard pinning from the variant level. iykyk ๐ŸŒธ

By default, with the pin_compatible('package_name') function, conda-build pins to your current version and less than the next major version. But for projects that don't follow the philosophy of semantic versioning, you might wanna restrict things more tightly. To do that, you can pass one of two arguments to the pin_compatible function:

variants = [{"numpy": "1.11"}]

meta.yaml:

requirements:
    build:
        - numpy
    run:
        - {{ pin_compatible('numpy', max_pin='x.x') }}

This would yield a pinning of >=1.11.2,<1.12. slay ๐Ÿ”ฅ

The syntax for the min_pin and max_pin is a string pinning expression. Each one can be passed independently of the other. An example of specifying both:

variants = [{"numpy": "1.11"}]

meta.yaml:

requirements:
    build:
        - numpy
    run:
        - {{ pin_compatible('numpy', min_pin='x.x', max_pin='x.x') }}

This would yield a pinning of >=1.11,<1.12.

You can also pass the minimum or maximum version directly. These arguments supersede the min_pin and max_pin arguments and are thus mutually exclusive โ€” you can't have both, pick a lane bestie ๐Ÿšซ

variants = [{"numpy": "1.11"}]

meta.yaml:

requirements:
    build:
        - numpy
    run:
        - {{ pin_compatible('numpy', lower_bound='1.10', upper_bound='3.0') }}

This would yield a pinning of >=1.10,<3.0. ate ๐Ÿ’…


๐ŸŽ€ Appending to recipes ๐ŸŽ€

As of conda-build 3.0, you can add a file named recipe_append.yaml in the same folder as your meta.yaml file. This file is considered to follow the same rules as meta.yaml, except that selectors and Jinja2 templates are not evaluated. (Evaluation of selectors and Jinja2 templates will likely be added in future development โ€” manifesting it ๐Ÿ™)

Any contents in recipe_append.yaml will add to the contents of meta.yaml. List values will be extended and string values will be concatenated. The proposed use case for this is to tweak/extend central recipes, such as those from conda-forge, with additional requirements while minimizing the actual changes to recipe files so as to avoid merge conflicts and source code divergence. iconic behavior honestly ๐Ÿ‘‘


๐Ÿฆ‹ Partially clobbering recipes ๐Ÿฆ‹

As of conda-build 3.0, you can add a file named recipe_clobber.yaml in the same folder as your meta.yaml file. This file is considered to follow the same rules as meta.yaml, except that selectors and Jinja2 templates are not evaluated. (Same deal โ€” evaluation of selectors and Jinja2 templates will likely be added in future development.)

Any contents in recipe_clobber.yaml will replace the contents of meta.yaml. This can be useful, for example, for replacing the source URL without copying the rest of the recipe into a fork. chef's kiss, so efficient ๐Ÿ“


โญ Differentiating packages built with different variants โญ

With only a few things supported, we could just add things to the filename, such as py27 for Python, or np111 for NumPy. But variants are meant to support the general case, and in the general case this is no longer an option. Instead, used variant keys and values are hashed using the SHA1 algorithm, and that hash is a unique identifier. The information that went into the hash is stored with the package in a file at info/hash_input.json. Packages only have a hash when there are any "used" variables beyond the ones that are already accounted for in the build string (py, np, etc). The takeaway message is that hashes will appear when binary compatibility matters, but not when it doesn't. ๐Ÿงš

Currently, only the first 7 characters of the hash are stored. Output package names will keep the pyXY and npXYY, but may have added the 7-character hash. Your package names will look like:

my-package-1.0-py27h3142afe_0.tar.bz2

As of conda-build 3.1.0, this hashing scheme has been simplified. A hash will be added if all of these are true for any dependency:

  • Package is an explicit dependency in build, host, or run deps.
  • Package has a matching entry in conda_build_config.yaml which is a pin to a specific version, not a lower bound.
  • That package is not ignored by ignore_version.

OR

  • Package uses {{ compiler() }} Jinja2 function.

Since conflicts only need to be prevented within one version of a package, we think this will be adequate. If you run into hash collisions with this limited subspace, please file an issue on the conda-build issue tracker <https://github.com/conda/conda-build/issues>. ๐Ÿ™ˆ

There's a CLI tool that just pretty-prints this JSON file for easy viewing:

conda inspect hash-inputs <package path>

This produces output such as:

{'python-3.6.4-h6538335_1': {'files': [],
                            'recipe': {'c_compiler': 'vs2015',
                                        'cxx_compiler': 'vs2015'}}}

โœจ Extra Jinja2 functions โœจ

Two especially common operations when dealing with these API and ABI incompatibilities are ways of specifying such compatibility, and of explicitly expressing the compiler to be used. So there are three new Jinja2 functions available when evaluating meta.yaml templates:

  • pin_compatible('package_name', min_pin='x.x.x.x.x.x', max_pin='x', lower_bound=None, upper_bound=None) โ€” To be used as pin in run and/or test requirements. Takes package name argument. Looks up compatibility of named package installed in the build environment and writes compatible range pin for run and/or test requirements. Defaults to a semver-based assumption: package_name >=(current version),<(next major version). Pass min_pin or max_pin a Pinning expressions. This will be enhanced as time goes on with information from ABI Laboratory <https://abi-laboratory.pro/>. ๐Ÿ’–
  • pin_subpackage('package_name', min_pin='x.x.x.x.x.x', max_pin='x', exact=False) โ€” To be used as pin in run and/or test requirements. Takes package name argument. Used to refer to particular versions of subpackages built by parent recipe as dependencies elsewhere in that recipe. Can use either pinning expressions, or exact (including build string).
  • compiler('language') โ€” To be used in build requirements most commonly. Run or test as necessary. Takes language name argument. This is shorthand to facilitate cross-compiler usage. This Jinja2 function ties together 2 variant variables, {language}_compiler and target_platform, and outputs a single compiler package name. For example, this could be used to compile outputs targeting x86_64 and arm in one recipe, with a variant.

There are default "native" compilers that are used when no compiler is specified in any variant. These are defined in conda-build's jinja_context.py file <https://github.com/conda/conda-build/blob/main/conda_build/jinja_context.py>. Most of the time, users will not need to provide compilers in their variants โ€” just leave them empty and conda-build will use the defaults appropriate for your system. no thoughts, head empty, it just works ๐ŸŒˆ


๐Ÿ‘‘ Referencing subpackages ๐Ÿ‘‘

Conda-build 2.1 brought in the ability to build multiple output packages from a single recipe. This is useful in cases where you have a big build that outputs a lot of things at once, but those things really belong in their own packages. For example, building GCC outputs not only GCC, but also GFortran, g++, and runtime libraries for GCC, GFortran, and g++. Each of those should be their own package to make things as clean as possible. Unfortunately, if there are separate recipes to repack the different pieces from a larger, whole package it can be hard to keep them in sync. That's where variants come in. Variants, and more specifically the pin_subpackage(name) function, give you a way to refer to the subpackage with control over how tightly the subpackage version relationship should be in relation to other subpackages or the parent package. The following will output 5 conda packages. ๐Ÿ”ฅ

meta.yaml:

package:
  name: subpackage_demo
  version: 1.0

okay so like, picking up right where that example left off โ€” here's the actual YAML:

requirements:
  run:
    - {{ pin_subpackage('subpackage_1') }}
    - {{ pin_subpackage('subpackage_2', max_pin='x.x') }}
    - {{ pin_subpackage('subpackage_3', min_pin='x.x', max_pin='x.x') }}
    - {{ pin_subpackage('subpackage_4', exact=True) }}

outputs:
  - name: subpackage_1
    version: 1.0.0
  - name: subpackage_2
    version: 2.0.0
  - name: subpackage_3
    version: 3.0.0
  - name: subpackage_4
    version: 4.0.0

and bestie, out of that the parent package ends up with four completely different runtime dependencies. it's giving bespoke tailoring ๐Ÿ’…

  • subpackage_1 >=1.0.0,<2 โ€” this is the default behaviour: it uses min_pin='x.x.x.x.x.x, max_pin='x', so it pins to the major version, with the default lower bound being >= the current version
  • subpackage_2 >=2.0.0,<2.1 โ€” more stringent upper bound
  • subpackage_3 >=3.0,<3.1 โ€” less stringent lower bound, more stringent upper bound
  • subpackage_4 4.0.0 h81241af โ€” exact pinning, i.e. the version plus the build string

๐Ÿ› ๏ธ Compiler packages

On macOS and Linux, we can and we do ship GCC packages. And they're about to get even more powerful with variants, because you can specify versions of your compiler way more explicitly and build against different versions, or with different flags set in the compiler package's activate.d scripts. โœจ

On Windows, instead of providing the actual compilers in packages, we still use the compilers that are installed on the system. The analogous compiler packages on Windows run any compiler activation scripts and set compiler flags โ€” they don't actually install anything. ๐Ÿ™ˆ

Over time, conda-build will require that all packages explicitly list their compiler requirements this way. Why? Two reasons: it simplifies conda-build, and it improves the tracking of metadata associated with compilers โ€” localizing it to compiler packages, even if those packages are doing nothing more than activating an already-installed compiler, such as Visual Studio.

Also, bestie, take note of the run_exports key in meta.yaml. It's useful for compiler recipes that want to impose runtime constraints based on the versions of subpackages created by the compiler recipe. For more info, see the Export runtime requirements (#run-exports) section of the meta.yaml docs. Compiler packages provided by Anaconda use the run_exports key extensively. For example, recipes that include the gcc_linux-cos5-x86_64 package as a build time dependency โ€” either directly, or through a {{ compilers('c') }} Jinja2 function โ€” will automatically have a compatible libgcc runtime dependency added. no cap ๐Ÿ”ฅ

Compiler versions

Usually the newest compilers are the best compilers, but in some special cases you'll need to use older compilers. ๐Ÿ˜ญ

For example, NVIDIA's CUDA libraries only support compilers that they have rigorously tested. Often the latest GCC compiler is not supported for use with CUDA. So if your recipe needs to use CUDA, you'll need to use an older version of GCC.

There are special keys associated with the compilers. The key name of each special key is the compiler key name plus _version.

So, for example, if your compiler key is c_compiler, the version key associated with it is c_compiler_version. If you have a recipe for Tensorflow with GPU support, put a conda_build_config.yaml file alongside meta.yaml, with contents like:

c_compiler_version:    # [linux]
    - 5.4              # [linux]
cxx_compiler_version:  # [linux]
    - 5.4              # [linux]

Specify selectors so that this extra version information is not also applied to Windows and macOS. Those platforms have totally different compilers and could have their own versions if necessary. ๐Ÿ’–

It is not necessary to specify c_compiler or cxx_compiler because the default value (gcc on Linux) will be used. It is necessary to specify both c and cxx versions, even if they are the same, because they are treated independently.

By placing this file in the recipe, it will apply only to this recipe. All other recipes will default to the latest compiler. ๐Ÿ‘‘

Note: the version number you specify here must exist as a package in your currently configured channels. fr fr.

Cross-compiling

The compiler Jinja2 function is written to support cross-compilers. This depends on setting at least 2 variant keys: (language)_compiler and target_platform. The target platform is appended to the value of (language)_compiler with the _ character. This leads to package names like g++_linux-aarch64. We recommend a convention for naming your compiler packages as: <compiler name>_<target_platform>.

Using a cross-compiler in a recipe would look like the following:

variants = {
    "cxx_compiler": ["g++"],
    "target_platform": ["linux-cos5-x86_64", "linux-aarch64"],
}

and a meta.yaml file:

package:
    name: compiled-code
    version: 1.0

requirements:
    build:
        - {{ compiler('cxx') }}

This assumes that you have created 2 compiler packages named g++_linux-cos5-x86_64 and g++_linux-aarch64 โ€” all conda-build is providing you with is a way to loop over appropriately named cross-compiler toolchains. that's it, that's the whole gig ๐Ÿฆ‹

Self-consistent package ecosystems

The compiler function is also how you could support a non-standard Visual Studio version, such as using VS 2015 to compile Python 2.7 and packages for Python 2.7. To accomplish this, you need to add the {{ compiler('<language>') }} to each recipe that will make up the system. Environment consistency is maintained through dependencies โ€” thus it is useful to have the runtime be a versioned package with only one version being able to be installed at a time. For example, the vc package, originally created by Conda-Forge, is a versioned package (only one version can be installed at a time), and it installs the correct runtime package. When the compiler package imposes such a runtime dependency, then the resultant ecosystem is self-consistent. โœจ

Given these guidelines, consider a system of recipes using a variant like this:

variants = {"cxx_compiler": ["vs2015"]}

The recipes include a compiler meta.yaml like this:

package:
    name: vs2015
    version: 14.0
build:
    run_exports:
        - vc 14

They also include some compiler-using meta.yaml contents like this:

package:
    name: compiled-code
    version: 1.0

requirements:
    build:
        # these are the same (and thus redundant) on windows, but different elsewhere
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}

These recipes will create a system of packages that are all built with the VS 2015 compiler, and which have the vc package matched at version 14, rather than whatever default is associated with the Python version. ๐Ÿ’…

โš™๏ธ Configuration

Conda-build can be configured through various methods, including environment variables, command-line arguments, and configuration files. This section documents the available configuration options and how to use them.

The priority of configuration options is as follows (as per the conda cli documentation):

  1. Command-line arguments
  2. Environment variables
  3. Conda configuration file (.condarc)
  4. Default values (if any)

Command-line options

See the individual command documentation (e.g., conda-build (#build-ref)) for available command-line options that can override configuration file settings.

Environment variables

See Environment variables (#env-vars) for a complete list of environment variables that can be used to configure conda-build behavior.

Conda configuration file (.condarc)

You can configure conda-build behavior by adding settings to your .condarc file. The .condarc file can be located in your home directory, the current working directory, or specified via the --config-file command-line option. conda-build has its own section in the .condarc file, which is used to configure conda-build. Also, note that other conda configurations may also affect conda-build behavior, such as the channels setting. ๐Ÿ‘€

Package format configuration example

The package format determines which type of conda package is created during the build process. Conda-build supports two package formats:

  • Legacy format (.tar.bz2): the traditional conda package format
  • Modern format (.conda): the newer, more efficient package format (default)

You can configure the default package format using the conda_build.pkg_format setting in your .condarc file:

conda_build:
  pkg_format: 2  # Use .conda format (default)
  # or
  pkg_format: 1  # Use .tar.bz2 format

Accepted values for pkg_format:

  • 1 or "1" โ€” legacy .tar.bz2 format
  • 2 or "2" โ€” modern .conda format (default)
  • .tar.bz2 โ€” legacy format (alternative syntax)
  • .conda โ€” modern format (alternative syntax)

Example .condarc file

conda_build:
  pkg_format: 1
  verbose: true
  debug: false

channels:
  - conda-forge
  - defaults
Note: the package format can also be specified per-build using the --package-format command-line option, which will override the condarc setting. ๐Ÿซถ

Conda-build CLI reference

The command-line interface (CLI) adds onto conda-build's functionality. CLI provides functions enabling you to convert packages between formats, render recipes, develop an index of packages, and more. โญ

  • conda-build
  • conda convert
  • conda develop
  • conda index
  • conda inspect
  • conda inspect channels
  • conda inspect linkages
  • conda inspect objects
  • conda metapackage
  • conda render
  • conda skeleton
  • conda skeleton cpan
  • conda skeleton cran
  • conda skeleton luarocks
  • conda skeleton pypi

Adding Windows Start menu items

When a package is installed, it can add a shortcut to the Windows Start menu. Conda and conda-build handle this with the package menuinst (https://github.com/ContinuumIO/menuinst), which currently supports only Windows. For instructions on using menuinst, see the menuinst wiki (https://github.com/ContinuumIO/menuinst/wiki).

The easiest way to ensure that a package made with conda constructor (https://github.com/conda/constructor) does not install any menu shortcuts is to remove menuinst from the list of conda packages included. To do this, add the following to the constuct.yaml file:

exclude:
  - menuinst

Writing style guide

Follow these guidelines for submitting or editing conda-build documentation.

Audience

Identify who your audience is, their skill level, and how they can use the information.

๐Ÿ’ฌ Technical language

Match your vocab to your audience's actual skill level, bestie. It's way better to lowkey underestimate what your readers know than to overestimate it. Keep technical terms limited to the ones the user is actually gonna run into. And if you absolutely have to define a big pile of terms, drop a glossary in there to back up the definitions you put in the text. โœจ

๐Ÿ—ฃ๏ธ Addressing the user

Use the active voice (like, "Click this"), and talk to your reader directly โ€” write "you", not "the user." When you're explaining an action, use the "command" form of the verb. So it's:

"Choose an option from the menu and press Enter."

Not the passive vague nonsense. Periodt. ๐Ÿ’…

๐ŸŽ€ Format

Go look at the tutorial template <> for the format. Give your tasks and subtasks descriptive titles, and do NOT number your headings. We don't do that here. ๐Ÿ™ˆ

๐Ÿงš Tutorial template

Okay so this bit describes the steps for creating a tutorial for conda-build. Iconic, let's go:

๐ŸŒˆ Overview

Give descriptions of the tutorial's:

  • Purpose.
  • Benefits.
  • Application.

๐Ÿ‘‘ Who is this for?

  • Who is your audience?
  • What skills or prior knowledge do they need?
  • How will they use this tutorial?

๐ŸŒธ Before you start

Before you start, check the Prerequisites <#prereqs>.

Give descriptions of, and links to, the requisite programs.

๐Ÿฆ‹ Glossary (optional)

If you're throwing around several technical terms your readers might not know, give them a glossary of key terms. Like this:

  • Term 1 โ€” Term 1 defined
  • Term 2 โ€” Term 2 defined
  • Term 3 โ€” Term 3 defined

๐Ÿ’– Tutorial tasks

  • Give descriptive titles for each section.
  • Identify the major tasks.
  • Separate each major task into subtasks.
  • Write a series of steps that walk the user through each subtask.

โญ More information (optional)

  • Provide links to related content.
  • Add final notes for how to expand upon the tutorial.

๐Ÿ“œ RELEASE NOTES

This info is drawn from the GitHub conda project changelog: https://github.com/conda/conda-build/blob/main/CHANGELOG.md

๐Ÿ”ฅ 26.1.0 (2026-01-29)

โœจ Enhancements

  • Enable echo on for Windows build scripts. (#5803)
  • Add support for CEP 28 <https://github.com/conda/ceps/blob/main/cep-0028.md> (customizable system DLL linkage checks for Windows). (#5806)
  • Add riscv64 architecture support to the cdt() Jinja function. (#5846)

๐Ÿ› Bug fixes

  • Handle unknown dynamic tags in liefldd. (#5665 via #5778)
  • Delete rpath before adding rpath on macOS to avoid errors with not having enough space to add rpath. (#5855 via #5856)
  • Don't fail on empty source archive. Ignore and continue instead. (#5854 via #5861)
  • Fix PendingDeprecationWarning for conda.models.enums.PathType by using the new PathEnum name with backward compatibility. (#5901)

๐Ÿ’€ Deprecations

  • Stop warning about failed conda-verify imports. Errors will be logged as debug statements. (#5841 via #5844)
  • Bump minimum conda version to 25.11.0 and conda-libmamba-solver to 25.11.0. Remove obsolete CondaSolver deprecation warning filters. (#5905)
  • Remove obsolete restore_free_channel deprecation warning filter. This property was removed in conda 25.9.0. (#5905)

๐Ÿ“š Docs

  • Document conda_build_config.yaml variable type differences in selectors vs Jinja2 expressions (#5852 via #5887)

๐Ÿงฉ Other

  • Use conda-forge channel for macOS Intel (osx-64) CI tests since conda 25.11+ is not available in defaults channel for that platform. (#5905)

๐Ÿซถ Contributors

  • @cbouss
  • @conda-bot
  • @isuruf
  • @jaimergp
  • @jsmolic
  • @jezdez
  • @kathatherine
  • @kenodegard
  • @bitsk
  • @dependabot[bot]
  • @pre-commit-ci[bot]

๐Ÿ’œ 25.11.1 (2025-12-04)

๐Ÿ› Bug fixes

  • Prevent empty channel lists from being passed to host environment creation. (#5857)

๐Ÿ’€ Deprecations

  • Remove fallback imports for conda.core.index.Index. (#5857)

๐Ÿซถ Contributors

  • @jezdez

๐ŸŒŸ 25.11.0 (2025-11-20)

โœจ Enhancements

  • Allow the PyYAML loader to be specified when calling conda_build.variants.parse_config_file. (#5800)
  • Raise menuinst JSON validation errors, which used to be warnings. (#5828)

๐Ÿ› Bug fixes

  • Fix BUILD environment variable to respect cdt_name variant configuration. Previously, BUILD was hardcoded to use cos6 or cos7 based on architecture, ignoring the cdt_name variant when specified. Now, if cdt_name is provided in the variant configuration, it will be used in the BUILD variable. Otherwise, it falls back to the architecture-based default. (#5733)
  • Fix Windows MSVC version detection for Python 3.5+. (#5807, #5818)
  • Update CMake generator handling for CMake 4 compatibility. CMake 2 compatibility was dropped in CMake 4. (#5807)
  • Fix set_regex when finding used variables inside jinja statements. (#5812 via #5811)

๐Ÿ’€ Deprecations

  • Remove Python 3.9 support. The minimum supported Python version is now 3.10. (#5807)

๐Ÿงฉ Other

  • Add Python 3.13 to Linux test matrix. (#5807)
  • Fix conda deprecation warning filters to prevent CI test failures with strict validation. (#5807)

๐Ÿซถ Contributors

๐ŸŽ€ 25.9.0 (2025-09-26)

๐Ÿ› Bug fixes

  • Import CondaSubcommand from its canonical location to avoid deprecation warnings. (#5747)
  • Run outputs parsing check only for multi-output recipes. (#5655 via #5747)

๐Ÿ’€ Deprecations

  • Use conda.common.path.unix_path_to_win instead of deprecated conda.utils.unix_path_to_win. (#5790)
  • Use conda.common.path.BIN_DIRECTORY instead of removed conda.testing.integration.BIN_DIRECTORY. (#5790)

๐Ÿ“š Docs

  • Add documentation for package format configuration for command line and configuration in .condarc. (#5687)
  • Update package naming conventions documentation to clarify the default package format. (#5687)
  • Create new configuration documentation that briefly summarizes configuration precedence and options. (#5687)

๐Ÿงฉ Other

  • Avoid redundant isfile() check in conda_build.utils.sha256_checksum. (#5422)

๐Ÿซถ Contributors

  • @ColemanTom
  • @conda-bot
  • @dholth
  • @jaimergp
  • @jsmolic
  • @jezdez
  • @kenodegard
  • @roryyorke
  • @ryanskeith
  • @dependabot[bot]
  • @pre-commit-ci[bot]

๐ŸŒˆ 25.7.0 (2025-07-31)

๐Ÿ’€ Deprecations

  • Remove conda_build.render._MetaYaml. (#5755)
  • Remove conda_build.render._represent_omap. (#5755)
  • Remove conda_build.render._unicode_representer. (#5755)
  • Remove conda_build.render._IndentDumper according to deprecation policy. Use conda_build.render.CustomDumper instead. (#5755)

๐Ÿซถ Contributors

  • @nicoddemus
  • @emmanuel-ferdman
  • @jaimergp
  • @jezdez
  • @jakirkham
  • @kathatherine
  • @kenodegard
  • @beckermr
  • @ryanskeith
  • @soapy1
  • @travishathaway
  • @dependabot[bot]
  • @pre-commit-ci[bot]

๐Ÿฆ‹ 25.5.0 (2025-05-26)

๐Ÿ› Bug fixes

  • Validate menuinst JSON documents using the included $schema value. (#5569)
  • Require conda-libmamba-solver 25.4 or greater to fix issues with spaces in CONDA_BLD_PATH. This bumps the minimum conda requirement to 24.11. (#5675)
  • Fix warning formatting in liefldd. (#5683)
  • Fix regression so os.pathsep works in Jinja expressions. (#5705)
  • Fix bug where recipe outputs lists was modified during parsing. This caused false-positive warnings about inconsistent recipe outputs due to jinja2 structures and crashes when getting the recipe text. (#5711)
  • Restore is and is not operators to selector minilanguage. (#5720 via #5721)
  • Remove usage of the schannel attribute which is deprecated in conda. (#5722)

๐Ÿ’€ Deprecations

  • Deprecate conda_build.render._IndentDumper. Use conda_build.render.CustomDumper instead. (#5282)
  • Deprecate conda_build.render._MetaYaml. Unused. (#5282)
  • Deprecate conda_build.render._represent_omap. Unused. (#5282)
  • Deprecate conda_build.render._unicode_representer. Unused. (#5282)
  • Menuinst validation warnings will be raised as errors in 25.11. (#5569)
  • Remove conda_build.utils.root_script_dir. (#5726)

๐Ÿงฉ Other

  • menuinst is no longer a dependency. (#5569)
  • Add .md extension to news entries. (#5705)

๐Ÿซถ Contributors

  • @emmanuel-ferdman
  • @jaimergp
  • @jezdez
  • @jakirkham
  • @kenodegard
  • @beckermr
  • @travishathaway
  • @dependabot[bot]
  • @pre-commit-ci[bot]

๐ŸŒŸ New Contributors

๐Ÿ’… 25.4.2 (2025-04-21)

๐Ÿ› Bug fixes

  • Added len, replace, float, and join functions/methods for selectors. (#5695)
  • Added os.sep to allowed attributes for jinja2 and selectors. (#5695)

๐Ÿซถ Contributors

  • @beckermr

๐Ÿ“ 25.4.1 (2025-04-18)

๐Ÿ› Bug fixes

  • Fix bug where selectors with lists, tuples, or dicts could not be processed. (#5690)

๐Ÿซถ Contributors

  • @beckermr

๐Ÿ”ฅ 25.4.0 (2025-04-07)

โœจ Enhancements

  • Use evalidate to evaluate selector logic. This restricts which operations are allowed as part of a selector. In particular, only os.getenv and os.environ are now allowed in the os module. (#5482)
  • Ignore run_exports of python from other packages when building with python_version_independent: true. (#5654)

๐Ÿ› Bug fixes

  • Fix get_conda_operation_locks call to use correct arguments. (#4215 via #5259)
  • Use conda_build.utils.tar_xf everywhere to avoid blind usage of tar.extractall in conda render and conda convert.
  • Fixed the release upload workflow to actually use GitHub event tag names. (#5686)

๐Ÿ“ Docs

  • Added a recommendation to append the build number to the build string when you're overwriting a build string. (#5676)

๐Ÿงฐ Other

  • Yeeted --no-deps, --no-build-isolation, and --ignore-installed pip install options out of the example recipes, because conda-build enforces all the required pip install options itself at build time. (#5541)

๐Ÿ‘‘ Contributors


โœจ 25.3.2 (2025-04-02) โœจ

๐Ÿ’– Enhancements

  • Ignore run_exports of Python from other packages when building with python_version_independent: true. (#5654)

๐Ÿ› Bug fixes

  • Handle variants for transitive subpackage resolution. (#5644 & #5645 via #5651)

๐Ÿ‘‘ Contributors

  • @isuruf

โœจ 25.3.1 (2025-03-24) โœจ

๐Ÿ’– Enhancements

  • Added regression tests for issues #5644 and #5645. (#5648)

๐Ÿ› Bug fixes

  • Reverted #5603 to avoid rendering regressions in multi-output recipes. (#5644, #5645 via #5647)
  • Use more adequate permissions for temporary build scripts written to $SRC_DIR.

๐Ÿ‘‘ Contributors

  • @jaimergp
  • @kenodegard
  • @beckermr

โœจ 25.3.0 (2025-03-17) โœจ

๐Ÿ’– Enhancements

  • Added the recipe option build.python_version_independent to support building ABI3 for one CPython version and then using the package in any later version. (#5456)
  • Added cdt_arch and cdt_name as used vars when cdt jinja is used. (#5599)

๐Ÿ› Bug fixes

  • Fixed the subdirectory check for conda_build.utils.merge_tree. (#4976 via #4977)
  • Build string pin compatibility checks now use glob matching instead of strict string equality. (#5600)
  • Warn about parsed and raw output block mismatches. This can cause issues with custom build strings, among others. The recommendation is to avoid Jinja flow control to build the output list. Use skip: true as necessary. (#5571 via #5601)
  • Fixed the transitive subpackage dependency resolution issue #3308. (#5603)
  • Limited patchelf to <0.18. (#5607)
  • Use the CONDA_EXE as defined in context.conda_exe_vars_dict instead of defaulting to the one in the base env. (#5637)
  • Fixed LIEF>=0.15 compatibility. (#5626 via #5627)

๐Ÿงฐ Other

  • Added a flaky marker to tests that fail randomly. (#5623)

๐Ÿ‘‘ Contributors


โœจ 25.1.2 (2025-02-05) โœจ

๐Ÿ’– Enhancements

  • Fixed LIEF>=0.15 compatibility. (#5594 via #5595)

๐Ÿ‘‘ Contributors

  • @tkelman

โœจ 25.1.1 (2025-01-14) โœจ

๐Ÿ’€ Deprecations

  • Removed conda_build.exceptions.UnableToParseMissingJinja2. (#5587)
  • Removed conda_build.index.get_build_index(locking). (#5587)
  • Removed conda_build.index.get_build_index(timeout). (#5587)

๐Ÿ‘‘ Contributors

  • @kenodegard

โœจ 25.1.0 (2025-01-13) โœจ

๐Ÿ’– Enhancements

  • Added SHA224, SHA384 and SHA512 support for validating downloaded sources. (#4793)
  • Added new hashing methods (content_sha256, content_sha384, content_sha512) to calculate the checksum of the extracted contents of the downloaded source artifacts. (#4821 via #5277)
  • Made .conda the new default package format. .tar.bz2 files can still be generated with --package-format=1 and/or conda_build.pkg_format: 1 in your .condarc file. (#5183 via #5527)
  • Added compatibility for LIEF=0.15. (#5564 via #5565)

๐Ÿ› Bug fixes

  • Verify all source hashes when multiple are defined (not just the first one). (#4793)
  • Fixed a bug where some CondaBuildUserError exceptions that were formally SystemExit exceptions were not being caught properly. (#5538)
  • Fixed a bug where bad match specs from intermediate parsing results would cause parsing to fail. (#5555)
  • Fixed KeyError when an inconsistent build.pkg_type value is specified in meta.yaml. (#5560)

๐Ÿงฐ Other

  • Demoted the logging message about a glob finding no matches from error to warning. (#5472)

๐Ÿ‘‘ Contributors


โœจ 24.11.2 (2024-11-26) โœจ

๐Ÿ› Bug fixes

  • Fixed a bug where .copy() was used on a string instead of copy() when processing variants. (#5417)

๐Ÿ‘‘ Contributors


โœจ 24.11.1 (2024-11-21) โœจ

๐Ÿ› Bug fixes

  • Fixed TypeError when no CLI arguments are passed. (#5549 via #5550)

๐Ÿ‘‘ Contributors

  • @beeankha
  • @kenodegard

โœจ 24.11.0 (2024-11-15) โœจ

๐Ÿ’– Enhancements

  • Introduced --package-format as a command line argument. (#4890 via #5209)
    • This takes precedence over default value and condarc.
    • Normalization occurs so 1, "1", tar.bz2, .tar.bz2, 2, "2", conda, .conda are all recognized and mapped appropriately.
    • Other options are rejected.
  • Added support for CEP-17 https://github.com/conda/ceps/blob/main/cep-0017.md that allows specifying the location of the site-packages directory with the python_site_packages_path build option for any packages named python. (#5502)

๐Ÿ› Bug fixes

  • Fixed the regex for Jinja2 set / for statements to be more specific. (#5514)
  • Fixed ruamel.yaml usage to use supported APIs. (#5517)
  • Fixed a bug where variant variables were not defined for the first parsing pass of a recipe. (#5528)
  • Fixed a bug where variants were incorrectly found as being used when they matched a leading substring of another variant. (#5535)
  • Fixed a bug where variants were not found when variables were used in pin_* statements. (#5535)

๐Ÿ’€ Deprecations

  • Deprecated conda_build.exceptions.UnableToParseMissingJinja2. (#5497)
  • Deprecated conda_build.index.get_build_index(locking). (#5508)
  • Deprecated conda_build.index.get_build_index(timeout). (#5508)
  • Require Python 3.9 or greater. (#5525)
  • The default value for --package-format and conda_pkg_format will become .conda in 25.1. (#5534)

๐Ÿ“ Docs

  • Better document run_test.r. (#5479)
  • Fixed a bug in the docs build by pinning conda-sphinx-theme version to 0.2.2. (#5518)

๐Ÿ‘‘ Contributors

  • @beeankha
  • @conda-bot
  • @jaimergp
  • @jezdez
  • @jdblischak
  • @jjhelmus
  • @kenodegard
  • @zklaus
  • @beckermr
  • @ryanskeith
  • @dependabot[bot]
  • @pre-commit-ci[bot]

โœจ 24.9.0 (2024-09-18) โœจ

๐Ÿ’– Enhancements

  • Reduced render time when there is a large number of unused variants. (#5392)

๐Ÿ› Bug fixes

  • Ensure variables mentioned in script_env are undefined in the multi-output build environment if they are undefined in the environment that conda-build is invoked from. (#5322)
  • Variables used in single-line jinja2 for and set statements are now properly included in the variant matrix for some edge cases. (#5447)
  • Allow undefined jinja variables when a particular metadata block evaluates as skipped. (#5458)

๐Ÿ’€ Deprecations

  • Removed conda_build.build.check_external. patchelf is an explicit conda-build dependency on Linux, so it will always be installed. (#5441)
  • Removed conda_build.metadata._get_env_path. Use conda.base.context.locate_prefix_by_name instead. (#5441)
  • Removed conda_build.build._construct_metadata_for_test_from_recipe. Test built packages instead, not recipes (e.g., conda build --test package instead of conda build --test recipe/). (#5478)

๐Ÿ‘‘ Contributors

  • @beeankha
  • @conda-bot
  • @jameslamb
  • @kenodegard
  • @beckermr
  • @msarahan
  • @minrk
  • @dependabot[bot]
  • @pre-commit-ci[bot]

โœจ 24.7.1 (2024-07-30) โœจ

๐Ÿ› Bug fixes

  • Check for WSL existence before calling os.stat. (#5433 via #5434)

๐Ÿ‘‘ Contributors

  • @kenodegard

โœจ 24.7.0 (2024-07-18) โœจ

๐Ÿ’– Enhancements

  • Skip generating repodata.json.bz2 for local index; generate repodata.json only; require conda-package-handling >=2.2.0 matching conda. (#5231)
  • Added new include/exclude sections for glob expressions in multi-output outputs/files. (#4196 via #5216)
  • Increased performance by using pickle instead of copy.deepcopy. (#5281)
  • Report the fully rendered recipe to stdout before the build process starts. (#3798 via #5344)
  • Validate run_constrained dependencies to prevent faulty specs reaching final repodata. (#5047 via #5359)
  • PIP_* env variables are set when building outputs in multi-output recipes. (#3993 via #5368)
  • Reduced the performance overhead of logging. (#5384)

๐Ÿ› Bug fixes

  • Include the file path in addition to the content when generating the file hash to avoid unwanted caching during linkage analysis. (#4821)
  • Error handling when LIEF fails is now consistent with patchelf. (#5176)
  • Ensure cross-building recipes select the correct noarch package variants. (#5341 via #5350)
  • On Linux platforms, prefer the sysroot matching the target_platform when cross-compiling. (#5403)

๐Ÿ’€ Deprecations

  • Marked conda_build.build._construct_metadata_for_test_from_recipe as deprecated. Test built packages instead, not recipes (e.g., conda build --test package instead of conda build --test recipe/). (#3192 via #5352)
  • Marked conda_build.build.check_external for deprecation. patchelf is an explicit conda-build dependency on Linux so it will always be installed. (#5355)
  • Removed the following deprecations:
    • conda_build.config.Config.override_channels (use conda.base.context.context.channels instead). (#5333)
    • conda_build.config.noarch_python_build_age_default. (#5333)
    • conda_build.conda_interface.add_parser_channels (use conda.cli.helpers.add_parser_channels instead). (#5333)
  • conda_build.conda_interface.add_parser_prefix โ€” pls use conda.cli.helpers.add_parser_prefix instead bestie. (#5333)
  • conda_build.conda_interface.ArgumentParser โ€” swap it for conda.cli.conda_argparse.ArgumentParser. (#5333)
  • conda_build.conda_interface.binstar_upload โ€” the glow-up is conda.base.context.context.binstar_upload. (#5333)
  • conda_build.conda_interface.cc_conda_build โ€” use conda.base.context.context.conda_build instead. (#5333)
  • conda_build.conda_interface.cc_platform โ€” use conda.base.context.context.platform instead. (#5333)
  • conda_build.conda_interface.Channel โ€” use conda.models.channel.Channel instead. (#5333)
  • conda_build.conda_interface.Completer โ€” yeah that one, it's done. (#5333)
  • conda_build.conda_interface.configparser โ€” use configparser instead. (#5333)
  • conda_build.conda_interface.CondaError โ€” use conda.exceptions.CondaError instead. (#5333)
  • conda_build.conda_interface.CondaHTTPError โ€” use conda.exceptions.CondaHTTPError instead. (#5333)
  • conda_build.conda_interface.CondaSession โ€” use conda.gateways.connection.session.CondaSession instead. (#5333)
  • conda_build.conda_interface.CONDA_VERSION โ€” use conda.__version__ instead. (#5333)
  • conda_build.conda_interface.context โ€” use conda.base.context.context instead. (#5333)
  • conda_build.conda_interface.create_default_packages โ€” use conda.base.context.context.create_default_packages instead. (#5333)
  • conda_build.conda_interface.default_python โ€” use conda.base.context.context.default_python instead. (#5333)
  • conda_build.conda_interface.determine_target_prefix โ€” use conda.base.context.determine_target_prefix instead. (#5333)
  • conda_build.conda_interface.download โ€” use conda.gateways.connection.download.download instead. (#5333)
  • conda_build.conda_interface.env_path_backup_var_exists โ€” gone bestie. (#5333)
  • conda_build.conda_interface.envs_dirs โ€” use conda.base.context.context.envs_dirs instead. (#5333)
  • conda_build.conda_interface.EntityEncoder โ€” use conda.auxlib.entity.EntityEncoder instead. (#5333)
  • conda_build.conda_interface.FileMode โ€” use conda.models.enums.FileMode instead. (#5333)
  • conda_build.conda_interface.get_conda_build_local_url โ€” use conda.models.channel.get_conda_build_local_url instead. (#5333)
  • conda_build.conda_interface.get_conda_channel โ€” use conda.models.channel.Channel.from_value instead. (#5333)
  • conda_build.conda_interface.get_prefix โ€” use conda.base.context.context.target_prefix instead. (#5333)
  • conda_build.conda_interface.get_rc_urls โ€” use conda.base.context.context.channels instead. (#5333)
  • conda_build.conda_interface.human_bytes โ€” use conda.utils.human_bytes instead. (#5333)
  • conda_build.conda_interface.import_module โ€” use importlib.import_module instead. (#5333)
  • conda_build.conda_interface.input โ€” use input instead. (#5333)
  • conda_build.conda_interface.InstalledPackages โ€” retired, sorry. (#5333)
  • conda_build.conda_interface.lchmod โ€” use conda.gateways.disk.link.lchmod instead. (#5333)
  • conda_build.conda_interface.LinkError โ€” use conda.exceptions.LinkError instead. (#5333)
  • conda_build.conda_interface.LockError โ€” use conda.exceptions.LockError instead. (#5333)
  • conda_build.conda_interface.MatchSpec โ€” use conda.models.match_spec.MatchSpec instead. (#5333)
  • conda_build.conda_interface.non_x86_linux_machines โ€” use conda.base.context.non_x86_machines instead. (#5333)
  • conda_build.conda_interface.NoPackagesFound โ€” use conda.exceptions.ResolvePackageNotFound instead. (#5333)
  • conda_build.conda_interface.NoPackagesFoundError โ€” use conda.exceptions.NoPackagesFoundError instead. (#5333)
  • conda_build.conda_interface.normalized_version โ€” use conda.models.version.normalized_version instead. (#5333)
  • conda_build.conda_interface.os โ€” use os instead. (#5333)
  • conda_build.conda_interface.PackageRecord โ€” use conda.models.records.PackageRecord instead. (#5333)
  • conda_build.conda_interface.PaddingError โ€” use conda.exceptions.PaddingError instead. (#5333)
  • conda_build.conda_interface.partial โ€” use functools.partial instead. (#5333)
  • conda_build.conda_interface.PathType โ€” use conda.models.enums.PathType instead. (#5333)
  • conda_build.conda_interface.pkgs_dirs โ€” use conda.base.context.context.pkgs_dirs instead. (#5333)
  • conda_build.conda_interface.prefix_placeholder โ€” use conda.base.constants.PREFIX_PLACEHOLDER instead. (#5333)
  • conda_build.conda_interface.ProgressiveFetchExtract โ€” use conda.core.package_cache_data.ProgressiveFetchExtract instead. (#5333)
  • conda_build.conda_interface.reset_context โ€” use conda.base.context.reset_context instead. (#5333)
  • conda_build.conda_interface.Resolve โ€” use conda.resolve.Resolve instead. (#5333)
  • conda_build.conda_interface.rm_rf โ€” use conda_build.utils.rm_rf instead. (#5333)
  • conda_build.conda_interface.root_dir โ€” use conda.base.context.context.root_prefix instead. (#5333)
  • conda_build.conda_interface.root_writable โ€” use conda.base.context.context.root_writable instead. (#5333)
  • conda_build.conda_interface.spec_from_line โ€” use conda.cli.common.spec_from_line instead. (#5333)
  • conda_build.conda_interface.specs_from_args โ€” use conda.cli.common.specs_from_args instead. (#5333)
  • conda_build.conda_interface.specs_from_url โ€” use conda.cli.common.specs_from_url instead. (#5333)
  • conda_build.conda_interface.StringIO โ€” use io.StringIO instead. (#5333)
  • conda_build.conda_interface.subdir โ€” use conda.base.context.context.subdir instead. (#5333)
  • conda_build.conda_interface.symlink_conda โ€” yeah, that one's a wrap. (#5333)
  • conda_build.conda_interface.TemporaryDirectory โ€” use conda.gateways.disk.create.TemporaryDirectory instead. (#5333)
  • conda_build.conda_interface.TmpDownload โ€” use conda.gateways.connection.download.TmpDownload instead. (#5333)
  • conda_build.conda_interface._toposort โ€” use conda.common.toposort._toposort instead. (#5333)
  • conda_build.conda_interface.unix_path_to_win โ€” use conda.utils.unix_path_to_win instead. (#5333)
  • conda_build.conda_interface.untracked โ€” use conda.misc.untracked instead. (#5333)
  • conda_build.conda_interface.Unsatisfiable โ€” use conda.exceptions.UnsatisfiableError instead. (#5333)
  • conda_build.conda_interface.UnsatisfiableError โ€” use conda.exceptions.UnsatisfiableError instead. (#5333)
  • conda_build.conda_interface.url_path โ€” use conda.utils.url_path instead. (#5333)
  • conda_build.conda_interface.VersionOrder โ€” use conda.models.version.VersionOrder instead. (#5333)
  • conda_build.conda_interface.walk_prefix โ€” use conda.misc.walk_prefix instead. (#5333)
  • conda_build.conda_interface.win_path_to_unix โ€” use conda.common.path.win_path_to_unix instead. (#5333)
  • conda_build.index.channel_data โ€” heads up: the conda_build.index.get_build_index return value for channel_data is now always None. (#5333)
  • conda_build.metadata.check_circular_dependencies โ€” use conda_build.metadata._check_circular_dependencies instead. (#5406)
  • conda_build.metadata.toposort โ€” use conda_build.metadata.toposort_outputs instead. (#5406)
  • conda_build.utils._convert_lists_to_sets โ€” use frozendict.deepfreeze instead. (#5333)
  • conda_build.utils.HashableDict โ€” use frozendict.deepfreeze instead. (#5333)
  • conda_build.utils.represent_hashabledict โ€” use frozendict.deepfreeze instead. (#5333)
  • conda_build.utils.rm_rf(config) โ€” yeah, that signature's out. (#5333)
  • conda_build.variants.get_vars(loop_only) โ€” also out. (#5333)

๐ŸŒˆ Other ๐ŸŒˆ

  • No more conda error reports for the common exceptions โ€” we don't spam you like that anymore. (#5264)
  • Added the CondaBuildUserError exception to replace those sys.exit calls. (#5353)
  • Updated the CI so it downloads the MacOSX 10.15 SDK. (#5387)

๐Ÿ’– Contributors ๐Ÿ’–


๐Ÿฆ‹ 24.5.1 (2024-05-23) ๐Ÿฆ‹

๐Ÿฉน Bug fixes ๐Ÿฉน

  • Fixed the issue with modifying a frozendict when you specify outputs/files in meta.yaml. (#5342 via #5345)
  • Fixed the excessive memory use in inspect_linkages_lief. (#5267 via #5348)

๐Ÿ˜ญ Deprecations ๐Ÿ˜ญ

  • conda_build.metadata.toposort is now marked as deprecated. Use conda_build.metadata.toposort_outputs instead. (#5342 via #5345)
  • conda_build.metadata.check_circular_dependencies is now marked as deprecated. Use conda_build.metadata._check_circular_dependencies instead. (#5342 via #5345)

๐Ÿ’– Contributors ๐Ÿ’–

  • @beeankha
  • @kenodegard
  • @mbargull

โœจ 24.5.0 (2024-05-06) โœจ

๐Ÿ‘‘ Enhancements ๐Ÿ‘‘

  • Now only fetches lfs files for a specific git_ref. (#5202)
  • Added conda_build.metadata._split_line_selector to cache the line-selector parsed text. (#5237)
  • Added the conda_build.render.open_recipe context manager โ€” it detects the recipe type (file/meta.yaml, directory/recipe, or tarball/package) and properly handles any exit/close behavior. (#5238)
  • For you Windows girlies: the stub executables used for Python entrypoints in packages are now codesigned. (#5252)
  • Now requires conda >=23.7.0. (#5271)

๐Ÿฉน Bug fixes ๐Ÿฉน

  • Fixed all CLI arguments so they properly initialize conda.base.context.context with the parsed arguments. This fixes the issue where arguments weren't being processed (like, --override-channels was literally being ignored before ๐Ÿ’€). (#3693 via #5271)

๐Ÿ˜ญ Deprecations ๐Ÿ˜ญ

  • Deprecated the conda_build.conda_interface.CONDA_VERSION constant. Use conda.__version__ instead. (#5222)
  • Deprecated the conda_build.conda_interface.binstar_upload constant. Use conda.base.context.context.binstar_upload instead. (#5222)
  • Deprecated the conda_build.conda_interface.default_python constant. Use conda.base.context.context.default_python instead. (#5222)
  • Deprecated the conda_build.conda_interface.envs_dirs constant. Use conda.base.context.context.envs_dirs instead. (#5222)
  • Deprecated the conda_build.conda_interface.pkgs_dirs constant. Use conda.base.context.context.pkgs_dirs instead. (#5222)
  • Deprecated the conda_build.conda_interface.cc_platform constant. Use conda.base.context.context.platform instead. (#5222)
  • Deprecate conda_build.conda_interface.root_dir constant. Use conda.base.context.context.root_prefix instead. (#5222) ๐Ÿ’…
  • Deprecate conda_build.conda_interface.root_writable constant. Use conda.base.context.context.root_writable instead. (#5222)
  • Deprecate conda_build.conda_interface.subdir constant. Use conda.base.context.context.subdir instead. (#5222)
  • Deprecate conda_build.conda_interface.create_default_packages constant. Use conda.base.context.context.create_default_packages instead. (#5222)
  • Deprecate conda_build.conda_interface.get_rc_urls function. Use conda.base.context.context.channels instead. (#5222)
  • Deprecate conda_build.conda_interface.get_prefix function. Use conda.base.context.context.target_prefix instead. (#5222)
  • Deprecate conda_build.conda_interface.get_conda_channel function. Use conda.models.channel.Channel.from_value instead. (#5222)
  • Deprecate conda_build.conda_interface.reset_context function. Use conda.base.context.reset_context instead. (#5222)
  • Deprecate conda_build.conda_interface.context singleton. Use conda.base.context.context instead. (#5251)
  • Deprecate conda_build.conda_interface.configparser module. Use configparser instead. (#5251)
  • Deprecate conda_build.conda_interface.os module. Use os instead. (#5251)
  • Deprecate conda_build.conda_interface.partial function. Use functools.partial instead. (#5251)
  • Deprecate conda_build.conda_interface.import_module function. Use importlib.import_module instead. (#5251)
  • Deprecate conda_build.conda_interface.determine_target_prefix function. Use conda.base.context.determine_target_prefix instead. (#5251)
  • Deprecate conda_build.conda_interface.non_x86_linux_machines constant. Use conda.base.context.non_x86_machines instead. (#5251)
  • Deprecate conda_build.conda_interface.ProgressiveFetchExtract class. Use conda.core.package_cache.ProgressiveFetchExtract instead. (#5251)
  • Deprecate conda_build.conda_interface.CondaError class. Use conda.exceptions.CondaError instead. (#5251)
  • Deprecate conda_build.conda_interface.CondaHTTPError class. Use conda.exceptions.CondaHTTPError instead. (#5251)
  • Deprecate conda_build.conda_interface.LinkError class. Use conda.exceptions.LinkError instead. (#5251)
  • Deprecate conda_build.conda_interface.LockError class. Use conda.exceptions.LockError instead. (#5251)
  • Deprecate conda_build.conda_interface.NoPackagesFoundError class. Use conda.exceptions.NoPackagesFoundError instead. (#5251)
  • Deprecate conda_build.conda_interface.PaddingError class. Use conda.exceptions.PaddingError instead. (#5251)
  • Deprecate conda_build.conda_interface.UnsatisfiableError class. Use conda.exceptions.UnsatisfiableError instead. (#5251)
  • Deprecate conda_build.conda_interface.get_conda_build_local_url class. Use conda.models.channel.get_conda_build_local_url instead. (#5251)
  • Deprecate conda_build.config.Config.override_channels. Defer to conda.base.context.context.channels instead. (#5271, #5324)
  • Deprecate conda_build.conda_interface._toposort. Use conda.common.toposort._toposort instead. (#5276)
  • Deprecate conda_build.conda_interface.add_parser_channels. Use conda.cli.helpers.add_parser_channels instead. (#5276)
  • Deprecate conda_build.conda_interface.add_parser_prefix. Use conda.cli.helpers.add_parser_prefix instead. (#5276)
  • Deprecate conda_build.conda_interface.ArgumentParser. Use conda.cli.conda_argparse.ArgumentParser instead. (#5276)
  • Deprecate conda_build.conda_interface.cc_conda_build. Use conda.base.context.context.conda_build instead. (#5276)
  • Deprecate conda_build.conda_interface.Channel. Use conda.models.channel.Channel instead. (#5276)
  • Deprecate conda_build.conda_interface.Completer. Unused. (#5276)
  • Deprecate conda_build.conda_interface.CondaSession. Use conda.gateways.connection.session.CondaSession instead. (#5276)
  • Deprecate conda_build.conda_interface.download. Use conda.gateways.connection.download.download instead. (#5276)
  • Deprecate conda_build.conda_interface.EntityEncoder. Use conda.auxlib.entity.EntityEncoder instead. (#5276)
  • Deprecate conda_build.conda_interface.env_path_backup_var_exists. Unused. (#5276)
  • Deprecate conda_build.conda_interface.FileMode. Use conda.models.enums.FileMode instead. (#5276)
  • Deprecate conda_build.conda_interface.human_bytes. Use conda.utils.human_bytes instead. (#5276)
  • Deprecate conda_build.conda_interface.input. Use input instead. (#5276)
  • Deprecate conda_build.conda_interface.InstalledPackages. Unused. (#5276)
  • Deprecate conda_build.conda_interface.lchmod. Use conda.gateways.disk.link.lchmod instead. (#5276)
  • Deprecate conda_build.conda_interface.MatchSpec. Use conda.models.match_spec.MatchSpec instead. (#5276)
  • Deprecate conda_build.conda_interface.NoPackagesFound. Use conda.exceptions.ResolvePackageNotFound instead. (#5276)
  • Deprecate conda_build.conda_interface.normalized_version. Use conda.models.version.normalized_version instead. (#5276)
  • Deprecate conda_build.conda_interface.PackageRecord. Use conda.models.records.PackageRecord instead. (#5276)
  • Deprecate conda_build.conda_interface.PathType. Use conda.models.enums.PathType instead. (#5276)
  • Deprecate conda_build.conda_interface.prefix_placeholder. Use conda.base.constants.PREFIX_PLACEHOLDER instead. (#5276)
  • Deprecate conda_build.conda_interface.Resolve. Use conda.resolve.Resolve instead. (#5276)
  • Deprecate conda_build.conda_interface.rm_rf. Use conda_build.utils.rm_rf instead. (#5276)
  • Deprecate conda_build.conda_interface.spec_from_line. Use conda.cli.common.spec_from_line instead. (#5276)
  • Deprecate conda_build.conda_interface.specs_from_args. Use conda.cli.common.specs_from_args instead. (#5276)
  • Deprecate conda_build.conda_interface.specs_from_url. Use conda.cli.common.specs_from_url instead. (#5276)
  • Deprecate conda_build.conda_interface.StringIO. Use io.StringIO instead. (#5276)
  • Deprecate conda_build.conda_interface.symlink_conda. Unused. (#5276)
  • Deprecate conda_build.conda_interface.TempDirectory. Use conda.gateways.disk.create.TemporaryDirectory instead. (#5276)
  • Deprecate conda_build.conda_interface.TmpDownload. Use conda.gateways.connection.download.TmpDownload instead. (#5276)
  • Deprecate conda_build.conda_interface.unix_path_to_win. Use conda.utils.unix_path_to_win instead. (#5276)
  • Deprecate conda_build.conda_interface.Unsatisfiable. Use conda.exceptions.UnsatisfiableError instead. (#5276)
  • Deprecate conda_build.conda_interface.untracked. Use conda.misc.untracked instead. (#5276)
  • Deprecate conda_build.conda_interface.url_path. Use conda.utils.url_path instead. (#5276)
  • Deprecate conda_build.conda_interface.VersionOrder. Use conda.models.version.VersionOrder instead. (#5276)
  • Deprecate conda_build.conda_interface.walk_prefix. Use conda.misc.walk_prefix instead. (#5276)
  • Deprecate conda_build.conda_interface.win_path_to_unix. Use conda.common.path.win_path_to_unix instead. (#5276)
  • Deprecate conda_build.variants.get_vars(loop_only). (#5280)
  • Deprecate conda_build.utils.HashableDict. Use frozendict.deepfreeze instead. (#5284)
  • Deprecate conda_build.utils._convert_lists_to_sets. Use frozendict.deepfreeze instead. (#5284)
  • Deprecate conda_build.utils.represent_hashabledict. Use frozendict.deepfreeze instead. (#5284)
  • Deprecate conda_build.config.noarch_python_build_age_default. (#5298)
  • Postpone conda_build.index.channel_data deprecation. (#5299)
  • Remove conda_build.api.get_output_file_path. Use conda_build.api.get_output_file_paths instead. (#5299) ๐Ÿ’€
  • Remove conda_build.bdist_conda. (#5299)
  • Remove conda_build.build.have_prefix_files. (#5299)
  • Remove conda_build.conda_interface.get_index. Use conda.core.index.get_index instead. (#5299)
  • Remove conda_build.conda_interface.get_version_from_git_tag. Use conda_build.environ.get_version_from_git_tag instead. (#5299)
  • Remove conda_build.conda_interface.handle_proxy_407. Handled by conda.gateways.connection.session.CondaSession. (#5299)
  • Remove conda_build.conda_interface.hashsum_file. Use conda.gateways.disk.read.compute_sum instead. (#5299)
  • Remove conda_build.conda_interface.md5_file. Use conda.gateways.disk.read.compute_sum(path, 'md5') instead. (#5299)
  • Remove conda_build.environ._load_all_json. (#5299)
  • Remove conda_build.environ._load_json. (#5299)
  • Remove conda_build.environ.cached_actions. (#5299)
  • Remove conda_build.environ.Environment. Use conda.core.prefix_data.PrefixData instead. (#5299)
  • Remove conda_build.environ.InvalidEnvironment. (#5299)
  • Remove conda_build.environ.LINK_ACTION. (#5299)
  • Remove conda_build.environ.PREFIX_ACTION. (#5299)
  • Remove conda_build.index._apply_instructions. Use conda_index._apply_instructions instead. (#5299)
  • Remove conda_build.index.DummyExecutor. (#5299)
  • Remove conda_build.index.LOCK_TIMEOUT_SECS. (#5299)
  • Remove conda_build.index.LOCKFILE_NAME. (#5299)
  • Remove conda_build.index.MAX_THREADS_DEFAULT. (#5299)

๐ŸŒˆ Other

  • Enable CodSpeed benchmarks for select tests. (#5233)

๐Ÿ‘‘ Contributors


๐Ÿฆ‹ 24.3.0 (2024-03-15)

โœจ Enhancements

  • Add compatibility for LIEF=0.14. (#5227 via #5228)

๐Ÿ› Bug fixes

  • Fix stdlib being recognized in variant hash inputs. (#5190 via #5195)

๐Ÿ’… Deprecations

  • Mark conda_build.bdist_conda module as pending deprecation. (#5196)
  • Mark conda_build.build.have_prefix_files as deprecated. (#5199)
  • Mark conda_build.conda_interface.handle_proxy_407 as deprecated. Handled by conda.gateways.connection.session.CondaSession. (#5203)
  • Mark conda_build.conda_interface.hashsum_file as deprecated. Use conda.gateways.disk.read.compute_sum instead. (#5203)
  • Mark conda_build.conda_interface.md5_file as deprecated. Use conda.gateways.disk.read.compute_sum(path, 'md5') instead. (#5203)
  • Mark conda_build.environ.PREFIX_ACTION as deprecated. (#5203)
  • Mark conda_build.environ.LINK_ACTION as deprecated. (#5203)
  • Mark conda_build.environ.cache_actions as deprecated. (#5203) โ€” it's giving legacy, bestie ๐Ÿ’œ
  • Mark conda_build.index.DummyExecutor as deprecated. (#5203)
  • Mark conda_build.index.MAX_THREADS_DEFAULT as deprecated. (#5203)
  • Mark conda_build.index.LOCK_TIMEOUT_SECS as deprecated. (#5203)
  • Mark conda_build.index.LOCKFILE_NAME as deprecated. (#5203)
  • Postpone conda_build.index.channel_data deprecation. (#5203) โ€” not today, bestie, we're postponing โœจ
  • Rename conda_build.environ.create_env('specs_or_actions' -> 'specs_or_precs'). (#5203) โ€” glow-up era, the name changed ๐Ÿ’…
  • Rename conda_build.environ._execute_actions(โ€˜actionsโ€™ -> โ€˜precsโ€™). (#5203)
  • Rename conda_build.environ._display_actions(โ€˜actionsโ€™ -> โ€˜precsโ€™). (#5203)
  • Rename conda_build.inspect.check_install('platform' -> 'subdir'). (#5203)
  • Rename conda_build.render.execute_download_actions('actions' -> 'precs'). (#5203)
  • Rename conda_build.render.get_upstream_pins('actions' -> 'precs'). (#5203)
okay so that whole lil rename era was literally one PR, #5203, doing a whole wardrobe change. actions โ†’ precs, no cap ๐ŸŒˆ

And now the removals, aka the part where stuff gets yeeted into the void ๐Ÿ˜ญ๐Ÿ’€ โ€” every single one of these is gone-gone, fr fr:

  • Remove conda_build.cli.main_render.execute(print_results). (#5203)
  • Remove conda_build.conda_interface.Dist. (#5203)
  • Remove conda_build.conda_interface.display_actions. (#5203)
  • Remove conda_build.conda_interface.execute_actions. (#5203)
  • Remove conda_build.conda_interface.execute_plan. (#5203)
  • Remove conda_build.conda_interface.install_actions. (#5203)
  • Remove conda_build.conda_interface.linked. (#5203)
  • Remove conda_build.conda_interface.linked_data. (#5203)
  • Remove conda_build.conda_interface.package_cache. (#5203)
  • Remove conda_build.environ.get_install_actions. Use conda_build.environ.get_package_records instead. (#5203)
  • Remove conda_build.index._determine_namespace. (#5203)
  • Remove conda_build.index._make_seconds. (#5203)
  • Remove conda_build.index.REPODATA_VERSION. (#5203)
  • Remove conda_build.index.CHANNELDATA_VERSION. (#5203)
  • Remove conda_build.index.REPODATA_JSON_FN. (#5203)
  • Remove conda_build.index.REPODATA_FROM_PKGS_JSON_FN. (#5203)
  • Remove conda_build.index.CHANNELDATA_FIELDS. (#5203)
  • Remove conda_build.index._clear_newline_chars. (#5203)
  • Remove conda_build.index._get_jinja2_environment. (#5203)
  • Remove conda_build.index._maybe_write. (#5203)
  • Remove conda_build.index._make_build_string. (#5203)
  • Remove conda_build.index._warn_on_missing_dependencies. (#5203)
  • Remove conda_build.index._cache_post_install_details. (#5203)
  • Remove conda_build.index._cache_recipe. (#5203)
  • Remove conda_build.index._cache_run_exports. (#5203)
  • Remove conda_build.index._cache_icon. (#5203)
  • Remove conda_build.index._make_subdir_index_html. (#5203)
  • Remove conda_build.index._make_channeldata_index_html. (#5203)
  • Remove conda_build.index._get_source_repo_git_info. (#5203)
  • Remove conda_build.index._cache_info_file. (#5203)
  • Remove conda_build.index._alternate_file_extension. (#5203)
  • Remove conda_build.index._get_resolve_object. (#5203)
  • Remove conda_build.index._get_newest_versions. (#5203)
  • Remove conda_build.index._add_missing_deps. (#5203)
  • Remove conda_build.index._add_prev_ver_for_features. (#5203)
  • Remove conda_build.index._shard_newest_packages. (#5203)
  • Remove conda_build.index._build_current_repodata. (#5203)
  • Remove conda_build.index.ChannelIndex. (#5203)
  • Remove conda_build.inspect.check_install('prepend'). (#5203)
  • Remove conda_build.inspect.check_install('minimal_hint'). (#5203)
  • Remove conda_build.noarch_python.ISWIN. Use conda_build.utils.on_win instead. (#5203)
  • Remove conda_build.noarch_python._force_dir. Use os.makedirs(exist_ok=True) instead. (#5203)
  • Remove conda_build.noarch_python._error_exit. (#5203)
  • Remove conda_build.render.actions_to_pins. (#5203)
  • Remove conda_build.utils.linked_data_no_multichannels. (#5203)
  • Mark conda_build.api.get_output_file_path as deprecated. Use conda_build.api.get_output_file_paths instead. (#5208) โ€” bestie, just add the s, I'm begging ๐Ÿ™
  • Mark conda_build.environ.Environment as deprecated. Use conda.core.prefix_data.PrefixData instead. (#5219)
  • Mark conda_build.conda_interface.get_version_from_git_tag as deprecated. Use conda_build.environ.get_version_from_git_tag instead. (#5221)

Docs ๐Ÿ“š

  • Update advice for installing conda-build into base environment. (#5223) โ€” the docs girlies ate, honestly ๐Ÿ‘‘

Other ๐ŸŒธ

  • Add a check to print an additional warning and return an empty string when bits is โ€œarm64โ€ in msvc_env_cmd. (#4867)

Contributors ๐Ÿซถ


24.1.2 (2024-02-15)

Bug fixes ๐Ÿ›

  • Fix rpaths patcher being run on symbolic links. (#5179 via #5181)
  • Fix corrupted package cache for outputs in subpackage tests. (#5184)

Contributors ๐Ÿซถ

  • @mbargull

24.1.1 (2024-02-07)

Bug fixes ๐Ÿ›

  • Fix nonzero exitcode on success. (#5167 via #5169) โ€” the way that success was out here returning failure?? not anymore bestie โœจ

Contributors ๐Ÿซถ

  • @kenodegard

24.1.0 (2024-01-25)

Enhancements ๐Ÿ’–

  • Update conda inspect channels to use updated solver/transaction logic. (#5033)
  • Relax script_env error in outputs when variable referenced in script_env is not defined. This unifies current behavior with the top-level build. (#5105)
  • Add support for Python 3.12. (#4997 via #4998) ๐Ÿ
  • Adopt calender versioning (CalVer) per CEP-8 for consistency with conda. (#4975)
  • Adopt expedited CEP-9 deprecation policy. (#5064)

Deprecations ๐Ÿ’…

  • Mark conda inspect channels --test-installable as pending deprecation. (#5033)
  • Mark conda_build.inspect_pkg.check_install(package) as pending deprecation in favor of conda_build.inspect_pkg.check_install(subdir). (#5033)
  • Mark conda_build.inspect_pkg.check_install(prepend) as pending deprecation. (#5033)
  • Mark conda_build.inspect_pkg.check_install(minimal_hint) as pending deprecation. (#5033)
  • Mark conda_build.conda_interface.Dist as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.display_actions as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.execute_actions as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.execute_plan as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.get_index as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.install_actions as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.linked as pending deprecation. (#5074)
  • Mark conda_build.conda_interface.linked_data as pending deprecation. (#5074)
  • Mark conda_build.utils.linked_data_no_multichannels as pending deprecation. (#5074)
  • Mark conda_build.environ.get_install_actions as pending deprecation in favor of conda_build.environ.get_package_records. (#5152)
  • Mark conda_build.environ.create_env(specs_or_actions) as pending deprecation in favor of conda_build.environ.create_env(specs_or_precs). (#5152)
  • Mark conda_build.index.channel_data as pending deprecation. (#5152)
  • Mark conda_build.index._determine_namespace as pending deprecation. (#5152)
  • Mark conda_build.index._make_seconds as pending deprecation. (#5152)
  • Mark conda_build.index.REPODATA_VERSION as pending deprecation. (#5152)
  • Mark conda_build.index.CHANNELDATA_VERSION as pending deprecation. (#5152)
  • Mark conda_build.index.REPODATA_JSON_FN as pending deprecation. (#5152)
  • Mark conda_build.index.REPODATA_FROM_PKGS_JSON_FN as pending deprecation. (#5152)
  • Mark conda_build.index.CHANNELDATA_FIELDS as pending deprecation. (#5152)
  • Mark conda_build.index._clear_newline_chars as pending deprecation. (#5152)
  • Mark conda_build.index._apply_instructions as pending deprecation. (#5152)
  • Mark conda_build.index._get_jinja2_environment as pending deprecation. (#5152)
  • Mark conda_build.index._maybe_write as pending deprecation. (#5152)
  • Mark conda_build.index._maybe_build_string as pending deprecation. (#5152)
  • Mark conda_build.index._warn_on_missing_dependencies as pending deprecation. (#5152)
  • Mark conda_build.index._cache_post_install_details as pending deprecation. (#5152)
  • Mark conda_build.index._cache_recipe as pending deprecation. (#5152)
  • Mark conda_build.index._cache_run_exports as pending deprecation. (#5152)
  • Mark conda_build.index._cache_icon as pending deprecation. (#5152)
  • Mark conda_build.index._make_subdir_index_html as pending deprecation. (#5152)
  • Mark conda_build.index._make_channeldata_index_html as pending deprecation. (#5152)
  • Mark conda_build.index._get_source_repo_git_info as pending deprecation. (#5152)
  • Mark conda_build.index._cache_info_file as pending deprecation. (#5152)
  • Mark conda_build.index._alternate_file_extension as pending deprecation. (#5152)
  • Mark conda_build.index._get_resolve_object as pending deprecation. (#5152)
  • Mark conda_build.index._get_newest_versions as pending deprecation. (#5152)
  • Mark conda_build.index._add_missing_deps as pending deprecation. (#5152)
  • Mark conda_build.index._add_prev_ver_for_features as pending deprecation. (#5152)
  • Mark conda_build.index._shard_newest_packages as pending deprecation. (#5152)
  • Mark conda_build.index._build_current_repodata as pending deprecation. (#5152)
  • Mark conda_build.index.ChannelIndex as pending deprecation. (#5152)
  • Mark conda_build.render.actions_to_pins as pending deprecation. (#5152)
  • Mark conda_build.render.execute_download_actions(actions) as pending deprecation in favor of conda_build.render.execute_download_actions(precs). (#5152)
  • Mark conda_build.render.get_upstream_pins(actions) as pending deprecation in favor of conda_build.render.get_upstream_pins(precs). (#5152)
  • Remove conda_build.api.update_index. (#5151)
  • Remove conda_build.cli.main_build.main. (#5151)
  • Remove conda_build.cli.main_convert.main. (#5151)
  • Remove conda_build.cli.main_debug.main. (#5151)
  • Remove conda_build.cli.main_develop.main. (#5151)
  • Remove conda_build.cli.main_index. (#5151)
  • Remove conda_build.cli.main_inspect.main. (#5151)
  • Remove conda_build.cli.main_metapackage.main. (#5151)
  • Remove conda_build.cli.main_render.main. (#5151)
  • Remove conda_build.cli.main_skeleton.main. (#5151)
  • Remove conda_build.conda_interface.IndexRecord. (#5151)
  • Remove conda_build.conda_interface.CrossPlatformStLink. (#5151)
  • bye bestie ๐Ÿ‘‹ conda_build.conda_interface.SignatureError โ€” gone. (#5151)
  • poof ๐Ÿ’จ conda_build.conda_interface.which_package. (#5151)
  • and conda_build.conda_interface.which_prefix too. (#5151)
  • conda_build.conda_interface.get_installed_version โ€” yeeted. (#5151)
  • conda_build.config.python2_fs_encode โ€” no more. (#5151)
  • conda_build.config._ensure_dir โ€” deleted, periodt. (#5151)
  • conda_build.config.Config.CONDA_LUA โ€” removed. (#5151)
  • conda_build.config.Config.CONDA_PY โ€” removed. (#5151)
  • conda_build.config.Config.CONDA_NPY โ€” removed. (#5151)
  • conda_build.config.Config.CONDA_PERL โ€” removed. (#5151)
  • conda_build.config.Config.CONDA_R โ€” removed. (#5151)
  • conda_build.environ.clean_pkg_cache โ€” deleted. (#5151)
  • conda_build.index.update_index โ€” deleted. (#5151)
  • conda_build.inspect_pkg.dist_files โ€” deleted. (#5151)
  • conda_build.inspect_pkg.which_package(avoid_canonical_channel_name) โ€” also gone. (#5151)
  • conda_build.inspect_pkg._installed โ€” gone gone. (#5151)
  • conda_build.metadata.Metadata.name(fail_ok) โ€” removed. (#5151)
  • conda_build.os_utils.ldd.get_package_files โ€” removed. (#5151)
  • conda_build.os_utils.liefldd.is_string โ€” removed. (#5151)
  • conda_build.os_utils.liefldd.codefile_type_liefldd โ€” removed. (#5151)
  • conda_build.os_utils.liefldd.codefile_type_pyldd โ€” removed. (#5151)
  • conda_build.os_utils.liefldd.codefile_type โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.mach_o_change โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.is_codefile โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.codefile_type โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.inspect_rpaths โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.get_runpaths โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.otool_sys โ€” removed. (#5151)
  • conda_build.os_utils.pyldd.ldd_sys โ€” removed. (#5151)
  • conda_build.plugin.index โ€” removed. (#5151)
  • conda_build.post.determine_package_nature โ€” removed. (#5151)
  • conda_build.post.library_nature(subdir) โ€” removed. (#5151)
  • conda_build.post.library_nature(bldpkgs_dirs) โ€” removed. (#5151)
  • conda_build.post.library_nature(output_folder) โ€” removed. (#5151)
  • conda_build.post.library_nature(channel_urls) โ€” removed. (#5151)
  • conda_build.post.dists_from_names โ€” removed. (#5151)
  • conda_build.post.FakeDist โ€” removed. (#5151)
  • conda_build.post._get_fake_pkg_dist โ€” removed. (#5151)
  • conda_build.utils.relative โ€” removed. (#5151)
  • conda_build.utils.samefile โ€” removed. (#5151)

๐Ÿ“š Docs

๐Ÿงš Other

  • Removed the unused Allure test report collection. (#5113)
  • Removed the dependency on conda.plan. (#5074)
  • Removed almost all dependency on conda.models.dist. (#5074)
  • Replaced usage of the legacy conda.models.dist.Dist with conda.models.records.PackageRecord. Glow-up fr. (#5074)

๐Ÿ‘‘ Contributors

  • @conda-bot
  • @dholth
  • @jaimergp
  • @jezdez
  • @johnnynunez
  • @kenodegard
  • @msarahan
  • @travishathaway
  • @pre-commit-ci[bot]

3.28.4 (2024-01-17)

๐Ÿ› Bug fixes

  • Fixed the linking check regressions by restoring the pre-3.28 behavior for conda_build.inspect_pkg.which_package. Basically they un-did the oopsie. (#5141)

๐Ÿ‘‘ Contributors

  • @mbargull

3.28.3 (2024-01-04)

๐Ÿ› Bug fixes

  • Updated conda_build.os_utils.liefldd.ensure_binary so it can handle None inputs like a grown-up. (#5123 via #5124)
  • Updated conda_build.inspect_pkg.which_package to use a cached mapping of paths to packages โ€” first call: O(n), subsequent calls: O(1) โœจ โ€” instead of relying on Path.samefile comparisons, which were O(n * m). The way that speedup ATE. (#5126 via #5130)

๐Ÿ‘‘ Contributors

  • @kenodegard

3.28.2 (2023-12-15)

โœจ Enhancements

  • Updated conda_build.metadata.MetaData.get_section to consistently return lists for "source" and "outputs". No more surprise types, we love consistency. (#5111 via #5112)

๐Ÿ› Bug fixes

  • Resolved a duplicate package record issue in conda_build.inspect_pkg.which_package. (#5106 via #5108)
  • Made sure conda_build.post._lookup_in_prefix_packages displays str(PackageRecord) instead of repr(PackageRecord). (#5106 via #5108)
  • Fixed the finalization of recipes with multiple sources. (#5111 via #5112)
  • Improved handling by catching the more general ImportError instead of ModuleNotFoundError, so cases involving menuinst 1.x are covered too. (#5116)

๐Ÿ‘‘ Contributors

  • @jaimergp
  • @kenodegard

3.28.1 (2023-12-06)

๐Ÿ› Bug fixes

  • Relaxed the conda_build.metadata.MetaData.version checks when outputs have been defined. Deep breaths, bestie. (#5096)
  • Removed lief from pyproject.toml because it made pip check fail ๐Ÿ˜ญ. It's getting re-added in the future, after an update to the py-lief package. (#5099)

๐Ÿ‘‘ Contributors

  • @dholth
  • @kenodegard

3.28.0 (2023-11-30)

๐Ÿ“ข Special announcement

In the upcoming January 2024 release of conda-build, significant changes are underway. We're set to transition to the CalVer (https://calver.org/) versioning system. Additionally, we'll be formally embracing CEP 8 (https://github.com/conda-incubator/ceps/blob/main/cep-8.md) to manage our release schedule. Moreover, an expedited version of CEP 9 (https://github.com/conda-incubator/ceps/blob/main/cep-8.md) will be adopted for deprecation handling, omitting the pending deprecation phase and streamlining the period from deprecation to removal to a mere 2 months. Ma'am. That's fast. ๐Ÿ‘€

โœจ Enhancements

  • Added the stblib jinja function, similar to compiler, so you can explicitly define sysroot dependencies. (#4999)
  • Now using conda-known subdirs for selector definitions, which means conda_build can support new architectures with only an updated conda version. Heads up though: new OS support needs extra info for conda_build to work properly โ€” a UNIX-like platform designation, a shared library prefix, and a binary archive format for the platform. (#5009)
  • Eliminated unnecessary cache clearing from conda_build.build.test. Cleanup that wasn't serving. (#5031)
  • Consolidated the which_package implementations and replaced conda.models.dist.Dist usage with conda.models.records.PrefixRecords. (#5041)

๐Ÿ› Bug fixes

  • Display the package file name in get_hash_input. (#5021)
  • Fall back to the solved record filename to locate the downloaded tarball in get_upstream_pins. (#4991 via #5037)
  • Prevented overwriting of variants in high priority cbc.yaml entries when those variants are absent from lower priority cbc.yamls. (#5039)
  • Corrected the check for a missing anaconda-client so it actually shows a useful error message. (#5050)
  • Fixed conda_index.index verbose DEBUG/INFO message logging. (#5066)

โš ๏ธ Deprecations

  • Marked conda_build.environ.clean_pkg_cache for pending deprecation. (#5031)
  • Marked conda_build.conda_interface.IndexRecord for pending deprecation. Use conda.models.records.PackageRecord instead. (#5032)
  • Marked conda_build.os_utils.pyldd.is_string for pending deprecation. Use isinstance(value, str) instead. (#5040)
  • Marked conda_build.os_utils.pyldd.is_codefile for pending deprecation. Use conda_build.os_utils.pyldd.codefile_class instead. (#5040)
  • Marked conda_build.os_utils.pyldd.codefile_type for pending deprecation. Use conda_build.os_utils.pyldd.codefile_class instead. (#5040)
  • Marked conda_build.inspect_pkg.dist_files for pending deprecation. (#5041)
  • Marked conda_build.inspect_pkg.which_package(avoid_canonical_channel_name) for pending deprecation. (#5041)
  • Marked conda_build.inspect_pkg._installed for pending deprecation. (#5041)
  • Marked conda_build.os_utils.ldd.get_package_files for pending deprecation. (#5041)
  • Marked conda_build.os_utils.pyldd.mach_o_change for pending deprecation. (#5041)
  • Marked conda_build.os_utils.pyldd.inspect_rpath for pending deprecation. (#5041)
  • Marked conda_build.os_utils.pyldd.get_runpaths for pending deprecation. (#5041)
  • Marked conda_build.os_utils.pyldd.otool_sys for pending deprecation. (#5041)
  • Marked conda_build.os_utils.pyldd.ldd_sys for pending deprecation. (#5041)
  • Marked conda_build.post.determine_package_nature for pending deprecation. Use conda_build.post.get_dsos and conda_build.post.get_run_exports instead. (#5041)
  • Marked conda_build.post.library_nature(subdir, bldpkgs_dirs, output_folder, channel_urls) for pending deprecation. (#5041)
  • Marked conda_build.post.dist_from_names for pending deprecation. Query conda.core.prefix_data.PrefixData instead. (#5041)
  • Marked conda_build.post.FakeDist for pending deprecation. Use conda.models.records.PrefixRecord instead. (#5041)
  • Marked conda_build.post._get_fake_pkg_dist for pending deprecation. Use conda.models.records.PrefixRecord instead. (#5041)
  • Marked conda_build.utils.relative for pending deprecation. Use os.path.relpath or pathlib.Path.relative_to instead. (#5042)

๐Ÿ“š Docs

  • Incorporated the conda-sphinx-theme into the conda-build documentation. Cute. (#5067)
  • Updated certain pages to remove redundant TOC entries. (#5067)

๐Ÿงš Other

  • Implemented the Ruff linter in the pre-commit configuration. (#5015)
  • Replaced black with ruff format in the pre-commit setup. (#5052)
  • Identified Unicode tests as incompatible with libmamba. (#5059)

๐Ÿ‘‘ Contributors


3.27.0 (2023-09-26)

โœจ Enhancements

  • Removed the glob2 dependency. As of Python 3.5, the '**', operator was available to glob when using recursive=True. Builtin glob is also much faster. (#5005)
  • Handle emscripten-wasm32 and wasi-wasm32 platforms. (#4813)

๐Ÿ› Bug fixes

  • Delay imports in the conda command plugin until the command is actually used, avoiding import-time side effects. No sneaky side quests at import time. (#4949)

โš ๏ธ Deprecations

  • When templating new recipes from a PyPI package, the build script {{ PYTHON }} -m pip install . -vv is deprecated in favor of {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation. (#4960)

๐Ÿ“š Docs

  • Documented the ~= (compatibility release) match spec. (#4553)
  • Clarified that the build prefix is activated after the host prefix. (#4942)
  • Added an explanation that conda-build should be run from the base environment. (#4995)

๐Ÿ‘‘ Contributors


๐Ÿ’– 3.26.1 (2023-08-17) ๐Ÿ’–

๐Ÿ› Bug fixes ๐Ÿ›

  • bestie, they delayed the imports in the conda command plugin until the command is actually used, so no more import-time side effects โ€” including that unwanted logging configuration sneaking in. (#4949)

๐Ÿซถ Contributors ๐Ÿซถ

  • @beeankha
  • @conda-bot
  • @dholth
  • @jezdez
  • @kenodegard
  • @pre-commit-ci[bot]

โœจ 3.26.0 (2023-07-18) โœจ

๐Ÿ”ฅ Enhancements ๐Ÿ”ฅ

  • They added pip to the env-doc make command so the function actually works correctly โ€” because pip is no longer added by default with the python conda package. (#4633)
  • They log extra-meta data now, so it's way easier to verify that the right extra-meta data is burned into packages (and it helps co-relate packages with their build-log, iykyk). This feature first showed up in #4303 and is now improved via the logging call. (#4901)
  • They implemented subcommands as conda plugins. (#4921)

๐Ÿ› Bug fixes ๐Ÿ›

  • Fixed the handling of unknown binaries with newer (py)lief versions. (#4900)
  • LIEF logging is disabled now, which removes that "Unknown format" warning message. (#4850)
  • They reverted the enable_static default value in conda_build.config to kill off those "Failed to get_static_lib_exports" warning messages. (#4850)
  • No more duplicate logging โ€” they stopped propagating the top-level conda-build logger. (#4903)
  • Fixed git cloning for repositories with submodules that contain local relative paths. (#4914)

๐Ÿ’€ Deprecations ๐Ÿ’€

  • Executable invocations (like conda-build) are marked as pending deprecation. (#4921)
  • Module based invocations (like python -m conda_build.cli.main_build) are marked as pending deprecation too. (#4921)

๐Ÿ“š Docs ๐Ÿ“š

  • Updated pkg-spec docs to mention the .conda package format. (#4633)
  • Dropped the unnecessary Jinja package name variables from the variants.rst docs file. (#4834)

๐ŸŒˆ Other ๐ŸŒˆ

  • Dropped the duplicate get_summary call in conda_build.skeletons.pypi. (#3998)
  • Fixed the failing resolved_packages test, which broke because of the recent OpenSSL 3.0.8 release to defaults. (#4912)

๐Ÿซถ Contributors ๐Ÿซถ


๐ŸŽ€ 3.25.0 (2023-05-22) ๐ŸŽ€

๐Ÿ”ฅ Enhancements ๐Ÿ”ฅ

  • Noarch packages that use virtual packages now have those virtual packages added to the hash contents of the package. This makes it so much easier to build noarch packages multiple times for different platforms with platform specific dependencies. (#4606)
  • They added support for svn source credentials โ€” that's svn_username and svn_password, bestie. (#4692)
  • Now depending on standalone conda-index instead of the bundled indexing code. (#4828)
  • Switched from setup.py to pyproject.toml and they're using Hatchling https://pypi.org/project/hatchling/ for the build system. (#4840)
  • Added Python 3.11 support. (#4852)

๐Ÿ› Bug fixes ๐Ÿ›

  • Ensured that tests/commands are also run in the presence of run_test.*. (#4429)
  • The source is now required when rendering a recipe that uses the load_file_data function. (#4817)
  • Packages now download during build into the correct subdir folder. (#4832)
  • They use a unique subdir variable name when rebuilding the index for multi-output builds. (#4862)

๐Ÿ’€ Deprecations ๐Ÿ’€

  • Inline conda index logic is pending deprecation. conda-build still provides conda-index a.k.a. the conda index CLI, but it uses standalone conda-index during builds. (#4828)
  • Prefer the standalone conda-index package https://conda.github.io/conda-index/ instead of conda-build index or conda index, so you get the faster indexing code. (#4828)
  • conda_build.metadata.ns_cfg is marked as pending deprecation. Use conda_build.get_selectors.get_selectors instead. (#4837)
  • conda_build.config.python2_fs_encode is marked as pending deprecation. (#4843)
  • conda_build.config._ensure_dir is marked as pending deprecation. Use stdlib's pathlib.Path.mkdir(exist_ok=True) or os.makedirs(exist_ok=True) instead. (#4843)

๐ŸŒˆ Other ๐ŸŒˆ

  • Formatted with black and replaced pre-commit's darker hook with black. (#4836)
  • Formatted with isort and added the pre-commit isort hook. (#4836)
  • Minor code simplification for conda_build.index.ChannelIndex._ensuredirs. (#4843)
  • Enabled the xattr test on macOS. (#4845)

๐Ÿซถ Contributors ๐Ÿซถ


๐Ÿ’… 3.24.0 (2023-03-22) ๐Ÿ’…

๐Ÿ› Bug fixes ๐Ÿ›

  • Fixed the failing git clone when the source has LFS files. (#4318)
  • Fixed a whole bunch of false-positives during the detection of Perl core modules in conda skeleton cpan. (#4592)
  • conda skeleton cpan now correctly adds a C compiler as a dependency if the distribution contains an .xs file. (#4599)
  • Downstream packages now install in the correct subdir. (#4763, #4803)
  • Updated the supported Python version in setup.py. (#4804)

๐Ÿ’€ Deprecations ๐Ÿ’€

  • Removed conda <4.13 logic. (#4677)
  • conda_build.conda_interface.CrossPlatformStLink is pending deprecation in favor of using os.stat().st_nlink. (#4728)
  • Dropped Python 3.7 support. (#4796)

๐Ÿ“š Docs ๐Ÿ“š

  • Updated broken links to example conda recipes, and updated the link to the now archived conda-recipes, plus added extra links to AnacondaRecipes aggregated feedstocks and conda-forge feedstocks. (#4580)
  • Replaced two instances of "Anaconda Cloud" with "anaconda.org". (#4719)

๐ŸŒˆ Other ๐ŸŒˆ

  • Updated the test matrix to run tests on all supported Python versions on Linux. They only run tests on the lower & upper Python bounds for Windows and macOS. (#4691)
  • Re-enabled code coverage reporting to codecov. (#4767)
  • Eliminated the test setup's manual clone of https://github.com/conda/conda_build_test_recipe in favor of a session fixture. (#4781)
  • Use tomllib (Python 3.11+) or tomli for .toml support. (#4783)

๐Ÿซถ Contributors ๐Ÿซถ


๐Ÿฆ‹ 3.23.3 (2022-12-06) ๐Ÿฆ‹

๐Ÿ› Bug fixes ๐Ÿ›

  • Changed the Zstd default compression to 19. (#4663)
  • Fixed build/host environment activation which was broken in >=3.23.0,<=3.23.2. (#4665)
  • Added PREFIX/bin to PATH on Windows and removed the PREFIX root from PATH on Unix. (#4665)

๐ŸŒˆ Other ๐ŸŒˆ

  • Skip the test suite for non-code changes. (#4664)

๐Ÿซถ Contributors ๐Ÿซถ

  • @jakirkham
  • @kenodegard
  • @mbargull

๐ŸŒธ 3.23.2 (2022-11-30) ๐ŸŒธ

๐Ÿ› Bug fixes ๐Ÿ›

  • The conda-build CLI was overriding condarc's zstd_compression_level with the default value. Fixed that. (#4650)

๐Ÿซถ Contributors ๐Ÿซถ

  • @kenodegard
  • @mbargull
  • @pre-commit-ci[bot]

โญ 3.23.1 (2022-11-17) โญ

๐Ÿ› Bug fixes ๐Ÿ›

  • Fixed a regression when writing link JSON files that was introduced in #4603. (#4636)
  • Updated the conda dependency. (#4635)

๐Ÿซถ Contributors ๐Ÿซถ

  • @jezdez
  • @kenodegard

๐Ÿ‘‘ 3.23.0 (2022-11-15) ๐Ÿ‘‘

๐Ÿ”ฅ Enhancements ๐Ÿ”ฅ

  • Outputs now support both script and files arguments. When both a script and an explicit file list are given, the script is run first and then the files given in the explicit file list are packaged. (#4281)
  • Added the overlinking_ignore_patterns build parameter to speed up recipes where it's just not helpful. (#4576)
  • Added win-arm64 as a recognized platform (subdir). (#4579)
  • Added an opt-in environment variable to run conda in isolated mode (python -I -m conda) when it's invoked from conda-build. This is necessary to fix an issue when packaging conda itself. Heads up bestie: alternative solutions (see #4628) are still under investigation, so the current implementation will likely change. (#4604, #4625)
  • Refactored conda_build.convert.update_lib_contents to use pathlib.Path. Marked test_cli.test_convert as xfail on Windows (something with the GitHub Windows Runner makes this particularly flaky). (#4619, #4626)

๐Ÿ’€ Deprecations ๐Ÿ’€

  • Dropped the cytoolz dependency. (#4556)
  • Removed internal usage of the memoized decorator. (#4593, #4615)
  • Removed py2 compatibility code and the use of six.py code exported from conda. (#4603)
  • conda_build.environ.system_vars is marked as pending deprecation. Use conda_build.environ.os_vars instead. (#4615)
  • Conda 4.2 introduced a private conda env that appears to have been a testing environment. It's no longer used and is only included in conda-build as an informational status. It's being removed in accordance with the feature pending deprecation starting with conda 22.11.0. (#4629)

๐Ÿ“š Docs ๐Ÿ“š

๐ŸŒˆ Other ๐ŸŒˆ

  • Renamed the canary recipe from conda.recipe to recipe. (#4584)
  • Introduced canary and review builds as part of GitHub CI. (#4608, #4613)
  • Removed unused AppVeyor files. (#4562)
  • Removed unused .checkignore. (#4564)
  • Removed unused .editorconfig. (#4564)
  • Removed unused .gitmodules. (#4564)
  • Removed unused .lgtm.yml. (#4564)
  • Removed unused .binstar.yml. (#4616)

๐Ÿซถ Contributors ๐Ÿซถ


๐ŸŒˆ 3.22.0 (2022-08-02)

Enhancements โœจ

  • Created function load_file_data available in Jinja templates for meta.yaml (#4465, #4480)
  • Created function load_str_data available in Jinja templates for meta.yaml (#4465, #4480)
  • Support using --zstd-compression-level to control the compression of v2 style conda packages. (#4467)

Bug fixes ๐Ÿ›

  • When building with Python 3.10, STDLIB_DIR and SP_DIR now refer to python3.10, not the symlink python3.1. (#4479)
  • Reduce verbosity of urllib3 on the default log level. (#4517)
  • Fixed issue identifying DSOs from sysroots when cross-compiling. (#4529)

Docs ๐Ÿ“š

  • Improved documentation for load_setup_py_data (#4465, #4480)
  • Added documentation for load_file_regex (#4465, #4480)
  • Fix prerequisites for build tutorials link. (#4478)
  • Link in contributing docs. (#4532)

Other ๐Ÿ’…

  • Fix patch tests. (#4495)
  • Added patch/m2-patch as a hard dependency. (#4495)
  • Update โ€œArtistic-2.0โ€ license test to use a valid package. (#4516)
  • Rename master branch to main. (#4515, #4531)

Contributors ๐Ÿซถ

  • @abrahammurciano made their first contribution in #4465/#4480
  • @chrisburr
  • @conda-bot
  • @duncanmmacleod
  • @jezdez
  • @jakirkham
  • @jugmac00 made their first contribution in #4478
  • @kathatherine made their first contribution in #4515
  • @kenodegard
  • @stuarteberg
  • @teake
  • @travishathaway
  • @pre-commit-ci[bot]

๐Ÿฆ‹ 3.21.9 (2022-05-27)

Enhancements โœจ

  • Replace is_dir with scandir for channel_root. (#4273)
  • Remove rpaths in PREFIX/../ that doesnโ€™t start with PREFIX. This includes BUILD_PREFIX, SRC_DIR. Previously it was only BUILD_PREFIX. (#4287)
  • Add entry_points to outputs in FIELDS schema. (#4389)
  • Support for setuptools 61+. (#4430)
  • Use set membership for faster indexing. (#4459)

Bug fixes ๐Ÿ›

  • Remove rpaths that occur multiple times. (#4287)
  • Enable bdist_conda via entry_point mechanism supported also by setuptools >=60.0.0. Usable via from setuptools import setup and setup(distclass=conda_build.bdist_conda.CondaDistribution, ...). (#4368)
  • Patch setuptoolsโ€™s vendored distutils.core as well. (#4434)
  • Resolve conda debug failure when a trailing slash path is provided. (#4448)
  • Fix import error caused by conda 4.13.0โ€™s removal of Python 2.7 code. (#4482)

Deprecations ๐Ÿ’€

  • Usage of bdist_conda via from distutils.core import setup and distclass=distutils.command.bdist_conda.CondaDistribution, as that only works for setuptools <60.0.0. (#4368)
  • Remove Python 2.7 imports removed in conda 4.13.0. (#4482)

Other ๐Ÿ’…

  • Move Windows tests from Azure to GitHub Actions. (#4353, #4436)
  • Add pyupgrade to pre-commit. (#4374)
  • Move MacOS tests from Azure to GitHub Actions. (#4412, #4436, #4455)
  • Update Makefile for easier testing. (#4425)
  • Remove unused Travis CI configs. (#4438)
  • Add MyST to the documentation system and render release notes correctly. (#4483)

Contributors ๐Ÿซถ


๐ŸŽ€ 3.21.8 (2022-01-25)

Enhancements โœจ

  • Adds --extra-meta key=value option which allows users to save any specified extra metadata to about.json to e.g. store the repo-url, git-sha1 or the CI run-id a package was built from.

Bug fixes ๐Ÿ›

  • Old work directories will be preserved when croot and build_id are set manually

Other ๐Ÿ’…

  • Separate contributor related documentation into dedicated file
  • Migrating to github actions for tests
  • Synced file(s) with conda/infra

Contributors ๐Ÿซถ

  • @Lnaden
  • @jezdez
  • @cjmartian
  • @beeankha
  • @pre-commit
  • @conda-bot

๐Ÿ“ 3.21.7 (2021-11-30)

Bug fixes ๐Ÿ›

  • Handle an import from the vendored auxlib library in Conda 4.11.0 better.

Other ๐Ÿ’…

  • cran-skeleton: more unit tests

Contributors ๐Ÿซถ

  • @kenodegard
  • @jdblischak
  • @jezdez
  • @pre-commit

๐Ÿงš 3.21.6 (2021-11-09)

Enhancements โœจ

  • Add limited support for platform_system/sys_platform env markers in PyPI skeleton
  • cran-skeleton: Adds a flag --no-comments to remove the instructional comments from the recipe files.

Bug fixes ๐Ÿ›

  • When checking for circular dependencies in cross-compiling mode, build requirements are ignored now.
  • Make sure symlinked directories are found in always_include_files
  • Fix pinning expressions for prerelease builds

Contributors ๐Ÿซถ

  • @isuruf
  • @mbargull
  • @kenodegard
  • @jdblischak
  • @dbast
  • @jezdez
  • @ChristofKaufmann

๐Ÿ’œ 3.21.5 (2021-08-06)

Enhancements โœจ

  • Revert โ€œConsider any file containing .yaml in its name as maybe a recipe fileโ€ (#4235)
  • Support setting build/script_env values containing โ€œ=โ€ (#4211)
  • Drop Python 2.7 support from setup.py (#4202)
  • Make variant configuration error message more informative (#4198)
  • Ensure file globs are always sorted (#4186)
  • Add preliminary support for prelink_message files in conda packages (#4203)

Bug fixes ๐Ÿ›

  • Do not munge rpath for non Mach-O files on macOS (#4238)
  • Fix Windows test file extension reported by conda-debug (#4224)

Docs ๐Ÿ“š

  • Document build/script_env recipe option (#4211)
  • Clarify wording about selecting multiple operating systems (#4139)

Contributors ๐Ÿซถ

  • @chrisburr
  • @gabm
  • @isuruf
  • @jacobtylerwalls
  • @katietz
  • @kenodegard
  • @marcelotrevisani
  • @xhochy

๐ŸŒธ 3.21.4 (2021-01-15)

Enhancements โœจ

  • Add new centos 7 distribution cleof to rpm skeleton for s390x. (#4181)

Bug fixes ๐Ÿ›

  • Fixed bug where symlinks in symlinks caused conda build to exit. (#4180)

Contributors ๐Ÿซถ

  • @mingwandroid
  • @beckermr
  • @katietz
  • @beckermr

๐Ÿ‘‘ 3.21.3 (2021-01-11)

Enhancements โœจ

  • Fix stupid error in prefix replacement (#4177)

Contributors ๐Ÿซถ

  • @mingwandroid

๐Ÿ’ซ 3.21.2 (2021-01-11)


โญ 3.21.1 (2021-01-11)

Bug fixes ๐Ÿ›

  • Fix noarch: python version from version-age determination (#4174)

Contributors ๐Ÿซถ

  • @mingwandroid

๐Ÿ”ฅ 3.21.0 (2021-01-10)

Enhancements โœจ

  • activate_in_script defaults to true (#4120)
  • Add Setting and build/noarch_python_build_age and fix tests not finding packages (#4120)
  • Allow directories as license_file source (#4153)
  • Consider any file containing .yaml in its name as maybe a recipe file (#4120)
  • Add weak_constrains and strong_constrains run_exports types (#4125)
  • Issue a single command for the upload command (#4120)
  • Print hash_inputs after upload info (#4120)
  • Add cross-r-base for cross compiling
  • Add --build-id-pat option
  • macOS: Delete build_prefix rpaths
  • Use smarter build_number
  • Combine default_structs with FIELDS
  • Fix conda render indent from 4 to 2
  • macOS: arm64 ci/test-suite setup
  • Removing more conda-forge testing deps
  • Variants: Be more informative
  • more verbosity in tests
  • Use MacOSX10.10.sdk, not MacOS10.9.sdk in tests (#4120)
  • Warn when files have been removed from the prefix (#4120)

Bug fixes ๐Ÿ›

  • Add conda-verify to install_conda_build_test_deps (#4120)
  • Add flaky to testing dependencies (#4138)
  • Fix tests not finding packages
  • Avoid writing to the package cache in package_has_file (collisions) (#4120)
  • Change package_has_file to refresh if out of date (#4120)
  • Ensure ~/.condarc does not leak into testing_config (#4120)
  • Fix applying patches to read-only files (#4140)
  • Fix auth in aboutjson (#4137)
  • Fix skeleton URLs for CentOS 6 (EOL) and various CI fixes (#4154)
  • Fix typo in cran skeleton (#4143)
  • Force channel_targets to be considered used (#4120)
  • Fix printing bytes-like object is required, not 'str' when applying patches (#4118)
  • Set โ€œplatformโ€ in index.json to the target platform for cross-platform builds (#4124)
  • Reduce get_rpaths_raw/patchelf disagree warnings (#4131)
  • LIEF: Allow parsing static libs to fail (#4149)
  • pass cache_dir to api.build (#4120)
  • Fix symlinks to directories
  • Make post-link run_export/library_nature determination less work when CONDA_OFFLINE=1
  • Remove Python 2.7 from CI matrix
  • Fix test_pypi_installer_metadata (builds against python 3.9 not 3.7)
  • tests: Fix test_render_with_python_arg_reduces_subspace
  • tests: Update python 3 from 3.5/6 to 3.9 in many
  • Set numpy default to 1.16
  • tests: Fix pins for numpy_used
  • tests: CI: Win: Circumvent delayed expansion
  • Install patch or m2-patch, write .sh files as binary, more Win tests
  • tests: Avoid issue with coverage==5.0 on Win+Py2.7
  • Assume non-revisible patches
  • Add flaky marker and --strict-markers to setup.cfg
  • Donโ€™t sort recipes
  • Use extra R_ARGS and fix them
  • shell check fix

Contributors ๐Ÿซถ

  • @mingwandroid
  • @isuruf
  • @mbargull
  • @njalerikson
  • @cjmartian
  • @chrisburr
  • @hugobuddel
  • @kurtschelfthout

๐ŸŽ‰ 3.20.5 (2020-10-26)

Enhancements โœจ

  • A new feature build/ignore_run_exports_from which will ignore run_exports coming from a package listed in build/ignore_run_exports_from. (#4114)

Bug fixes ๐Ÿ›

  • Respect PEP440 ~= โ€˜Compatible release clauseโ€™ (#4113)
  • Detect amalgamated patches (#4099)
  • Handle realpath properly in unsafe patch check (#4099)
  • Force channel_targets to be considered used (#4099) โ€” no more pretending it's not there, bestie ๐Ÿ’…
  • Look for git inside build_prefix in git_info (#4099) ๐Ÿ”
  • Fall back to shutil.copy if shutil.copy2 fails when copying patches (#4099) โ€” plan B is a whole vibe
  • Fix indexing by file (#4111) ๐Ÿ—‚๏ธ
  • Helper functions to extract keys (#4088) ๐Ÿ”‘
  • Simplify find_config_files call (#4086) โœจ
  • Refactor dict_of_lists_to_lists_of_dict (#4075) ๐Ÿงน

Contributors

  • @mingwandroid
  • @isuruf
  • @njalerikson
  • @cjmartian
  • @njalerikson

3.20.4 (2020-10-14) ๐ŸŒธ

Enhancements

  • Make stats output more easily human-readable (#4069) ๐Ÿ‘€
  • Prefer meta.yaml build/error_overlinking and error_overdepending (#4074) ๐Ÿ‘‘
  • Cleanup variant processing code (#4075) ๐Ÿงผ
  • Add --file option to indexing (#4076) ๐Ÿ“„

Bug Fixes

  • Remove old rpath when loader_path is used (#4080) ๐Ÿ› ๏ธ
  • Fix MACOSX_DEPLOYMENT_TARGET default for osx-arm64 (#4091) ๐ŸŽ
  • Rewrite apply_patch again (#4092) ๐Ÿ”
  • Add a .* to conditional_regex (#4092) ๐ŸŒŸ

Contributors

  • @isuruf
  • @njalerikson
  • @cjmartian
  • @mingwandroid

3.20.3 (2020-09-29) ๐Ÿฆ‹

Enhancements

  • Use CONDA_PACKAGE_EXTENSIONS (#4053) ๐Ÿ“ฆ
  • Raise RuntimeError instead of calling sys.exit (#4062) ๐Ÿ˜ค
  • Refactor conda_build.build.get_all_replacements (#4055) ๐Ÿงฝ

Bug fixes

  • Do not clobber config argument in conda_build.build.build_tree (#4066) ๐Ÿ™…
  • Use --dry-run to test that a patch applies. Fixes bug 4054 (#4067) ๐Ÿฉน
  • Include target_platform in package build string hash (#4065) ๐Ÿ”
  • Fix post linking for SDKs with tapi-tbd-v4 (MacOS 11.0 and upwards) (#4048) ๐Ÿ

3.20.1 (2020-09-04) ๐Ÿ’–

Bug fixes

  • Run bash with -e in outputs too #4033 ๐Ÿš
  • Add target to recognized fields in outputs #4034 ๐ŸŽฏ
  • Various overlinking fixes for Windows #4036 ๐ŸชŸ
  • variants: remove hard-coded default path for CONDA_BUILD_SYSROOT ๐Ÿงš

Contributors

  • @mingwandroid
  • @isuruf
  • @mbargull

3.20.0 (2020-08-27) ๐Ÿ”ฅ

Enhancements

  • enable Python 3.8 on Azure Pipelines (#3841) ๐Ÿ
  • which_package can be passed avoid_canonical_channel_name (#3952) ๐Ÿ“›
  • make life easier (less shell exit-y) for those who source test scripts (#3952) ๐Ÿ˜Œ
  • move old host env instead of deleting it when --keep-old-work (#3952) ๐Ÿšš
  • convert info.d/.yaml to info/.json (#3952) ๐Ÿ”„
  • allow manual specification of which binary files to prefix replace (#3952) โœ๏ธ
  • filter out .AppleDouble folders from recipe searches (#3952) ๐ŸŽ
  • re-wrote apply_patch() to be more robust (#3952) ๐Ÿ’ช
  • many fixes for DSO post-processing (#3952, #3953) ๐Ÿงฐ
  • add support for (limited) tbd parsing (#3953) ๐Ÿ“–
  • Make sure packages in current repo data w/ features have versions without features (#3957) ๐ŸŽ€
  • Check all sysroot locations for DSOs (#3969) ๐Ÿ”Ž
  • More helpful error message if an empty string is passed as the hash (md5, sha1 or sha256 fields) (#3971) ๐Ÿ’ฌ
  • the GIT_DESCRIBE_HASH variable will be available regardless of whether the sources of the recipe have a git tag or not (#3982) ๐Ÿท๏ธ
  • add apple silicon support (#4004, #4015) ๐ŸŽ
  • set build_platform for aid in cross compiling (#4005) ๐ŸŒ‰
  • import macho on non apple system for cross compiling (#4025) ๐Ÿงฒ
  • Add ccache as a jinja 2 function (#4026) โšก
  • Improve cpan skeleton (#4026) ๐Ÿช
  • Retry moving host prefix due to Windows file locking (#4026) ๐Ÿ”’
  • Rename ccache method from mklink to sylinks (#4028) ๐Ÿช„

Bug fixes

  • conda_build.metadata: fixed typos in FIELDS (#3866) ๐Ÿ“
  • add spaces in CRAN templates (fixes #3943) (#3944) ๐Ÿง
  • raise valid CalledProcessException in macho.otool (#3952) ๐Ÿšจ
  • cache local_output_folder too for get_build_index (#3952) ๐Ÿ—ƒ๏ธ
  • fix relocations when cross compiling (#3995) ๐Ÿงญ
  • use host_platform instead of sys.platform to facilitate cross compiling (#3997) ๐Ÿ–ฅ๏ธ
  • Fix parsing UnsatisfiableError from conda>=4.7.8 (#4001) ๐Ÿงฉ
  • allow packages to depend on themselves when cross compiling (#4011) ๐Ÿชž
  • set the correct SHLIB_EXT when cross compiling (#4013, #4021) ๐Ÿ“š
  • inspect linkages with pyldd when not DLL/EXE files (#4019) ๐Ÿ”ฌ
  • Respect no_rewrite_stdout_env on Windows (#4026) ๐Ÿค
  • Prefix replacement fixes (#4026) ๐Ÿฉน
  • Use git am -3 when applying patches (#4026) ๐ŸŒฟ
  • Fix env_var=val assertion (#4026) โœ…
  • Use exit /B from patch files (#4026) ๐Ÿšช

Docs

  • extend docs o generating the index (#3877) ๐Ÿ“‘
  • add details to documentation of run_constrained (#3878) ๐Ÿ“Œ
  • remove documentation on bdist_conda and environment variables (#3879) ๐Ÿ—‘๏ธ
  • update cli help information for conda index (#3931) ๐Ÿ’ฌ
  • Clarify how to install conda-build (#3976) ๐Ÿงญ
  • Add note for local package install deps (#3980) ๐Ÿ“
  • Clarify multiple OS selection (#3984) ๐ŸŒ
  • add aarch64 selector to the docs (#4003) ๐Ÿงฌ
  • add docs on build_platform and arm64 (#4020) ๐Ÿ—๏ธ

Other

  • Enable s390x support (#3949, #4030) ๐Ÿ˜
  • Add xfail test for non-utf-8 charsets (#3972) ๐Ÿˆš
  • Improve testing on CI (#3987, #4017, #4027) ๐Ÿงช
  • Allow python=3.8 for pypi skeletons (#4014) ๐Ÿ

3.19.3 (2020-04-13) ๐ŸŒˆ

Bug fixes

  • load log prior to calling warn method (#3925) ๐Ÿ“œ
  • test suite fixes and prefix replacement fixes (#3932) ๐Ÿงช

Other

  • Enable ppc64 support (#3921) ๐Ÿ’ป

Docs

  • Update cli help information for conda index (#3931) ๐Ÿ’ฌ

Contributors

  • @beenje
  • @jjhelmus
  • @mingwandroid

3.19.2 (2020-04-01) ๐Ÿ“

Bug fixes

  • Show a warning instead of failing if a Mach-O file is produced by a build running on a platform other than macOS (#3912) โš ๏ธ
  • Revert #3893, restores behavior of build/binary_has_prefix_files to that found in 3.18.12 (#3916) โช

Docs

  • clarified 'deletes the build environment' in concepts/recipe.rst (#3901) ๐Ÿ“–

Contributors

  • @jjhelmus
  • @timsnyder
  • @chrisburr

3.19.1 (2020-03-17) ๐Ÿงš

Bug fixes

  • Fix issues with PREFIX detection in Windows #3899 ๐ŸชŸ

Other

  • Change the CI trigger #3904 ๐Ÿ””

Contributors

  • @mingwandroid
  • @marcelotrevisani
  • @jjhelmus

3.19.0 (2020-03-10) ๐Ÿ’œ

Enhancements

  • Keep python pinning in hashing if there is a space #3895 ๐Ÿ
  • ci launcher supporting python d shebangs on Windows #3894 ๐Ÿš€
  • Allow build/binary_has_prefix_files to specify a list of files #3893 ๐Ÿ“‹

Bug fixes

  • Use patchelf to set RPATH by default #3897 ๐Ÿงท

Contributors

  • @isuruf
  • @jjhelmus
  • @mingwandroid

3.18.12 (2020-03-02) ๐ŸŽ€

  • Keep python pinning in hashing if there is a space #3895 ๐Ÿ
  • ci launcher supporting python d shebangs on Windows #3894 ๐Ÿš€
  • Allow build/binary_has_prefix_files to specify a list of files #3893 ๐Ÿ“‹
  • Use patchelf to set RPATH by default #3897 ๐Ÿงท
  • Prevent non-atomic writes to repodata JSON files #3833 ๐Ÿ›ก๏ธ
  • Audited and updated all docs with formatting, grammar, and accuracy errors. ๐Ÿ“š
  • Docs: Removed deprecated page on features ๐Ÿ—‘๏ธ
  • Fixed issue where symlinks to files that do not exist break conda build #3840 ๐Ÿ”—

Contributors

  • @bdice
  • @beckermr
  • @chrisburr
  • @csoja
  • @guidara
  • @isuruf
  • @jakirkham
  • @jjhelmus
  • @marcelotrevisani
  • @mcg1969
  • @mingwandroid
  • @msarahan
  • @rrigdon
  • @saraedum
  • @sscherfke
  • @zeehio

3.18.11 (2019-11-01) ๐Ÿฆ”

  • Update build.sh files of skeletons to be shellcheck clean including test to lint future updates. ๐Ÿš
  • Corrected documentation on subpackage test requirements. ๐Ÿ“
  • Do not move work dir to work/work/ ๐Ÿšซ
  • fixed a missing .lower() on two tar_xf related util functions ๐Ÿ”ก
  • Fix has_prefix detection for Windows. ๐ŸชŸ
  • conda_build.inspect_pkg: optimise use of fnmatch โšก
  • Do not consider .ignore files when searching with ripgrep ๐Ÿ™ˆ
  • Remove N*N os.lstat calls in build_info_files_json_v1 ๐ŸŽ๏ธ

Contributors

  • @msarahan
  • @rrigdon
  • @marcelotrevisani
  • @rrigdon
  • @soapy1
  • @dbast
  • @duncanmmacleod
  • @beckermr
  • @seanyen
  • @AndrewAnnex
  • @183amir
  • @njzjz

3.18.10 (2019-10-14) ๐ŸŒป

Enhancements

  • Added the error message when an invalid pip dependency version expression is used ๐Ÿšจ
  • Conda skeleton pypi quoting just version, summary and description or attributes with special characters ๐Ÿงพ
  • Set up CI Azure pipeline for Linux ๐Ÿง
  • Update cran skeleton to match supported optional licenses for license file derivation. ๐Ÿ“œ
  • Migrate Unittests to PyTest ๐Ÿงช
  • Update script command on conda skeleton pypi to use {{ PYTHON }} -m pip install . -vv ๐Ÿ
  • Add a warning when a received a file on RECIPE_PATH โš ๏ธ
  • Refactored the skeletons/pypi.py get_package_metadata to be more modular ๐Ÿงฑ
  • added --suppress-variables switch to hide environment variables from console output ๐Ÿคซ

Bug fixes

  • Fixed build of .conda packages enabled via conda config --set conda_build.pkg_format 2 ๐Ÿ“ฆ
  • Workaround for future deprecations of the SafeConfigParser and readfp of the same module. ๐Ÿงฏ

Docs

  • Remove bzip2 package from build toolkit description. ๐Ÿ—‘๏ธ

Contributors

  • @msarahan
  • @jakirkham
  • @marcelotrevisani
  • @duncanmmacleod
  • @kinow
  • @saraedum
  • @jjhelmus
  • @rrigdon
  • @mingwandroid
  • @asford
  • @timsnyder
  • @mcg1969
  • @kaitietz
  • @stuarteberg
  • @isuruf
  • @dbast
  • @Bezier89

3.18.9 (2019-07-23) ๐Ÿ‹

Enhancements

  • add --use-channeldata argument to conda render/build. ๐Ÿ“ก
  • Extract the part in the skeletons pypi responsible to get the package metadata to a free function. ๐Ÿงฉ
  • Create unittests for the get_package_metadata (skeletons/pypi.py) and for the new functions. ๐Ÿงช

Bug fixes

  • Limit threads to 61 on Windows. ๐ŸชŸ
  • Do not use channeldata for run_exports unless --use-channeldata specified. ๐Ÿšซ
  • Finalize top-level metadata if not present as an output. ๐Ÿ

Docs

  • Add 3.18.7 release notes ๐Ÿ“

Other

  • Add disable_pip to FIELDS โž•

Contributors

  • @rrigdon
  • @jjhelmus
  • @rrigdon
  • @Bezier89
  • @jakirkham
  • @marcelotrevisani

3.18.8 (2019-07-18) ๐Ÿ

Enhancements

  • license_file can optionally be a yaml list ๐Ÿ“‹

Bug fixes

  • fix readup of existing index.json in cache while extracting ๐Ÿ—‚๏ธ
  • fix spurious post build errors/warning message ๐Ÿ”‡
  • merge channeldata from all urls ๐Ÿ”—

Contributors

  • @msarahan
  • @rrigdon
  • @jjhelmus
  • @isuruf
  • @ddamiani

3.18.7 (2019-07-09) ๐ŸŒธ

Enhancements

  • Update authorship for 3.18.7 โœ๏ธ
  • Add note on single threading for indexing during build ๐Ÿงต
  • Add in fallback for run_exports when channeldata not available ๐Ÿช‚
  • Make pins for current_repodata additive โ€” always newest, and pins are additions to that โœจ
  • Limit indexing in build to using one thread ๐Ÿงต
  • Speed up by allowing empty run_exports entries in channeldata be valid results
  • Bump conda-package-handling to 1.3+
  • Add test for run_exports without channeldata
  • Fallback to file-based run_exports if channeldata has no results
  • Add Mozilla as valid license family ๐ŸฆŠ
  • Add in fallback for run_exports when channeldata not available
  • Updated tutorials and resource documentation ๐Ÿ“š

Bug fixes ๐Ÿ›

  • Flake8 and test fixes from pytest deprecations
  • Fix in render.py::_read_specs_from_package
  • Fix for pkg_loc
  • Fix conda debug output being suppressed

Contributors ๐Ÿ’–

  • @msarahan
  • @rrigdon
  • @rrigdon
  • @scopatz
  • @mbargull
  • @jakirkham
  • @oleksandr-pavlyk

3.18.6 (2019-06-26)

small lil patch, still cute ๐Ÿ’…

Enhancements โœจ

  • package sha256 sums are included in index.html

Bug fixes ๐Ÿ›

  • fix bug where package filenames were not included in the index.html

Contributors ๐Ÿ’–

  • @rrigdon
  • @jjhelmus

3.18.5 (2019-06-25)

literally the very next day, the team was NOT resting ๐Ÿ˜ญ

Bug fixes ๐Ÿ›

  • fix one more keyerror with missing timestamp data
  • when indexing, allow .tar.bz2 files to use .conda cache, but not vice versa. This acts as a sanity check on the .conda files. ๐Ÿง 
  • add build/rpaths_patcher to meta.yaml, to allow switching between lief and patchelf for binary mangling

Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan
  • @csosborn

3.18.4 (2019-06-21)

Enhancements โœจ

  • channeldata reworked a bit to try to capture any available run_exports for all versions available

Bug fixes ๐Ÿ›

  • make "timestamp" an optional field in conda index operations

Contributors ๐Ÿ’–

  • @msarahan

3.18.3 (2019-06-20)

Enhancements โœจ

  • Make VS2017 default Visual Studio
  • Add hook for customizing the behavior of conda render
  • Drop /usr from CDT skeleton path
  • Update cran skeleton to use m2w64 compilers for windows instead of toolchain. The linter is telling since long: Using toolchain directly in this manner is deprecated. ๐Ÿ‘€

Bug fixes ๐Ÿ›

  • Update cran skeleton to not use toolchain for win
  • fix package_has_file so it supports .conda files (use cph)
  • fix package_has_file function for .conda format
  • fix off-by-one path trimming in prefix_files
  • disable overlinking checks when no files in the package have any shared library linkage
  • try to avoid finalizing top-level metadata twice
  • try to address permission errors on Appveyor and Azure by falling back to copy and warning (not erroring) if removing a file after copying fails
  • reduce the files inspected/loaded for channeldata, so that indexing goes faster

Deprecations โš ๏ธ

  • The repodata2.json file is no longer created as part of indexing. It was not used by anything. It has been removed as an optimization. Its purpose was to explore namespaces, and we'll bring its functionality back when we address that fully.
bestie the repodata2.json era is OVER, it's gone gone. not used by anything, so it got yeeted as an optimization. rip to the namespace-exploration dream, it'll come back when that's fully handled ๐Ÿ’€

Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan
  • @rrigdon
  • @rrigdon
  • @soapy1
  • @mariusvniekerk
  • @jakirkham
  • @dbast
  • @duncanmmacleod

3.18.2 (2019-05-26)

Bug fixes ๐Ÿ›

  • speed up post-link checks
  • fix activation not running during tests
  • improve indexing to show status better, and fix bug where size/hashes were being mixed up between .tar.bz2 and .conda files

Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan
  • @rrigdon

3.18.1 (2019-05-18)

Enhancements โœจ

  • rearrange steps in index.py to optimize away unnecessary work
  • restore parallel extract and hash in index operations

Contributors ๐Ÿ’–

  • @msarahan

3.18.0 (2019-05-17)

this is the big one bestie, a whole new minor version ๐ŸŽ€

Enhancements โœจ

  • Set R_USER environment variable when building R packages
  • Make Centos 7 default cdt distribution for linux-aarch64
  • Bump default python3 version to 3.7 for CI
  • Build docs if any docs related file changes
  • Add support for conda pkgv2 (.conda) format
  • add creation of current_repodata.json - like repodata.json, but only has the newest version of each file
  • change repodata layout to support .conda files. They live under the "packages.conda" key and have similar subkeys to their .tar.bz2 counterparts.
  • Always show display actions, regardless of verbosity level
  • Ignore registry autorun for all cmd.exe invocations
  • Relax default pinning on r-base for benefit of noarch R packages
  • Make conda index produce repodata_from_packages.json{,.bz2} which contains unpatched metadata
  • Use a shorter environment prefix when testing on unix-like platforms
  • Prevent pip from clobbering conda installed python packages by populating .dist_info INSTALLER file

Bug fixes ๐Ÿ›

  • Allow build/missing_dso_whitelist section to be empty
  • Make conda-debug honor custom channels passed using -c
  • Do not attempt linkages inspection via lief if not installed
  • Fix all lief related regressions brought in v3.17.x
  • Fix ZeroDivisionError in ELF sections that have zero entries
  • binary_has_prefix_files and text_has_prefix_files now override the automatically detected prefix replacement mode
  • Handle special characters properly in pypi conda skeleton
  • Build recipes in order of dependencies when passed to CB as directories
  • Fix run_test script name for recipes with multiple outputs
  • Fix recursion error with subpackages and build_id
  • Avoid mutating global variable to fix tests on Windows
  • Update CRAN license test case (replace r-ruchardet with r-udpipe)
  • Update utils.filter_files to filter out generated .conda_trash files
  • Replace stdlib glob with utils.glob. Latter supports recursion (**)

Docs ๐Ÿ“š

  • Updated Sphinx theme to make notes and warnings more visible
  • Added tutorial on building R-language packages using skeleton CRAN
  • Add 37 to the list of valid values for CONDA_PY
  • Corrected argparse rendering error
  • Added tutorials section, reorganized content, and added a Windows tutorial
  • Added Concepts section, removed extraneous content
  • Added release notes section
  • Reorganized sections
  • Clarify to use 'where' on Windows and 'which' on Linux to inspect files in PATH
  • Add RPATH information to compiler-tools documentation
  • Improve the documentation on how to use the macOS SDK in build scripts.
  • Document conda build purge-all.
  • Fix user-guide index
  • Add example for meta.yaml
  • Updated theme
  • Reorganized conda-build topics, updated link-scripts

Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan
  • @rrigdon
  • @jjhelmus
  • @nehaljwani
  • @scopatz
  • @Bezier89
  • @rrigdon
  • @isuruf
  • @teake
  • @jdblischak
  • @bilderbuchi
  • @soapy1
  • @ESSS
  • @tjd2002
  • @tovrstra
  • @chrisburr
  • @katietz
  • @hrzafer
  • @zdog234
  • @gabrielcnr
  • @saraedum
  • @uilianries
  • @theultimate1
  • @scw
  • @spalmrot-tic

3.17.8 (2019-01-26)

Bug fixes ๐Ÿ›

  • provide fallback from libarchive back to python tarfile handling for handling tarfiles containing symlinks on windows

Other ๐ŸŒ€

  • Rever support added for releasing conda-build

Contributors ๐Ÿ’–

  • @msarahan
  • @jjhelmus
  • @scopatz
  • @rrigdon
  • @ax3l
  • @rrigdon

3.17.7 (2019-01-16)

Bug fixes ๐Ÿ›

  • respect context.offline setting #3328
  • don't write bytecode when building noarch: python packages #3330
  • escape path separator in repl #3336
  • remove deprecated sudo statement from travis CI configuration #3338
  • fix running of test scripts in outputs #3343
  • allow overriding one key of zip_keys as long as length of group agrees #3344
  • fix compatibility with conda 4.6.0+ #3346
  • update centos 7 skeleton (CDT) URL #3350

Contributors ๐Ÿ’–

  • @iainsgillis
  • @isuruf
  • @jjhelmus
  • @nsoranzo
  • @msarahan
  • @qwhelan

3.17.6 (2018-12-19)

Bug fixes ๐Ÿ›

  • don't raise when recipe text can't be extracted if manual build string is already set #3326

Contributors ๐Ÿ’–

  • @msarahan

3.17.5 (2018-12-14)

Bug fixes ๐Ÿ›

  • fix pip build isolation / fix absence of "falsey" env vars. Ignore only if empty string or None. #3319
  • pass-through VS20XYINSTALLDIR var (used by intel compiler to locate VS2017 installation) #3322

Contributors ๐Ÿ’–

  • @jjhelmus
  • @msarahan

3.17.4 (2018-12-12)

Bug fixes ๐Ÿ›

  • fix python-3 only JSON decode error handling (make py27 compatible) #3307
  • fix too much caching in getting used vars from meta.yaml leading to inaccurate hash contents #3311
  • fix merge of build/host not being recognized before an rm_rf call utilized that info #3311

Contributors ๐Ÿ’–

  • @Lnaden
  • @msarahan

3.17.3 (2018-12-11)

Bug fixes ๐Ÿ›

  • ignore non-native binaries in lief for now. Cross-platform inspection still theoretically possible using subdir parameter. #3306

Contributors ๐Ÿ’–

  • @msarahanl

3.17.2 (2018-12-11)

Bug fixes ๐Ÿ›

  • fix to ignore unsatisfiable pin_compatible calls for packages in other outputs #3277
  • add license files to CRAN recipes generated by conda skeleton #3284
  • restrict py-lief to running on linux/macos only for now #3291,
  • fix lief operation on files that are missing dynamic section (e.g. go binaries) #3292
  • expand instructions on how to setup a dev env for conda-build #3296
  • fix file= keyword being passed to a logger call #3298
  • add test for standalone DLLs with py-lief, don't error out on them #3301
  • rename windows build script runner to avoid confusion with existing bld.bat files in root dir #3303
  • fix file URL handling on Windows #3303
  • use conda's download function rather than requests directly, so that conda's proxy settings are respected #3303
  • silence patch output when output verbosity is False #3305

Contributors ๐Ÿ’–

  • @bergtholdt
  • @dsludwig
  • @jdblischak
  • @msarahan
  • @nehaljwani
  • @sodre

3.17.1 (2018-12-04)

Bug fixes ๐Ÿ›

  • omit LIEF depedency on Windows until it is better tested #3288
  • activate host environment #3288
  • allow calls to nm to fail #3290

Contributors ๐Ÿ’–

  • @jjhelmus
  • @msarahan
  • @nehaljwani

3.17.0 (2018-11-28)

Enhancements โœจ

  • tell pip to not go find things on PyPI (turn off downloading) #3109
  • brand spanking new conda debug command that spins up build/host or test envs so you can actually work on recipes #3237
  • a whole new package check called "overdepending" โ€” it warns you (or straight up errors out) when your run deps drag in shared library packages you don't even need #3237
  • we now use LIEF to analyze shared object data, so our capabilities go way beyond what pyldd could do #3237

๐Ÿ’… Bug fixes

  • stop yeeting the build string during pin_run_as_build and ensure_valid_spec #3264
  • fix conda index's handling of packages where the 'depends' key justโ€ฆ isn't there #3270
  • fix a bad inversion assumption about pip's PIP_NO_DEPENDENCIES setting #3271
  • fix the regex so whitespace after hyphens in the outputs section is actually allowed #3274, #3275
  • handle unicode decode fails in output rewriting like the queen we are #3279
  • fix merging of repodata patches that have keys which don't exist in the repo #3280

๐Ÿ‘‘ Contributors

  • @bergtholdt
  • @isuruf
  • @minrk
  • @msarahan
  • @mingwandroid
  • @nehaljwani

๐ŸŒธ 3.16.3 (2018-11-21)

โœจ Enhancements

  • rewrite long prefix paths as $PREFIX, etc. so your build logs are actually readable #3258
  • the --output-folder switch is now configurable in condarc #3265
  • the --long-test-prefix switch is now configurable in condarc, plus we fixed a logic error with that argument #3266

๐Ÿ’… Bug fixes

  • make indexing way more robust when package data is corrupt #3238
  • timeouts bumped to 900 instead of 90 #3239
  • add activation to the wheel bundling script #3240
  • fix the PermissionError import from utils โ€” it was undefined on py2.7 #3247
  • fix outputs with a custom build string getting the hash wrong #3250
  • fix tests not being run on windows #3257

๐Ÿ‘‘ Contributors

  • @Bezier89
  • @gabm
  • @isuruf
  • @minrk
  • @msarahan
  • @teake
  • @tomashek
  • @tschoonj

๐ŸŒˆ 3.16.2 (2018-10-29)

๐Ÿ’… Bug fixes

  • remove the noarch binary file check (we do that in conda-verify now instead) #3212
  • fix utf-8 conversion of check_output_env #3213
  • fix the thread count when indexing causing oversubscription #3217
  • fix behavior of try_acquire_locks during lock contention #3224
  • fix test env creation improperly prioritizing the local channel #3229
  • don't check for an error when removing conda-init (in the conda recipe for this repo) #3230
  • add r-impl to the R package template generator #3232
  • fix creation of unix and win shell script files for noarch packages #3236
  • fix the path of the python interpreter used for noarch packages being tested on win, when they were created on linux/mac #3236

๐Ÿ‘‘ Contributors

  • @alexandersturm
  • @Bezier89
  • @dsludwig
  • @mandeep
  • @mingwandroid
  • @msarahan
  • @rchateauneu
  • @soapy1

๐Ÿฆ‹ 3.16.1 (2018-10-12)

โœจ Enhancements

  • expand ~ in source paths #3206
  • use binsort when it's available to sort the file list in tar archives, so compression is better optimized #3210
  • let meta.yaml's build/rpaths key function on macOS, not just linux #3206

๐Ÿ’… Bug fixes

  • improve docs on the behavior of channel arguments #3197
  • remove the mention in docs about building .RPM and .DEB files #3199
  • fix dist-info errors where dist-info files didn't match the package name #3206
  • fix some hard-coded .tar.bz2 references so other compression formats are easier to support #3206
  • batch calls to compiling .pyc files to dodge problems with maximum command length #3206
  • use ensure_list in processing files to be extracted #3210
  • fix the KeyError that happened when a jinja2 rendering error occurred, which was hiding the actual rendering error 3211

๐Ÿ‘‘ Contributors

  • @mingwandroid
  • @msarahan
  • @stas00
  • @teake

โญ 3.16.0 (2018-10-05)

โœจ Enhancements

  • incorporate libarchive to support more compression formats (this adds libarchive as a package dep) #3163
  • add the build/ignore_verify_codes key so recipes can ignore specific conda-verify error codes #3179

๐Ÿ’… Bug fixes

  • fix a JSON string encoding error in index cache reading #3156
  • restore the --variants CLI flag for specifying variants #3168
  • handle an empty build section in output #3175
  • add mro-base_impl as something that causes mro build strings #3163
  • fix skeleton PyPI inappropriately dropping package case (it's needed for URLs) #3163
  • fix packages from earlier loops with multiple outputs being removed before later loops #3185
  • fix conda-index not removing entries from the index that no longer exist on disk #3186 #3188
  • clean up tempfiles after indexing #3187
  • fix indexing of specific subdirs #3190
  • fix the pypi skeleton when the python constraint has no operator #3191
  • fix issues testing packages and recipe folders when done separately from build #3192
  • fix source looking for patches in the wrong folder when dealing with outputs #3194

๐Ÿ‘‘ Contributors

  • @dpryan79
  • @gabm
  • @mbargull
  • @mingwandroid
  • @msarahan
  • @nehaljwani

๐ŸŽ€ 3.15.1 (2018-09-18)

๐Ÿ’… Bug fixes

  • sort the "removed" fns in index repodata.json #3154
  • fix deps being merged instead of clobbered #3154
  • handle corrupt packages during indexing better #3154

๐Ÿ‘‘ Contributors

  • @msarahan

๐Ÿงš 3.15.0 (2018-09-17)

โœจ Enhancements

  • add a CLI flag (--strict-verify) to allow erroring out when conda-verify fails a package #3135
  • output text stating that the license file has been successfully found and included with a package #3152

๐Ÿ’… Bug fixes

  • allow channel auth when checking if a package is built #3133
  • if the local git cache can't be updated, delete it and barf (so the user can re-run) #3136
  • clean up duplicate pip requirements produced by skeleton #3138
  • replace the recipe_log.txt file with a recipe_log.json file (for passing recipe history along with the package) #3139
  • fix decoding to str before passing package contents to JSON loading #3140
  • fix loss of the "removed" section of the index with every other indexing operation #3144
  • fix update_index used in tests to index the channel, not the subdir #3145
  • fix ELF sections not being included in the memory image of a process being loaded by pyldd, which gave misleading results #3148
  • fix index operations outputting debug log messages #3151
  • fix private channels showing 404 errors during the test phase #3153

๐Ÿ‘‘ Contributors

  • @Bezier89
  • @gabm
  • @jakirkham
  • @jjhelmus
  • @kalefranz
  • @msarahan
  • @stuarteberg
  • @teake

๐Ÿ’œ 3.14.4 (2018-09-11)

๐Ÿ’… Bug fixes

  • fix recipe_log.txt not being filtered from info/files #3134

๐Ÿ‘‘ Contributors

  • @msarahan

๐Ÿ“ 3.14.3 (2018-09-11)

โœจ Enhancements

  • add support for index patch instructions as tarballs containing subdirs #3129
  • add progress bars for indexing (using tqdm) #3130

๐Ÿ’… Bug fixes

  • fix log messages being deduplicated way too much #3130
  • handle permission errors with moving files in indexing more gracefully #3132

๐Ÿ‘‘ Contributors

  • @msarahan

๐ŸŒธ 3.14.2 (2018-09-07)

โœจ Enhancements

  • add support for a "recipe log" file. This gets used at Anaconda to capture the commit activity of a given recipe, which then gets published in the RSS feed. #3123

๐Ÿ’… Bug fixes

  • fix indexing of the noarch subdir as done by conda-forge #3120
  • decode cached index files to utf-8 before reading JSON #3121
  • try to address unicode problems in run_exports handling #3121
  • skip over index metadata files when they're not present in a package #3125

๐Ÿ‘‘ Contributors

  • @msarahan

๐Ÿฆ‹ 3.14.1 (2018-09-06)

๐Ÿ’… Bug fixes

  • detect and fall back to the old update_index behavior (the new one is channel-wide; the old one is specific to a subdir) #3117
  • fix CONDA_BUILD_STATE not being set when load_setup_py_data gets run #3117
  • fix channel_name as a CLI argument for conda index. It can't be positional. #3318

๐Ÿ‘‘ Contributors

  • @msarahan

๐Ÿ”ฅ 3.14.0 (2018-09-04)

โœจ Enhancements

  • refactor indexing to cache more efficiently #3091
  • add tags, identifiers, and keywords to the about section. Tie them into channeldata.json. #3091
  • filter .la files from packages by default #3102
  • memoize read_meta_file #3108

๐Ÿ’… Bug fixes

  • fix --check for optionally iterable fields #3098
  • fix permission problems prior to fixing shebangs #3101
  • do not disable pip's cache directory. Redirect it instead. #3104
  • fix usage of config in load_setup_py_data #3110
  • show a logger message when the default numpy is used, so the user actually knows what's happening #3110

๐ŸŽ€ Other

  • drop python 3.4, add 3.6, 3.7 to skeleton pypi #3103

๐Ÿ‘‘ Contributors

  • @jjhelmus
  • @kalefranz
  • @msarahan
  • @nehaljwani
  • @nsoranzo
  • @ocefpaf
  • @teake

๐ŸŒˆ 3.13.0 (2018-08-20)

โœจ Enhancements

  • add run_exports and aggregated post-install metadata indexing outputs #3060
  • allow whitelisting runpath entries #3072
  • consider *_compiler_version entries when looping over variants (this allows *_compiler_version to be a used variable that affects the hash) #3084

๐Ÿ’… Bug fixes

  • fix cached git info for variants #3082
  • fix the linux temporary channel not being added at test time, which left the package unresolvable #3088

๐Ÿ‘‘ Contributors

  • @msarahan
  • @teake

โญ 3.12.1 (2018-08-06)

โœจ Enhancements

  • add the "extra" field of a package's meta.yaml file into the output package's info/about.json file #3048
  • add an option to omit the local channel in is_package_build (used by c3i) #3051
  • add pip env vars to stop pip from pulling in external dependencies when it's used in build scripts #3053

๐Ÿ’… Bug fixes

  • fix the local channel always being top priority. Now user-defined channel orders can put local lower than remotes. #3049
  • fix the conda-verify import error warning showing up in --output text #3052
  • fix the RPM skeleton test (point to a newer CentOS repo) #3054
  • fix test/files and test/source_files looking in the wrong place for info/recipe/parent contents (subpackages) #3061

๐Ÿ‘‘ Contributors

  • @Bezier89
  • @jakirkham
  • @mikecormier
  • @mingwandroid
  • @msarahan

๐Ÿ’– 3.12.0 (2018-07-24)

โœจ Enhancements

  • allow user-specified channels to come ahead of the local channel #3038
  • add a schema for the outputs section in FIELDS; provide a method for getting rendered recipe text (to support conda-verify) #3041
  • enable conda-verify by default when it's importable, but only print warnings by default instead of exiting #3042
  • add the --label CLI argument so you can specify the label for uploading packages to #3043

๐Ÿ› Bug fixes

  • fix apply_selectors, leading to excessive detection of used variables #3040

๐Ÿซถ Contributors

  • @CJ-Wright
  • @msarahan
  • @speleo3

โœจ 3.11.0 (2018-07-20) โœจ

๐Ÿ› Bug fixes

  • improve environment marker support for pypi skeleton #2972
  • apply selectors before checking requirements, to better understand per-platform used vars #2973
  • Handle conda UnsatisfiableError causing packages to be moved to broken folder without tests actually being run on them #2974 #2975
  • use tempfiles when writing index to reduce risk of corrupt index #2978
  • handle conda index recipe info for older versions of conda-build #2979
  • allow empty missing_dso_whitelist in build section #2983
  • fix host_reqs referring to a detached list, leading to requirements/host not being modified by run_exports #2987
  • fix for bypassing MITM proxies based on SSL_NO_VERIFY env var #2991
  • add missing_dso_whitelist to FIELDS #2994
  • Don't skip logic in pyldd based on CB verbosity (--quiet) #2999
  • Convert empty git refs to HEAD, so that git_url behavior is more predictable #3003
  • set NPY_DISTUTILS_APPEND_FLAGS=1 so the compiler package flags are respected #3015
  • fix script file renaming when converting package from win to unix #3014
  • allow fn to be omitted when using multiple url sources #3021
  • fix default config settings being shared across Config instances #3022
  • force text interpretation of CRAN DESCRIPTION files #3020
  • fix is_no_link to honor patterns #3023
  • fix test/requires being ignored when --no-copy-test-source-files is specified #3027
  • fix up dependencies in CRAN skeleton output #3030 #3032

๐ŸŒธ Enhancements

  • change skeleton pypi to generate recipes that use pip for install step. Remove description. #2972
  • Set environment variable to disable pip environment isolation to prevent problems #2972
  • support multiple exclusive_config_files #3022

๐Ÿ“š Docs

  • Fix search order for conda_build_config.yaml #3029

๐Ÿซถ Contributors

  • @isuruf
  • @j-hartshorn
  • @kalefranz
  • @mandeep
  • @mbargull
  • @mcg1969
  • @mingwandroid
  • @minrk
  • @msarahan
  • @nehaljwani
  • @ocefpaf
  • @tjd2002

โœจ 3.10.9 (2018-06-15) โœจ

๐ŸŒˆ Other

  • docs are moving from the conda-docs repo into conda-build (splitting off from conda docs in general)

๐Ÿ› Bug fixes

  • fix re.escape usage for Python <3.3 #2970

๐Ÿซถ Contributors

  • @mbargull
  • @msarahan

โœจ 3.10.8 (2018-06-12) โœจ

๐Ÿ› Bug fixes

  • clean up license field for pypi skeleton #2938
  • fix regex to match requirements with trailing spaces #2948
  • Check for dash in text with variants #2949
  • do not check in build prefix for overlinking when merging build and host #2950
  • utils.glob: remove unnecessary normcas, fix test_expand_globs #2952
  • add missing "build" fields in FIELDS schema thing #2962

๐Ÿซถ Contributors

  • @isuruf
  • @mariusvniekerk
  • @mbargull
  • @mingwandroid

โœจ 3.10.7 (2018-06-01) โœจ

๐ŸŒธ Enhancements

  • replace glob2 by glob for py3 (speed improvement) #2937

๐Ÿ› Bug fixes

  • Fix folder copying in test/files #2941

๐Ÿซถ Contributors

  • @mbargull
  • @msarahan

โœจ 3.10.6 (2018-05-31) โœจ

๐ŸŒธ Enhancements

  • several rendering speed improvements #2925

๐Ÿ› Bug fixes

  • add regression test for #2912 #2914
  • fix a file handle not being closed #2915
  • fix an incorrect syntax RuntimeError #2920
  • fix custom compiler languages not being possible #2927
  • fix OS vars not correctly respecting test prefix; add test #2932
  • fix incorrect python versions showing up in test phase paths (SP_DIR) #2932
  • fix test/files functionality for outputs; add test #2934

๐Ÿซถ Contributors

  • @mbargull
  • @msarahan
  • @nicoddemus
  • @rainwoodman
  • @sodre
  • @tomashek

โœจ 3.10.5 (2018-05-23) โœจ

๐ŸŒธ Enhancements

  • allow '*' as an ignore_run_exports value to ignore all run_exports #2907

๐Ÿ› Bug fixes

  • fix handling of empty run and test requirements #2908
  • fix trailing zeroes in version numbers getting lost by yaml interpreting things as floats #2909
  • fix regression in host prefix showing up in the test phase, leading to files/executables not being where they should be #2910
  • fix handling of not-yet-available requirements #2912
  • fix get_value with default keyword not respecting that user-specified default #2912

๐Ÿซถ Contributors

  • @msarahan

โœจ 3.10.4 (2018-05-20) โœจ

๐Ÿ› Bug fixes

  • fix import tests being run multiple times #2892
  • add creative commons as a license family (used to be classified OTHER) #2893
  • handle empty packages in checks for duplicated files across subpackages #2894
  • set PYTHON and other language path vars based on presence in build/host reqs, rather than binary file in either env. Allows usage of PYTHON and friends in meta.yaml vars. #2895
  • fix entry points incorrecty pointing at build prefix (instead of host), leading to prefix replacement failing #2895
  • fix merge_build_host functionality. Adding an empty host section now forces build and host to be split. #2896

๐Ÿซถ Contributors

  • @msarahan
  • @scopatz

โœจ 3.10.3 (2018-05-17) โœจ

๐ŸŒธ Enhancements

  • --skip-existing applies to outputs, not just whole collections of packages. Individual outputs that are already built will be skipped. #2889
  • add output of hash contents to what gets printed with conda render (not with --output)

๐Ÿ› Bug fixes

  • fix conda pypi skeleton checking for '~' in None values #2880
  • add /B to win exits, so that erroring out of tests does not close out of outer shells #2881
  • ensure that merge_build_host is updated correctly for each output #2882
  • Remove several env vars from being recorded in about.json, over concerns for GDPR compliance #2883
  • remove parent_recipe entry from recipes when recording meta.yaml for output packages, to avoid confusion over used variables #2886
  • xfail get_installed_version for new conda and test_build_with_activate_does_activate when PATH is too long #2889
  • change os.rename to shutil.move so that there is a copy fallback #2889
  • fix mutability of config objects passed to test causing bizarre states of variants
  • fix win style slashes in paths.json and files that broke things when converting a win package to unix #2891

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan

โœจ 3.10.2 (2018-05-08) โœจ

๐Ÿ› Bug fixes

  • fix downstream test not using channel list; fix exact specs in downstream testing #2864
  • add deprecation notice for msvc_compiler key in meta.yaml. Explain its incompatibility with variants. #2868
  • set default cran mirror #2868
  • disallow merging of build and host prefixes when host_subdir != build_subdir #2876

๐Ÿซถ Contributors

  • @msarahan

โœจ 3.10.1 (2018-05-01) โœจ

๐Ÿ› Bug fixes

  • fix handling of downstream testing when downstreams don't exist yet (e.g. bootstrapping) #2860
  • fix handling of downstream testing in tandem with --output-dir or --croot (add locations as file:// urls) #2860
  • fix improperly escaped entries in cran template. Clean up unnecessary changes. #2861

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan

โœจ 3.10.0 (2018-05-01) โœจ

๐ŸŒธ Enhancements

  • Warn user about path conflicts during environment building for test phase #2843
  • Add conda 4.6 compatibility #2844
  • remove conda 4.2 and earlier compatibility #2845
  • add info to merge/copy source subdir error #2858
  • Add setup for Air Speed Velocity benchmarking #2859

๐Ÿ› Bug fixes

  • fix python handling when python is a tuple (inner python looping) #2854
  • fix python not looping in inner packages when top-level doesn't use it. Fix zip_keys handling. #2856

๐Ÿซถ Contributors

  • @kalefranz
  • @msarahan

โœจ 3.9.2 (2018-04-27) โœจ

๐ŸŒธ Enhancements

  • Optimizations to rendering to speed up dealing with lots of recipes #2838 #2848

๐Ÿ› Bug fixes

  • include folder as a field in source for linting purposes #2837
  • remove merging of constraints. Keep only the clobbering of groups of constraints by exact constraints (of which you can have only one) #2839
  • ensure u+w permissions before calling install_name_tool #2840
  • remove conversion of dash to underscore in pin_run_as_build #2842

๐Ÿซถ Contributors

  • @jakirkham
  • @mingwandroid
  • @msarahan

โœจ 3.9.1 (2018-04-24) โœจ

๐Ÿ› Bug fixes

  • Revert #2831 (add license file for R packages from CRAN) due to incompatibility with package layout in defaults
  • handle OrderedDict dumping to yaml better; further work on preserving dict key order in config yaml files #2834
  • consolidate cran default repo settings, respect variant setting better. #2836
  • Add conda-build/skeleton_config_yaml key to condarc to control which conda_build_config.yaml should be used to find the cran_mirror setting. #2836
  • Change default cran mirror from mran to cran. #2836

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan

โœจ 3.9.0 (2018-04-24) โœจ

๐ŸŒธ Enhancements

  • Add new key in test section, downstreams that accepts a list of package specs to test after the current package is built #2823
  • work to prevent unsafe paths in tarballs that would affect paths outside of the work dir #2822
  • simplify all constraints for a given package name to a single constraint that represents the tightest combination of them all #2694

๐Ÿ› Bug fixes

  • fix a misnamed cran skeleton key #2817
  • Remove unused index command in rendering path #2818
  • fix loss of ordering when using recipe_append #2825
  • fix usage of dict for default pin_run_as_build data structure. Losing ordering created noise down the line for Conda-Forge. #2830
  • fix selector regex being too greedy; reporting wrong used vars #2832

๐Ÿซถ Contributors

  • @ceball
  • @isuruf
  • @jamesabbott
  • @jdblischak
  • @mingwandroid
  • @msarahan

โœจ 3.8.1 (2018-04-16) โœจ

๐Ÿ› Bug fixes

  • fix shebang rewriting so that it only touches python[w]? shebangs #2786
  • fix a regression in ignoring python as a build-only dep being "used" and becoming a loop var #2799
  • improve config log warning #2801
  • skip, but warn about failures in pyldd #2802
  • fix whitespace in multi-line help strings #2808
  • fix variables in compound selectors not getting detected as "used" #2814

๐Ÿซถ Contributors

  • @bjlittle
  • @jbcrail
  • @mingwandroid
  • @msarahan

3.8.0 (2018-03-30) ๐Ÿ’–

Enhancements โœจ

  • bestie, there's a brand-new jinja2 function in town: resolved_packages โ€” use it to pin run or test requirements to indirect dependencies as well as direct dependencies #2715

Bug fixes ๐Ÿ›

  • fixed an R/Rscript mixup that was breaking usage of the R env var #2782
  • better error message now when additional modules are needed in the root env in order to render a recipe #2784
  • fixed handling of FEATURE_NOARCH, which was adding specs that conda's solver literally didn't understand #2787
  • license_file can now be found in either the source root or the recipe root (which was, ngl, a common point of confusion) #2792
  • fixed disable_pip removing setuptools even when it was an explicit dependency. The way that this broke is conda changed its string representation of MatchSpecs and our regex just did not take that into account #2793

Contributors ๐Ÿ‘‘

  • @183amir
  • @msarahan

3.7.2 (2018-03-22) ๐Ÿฆ‹

Enhancements โœจ

  • added runpath handling to pyldd #2768
  • added lgtm.com configuration #2772

Bug fixes ๐Ÿ›

  • fixed language issues with finding directory size on windows #2749 #2766 #2760
  • now ignoring non-rendered jinja2 errors when indexing packages #2756
  • fixed cran skeleton argparse errors when the version flag isn't provided #2751 #2759
  • fixed exact pinning in subpackages raising errors due to non-final output data conflicting with final top-level data #2763
  • test_preferred_env is skipped until conda more fully implements it #2722
  • don't run mk_relative_osx on linux DSO's #2768
  • use Rscript to run R tests, so console output is shown more clearly. Only add an r-base spec if neither r-base nor mro-base are already in deps #2764
  • don't filter out .gitignore and .gitmodules when packaging #2774
  • fixed the pin_* regex that was erroneously picking up wrong usages #2775

Contributors ๐Ÿ‘‘

  • @bilderbuchi
  • @kfranz
  • @m-rossi
  • @mingwandroid
  • @msarahan
  • @wikiped

3.7.1 (2018-03-08) ๐ŸŽ€

Enhancements โœจ

  • enabled glob2.fnmatch for shared library whitelists. Added more Frameworks to the whitelist on Mac #2732

Bug fixes ๐Ÿ›

  • squelched yaml ScannerError when building index can't read meta.yaml in a package #2740
  • fixed & simplified the "hoisting" of source folders up one level #2741
  • fixed build number not getting inherited from top-level metadata #2742
  • allow the output creation environment for wheels to be activated #2744
  • fixed the selector regex for finding "used" variables โ€” it was finding too much across lines #2745
  • now ignoring empty config files (no more erroring out on them) #2746

Contributors ๐Ÿ‘‘

  • @mingwandroid
  • @msarahan
  • @neok-m4700

3.7.0 (2018-03-05) ๐ŸŒธ

Enhancements โœจ

  • raises ValueError when pin_subpackage is used but no matching output is found #2720
  • added a new optional CLI argument, --extra-deps, to add test-time dependencies dynamically when splitting build and test phases (it can't apply variants when phases are split) #2724

Bug fixes ๐Ÿ›

  • fixed cran skeleton py2 invalid list copy syntax #2720
  • reconfigured TravisCI to test against conda master #2720
  • fixed inaccurately raised problems with pin_subpackage #2720
  • coerced boolean values in conda_build_config.yaml to booleans (value.lower() == "true") #2723
  • changed the r skeleton cran test to a different package (nmf -> acs); nmf got removed
  • fixed selectors being applied before variable detection, which led to variables in selectors never being detected #2723
  • added filesize calculation to converted script files #2727

Contributors ๐Ÿ‘‘

  • @mandeep
  • @msarahan

3.6.0 (2018-02-28) ๐Ÿงš

Enhancements โœจ

  • allow per-output {pre,post}-{un,}link scripts #2712
  • support mro as part of the build string #2711
  • improved interpreter guessing for running output packaging scripts #2709
  • improved the library overlinkage check, plus added support for whitelists of always-ok libraries to ignore #2708
  • added support for noarch: generic recipes in the cran skeleton generator
  • added support for using Rtools on windows when building a package from source
  • added support for binary repackaging of CRAN/MRAN artifacts
  • added support for cran recipes from source tarballs
  • templated the cran_mirror variable in generated cran output recipes. This lets CRAN and MRAN be switched out easily. Default is MRAN #2710

Bug fixes ๐Ÿ›

  • reversed the build/host activation order, to give build executables higher priority. This is necessary to support proper R packaging. Also includes better errors for empty packages caused by build env python being used to install python packages #2686
  • fixed test scripts from subpackage outputs not being detected #2703
  • fixed sha in scripts during conversion from linux to windows packages (it wasn't correctly handling hashbang addition/removal) #2713
  • sped up stat gathering, and restricted it more to only build, packaging, and test steps (not arbitrary subprocess calls) #2714
  • now checking for incomplete files when inspecting links. Some files that looked like ELF files but weren't would trip up pyldd and kill the build #2718

Contributors ๐Ÿ‘‘

  • @jjhelmus
  • @MatthieuDartiailh
  • @mingwandroid
  • @msarahan

3.5.1 (2018-02-22) ๐Ÿ’œ

Enhancements โœจ

  • added relative path support for the load_setup_py_data jinja2 function #2700

Bug fixes ๐Ÿ›

  • fixed hoisting of archives containing folders named the same as the top-level folder. These subfolders were being removed inappropriately #2692
  • falls back gracefully when psutil fails to import. Disk and total time stats are still available; memory and CPU time are not when psutil is unavailable #2693
  • fixed directory size computation not being recursive, and used scandir for walk operations on py27 #2699

Contributors ๐Ÿ‘‘

  • @mariusvniekerk
  • @msarahan

3.5.0 (2018-02-20) ๐Ÿ”ฅ

Enhancements โœจ

  • prints resource statistics for each step, as well as the whole thing. CPU time, memory usage, disk usage #2685
  • records resource statistics to a JSON file when the --stats-file <output_file_path> argument is provided #2685

Bug fixes ๐Ÿ›

  • saves the complete parent recipe in info/recipe/parent for packages that are only outputs of a top-level package #2687

Contributors ๐Ÿ‘‘

  • @msarahan

3.4.2 (2018-02-15) ๐Ÿ“

Enhancements โœจ

  • allows trimming of skipped metadata in rendering to be optional (for the sake of conda-forge rendering readme's on platforms that are skipped) #2680
  • renames the build prefix prior to the test phase. This will precipitate failures when packages embed paths to the build prefix, which conda does not replace at install time. Fixing these instances is specific enough to packages that we do not attempt to handle it in conda-build #2681
  • added conda_interface.get_install_version function that facilitates checking if a pkg is in an env, and if so, what its version is #2682

Bug fixes ๐Ÿ›

  • uses lookaheads in extraction regexes to avoid capturing unwanted text #2679

Contributors ๐Ÿ‘‘

  • @msarahan

3.4.1 (2018-02-08) ๐ŸŽ€

Bug fixes ๐Ÿ›

  • fixed interpretation of zip_keys when testing pkgs (ignores empty values) #2673

Contributors ๐Ÿ‘‘

  • @msarahan

3.4.0 (2018-01-31) ๐ŸŒˆ

Enhancements โœจ

  • implemented the --exclusive-config-file CLI flag for render & build. This file bypasses detection of config files in $HOME and cwd, but respects any config files in recipe folders #2661
  • activates output scripts in meta.yaml ( #2667 ), but only when:
    • the output has a build/script entry
    • the output uses the {{ compiler() }} jinja2 function in its requirements AND the output extension is either .sh or .bat
    • the output has a build/activate_in_script key in meta.yaml set to a truthy value AND the output extension is either .sh or .bat

Bug fixes ๐Ÿ›

  • fixed AttributeError in the overlinking check #2650 #2651
  • reordered mmap operations to fix a problem with WSL #2655
  • fixed numpy detection as a "used" variable when using pin_compatible jinja2 #2659
  • silenced conda KeyError warnings when indexing legacy packages that don't have newer metadata files #2656
  • replaced "which" with "type -P" in conda-build's internal recipe. This avoids issues on PowerPC and with long paths #2664
  • now errors out when version computation fails in conda-build's setup.py. This helps prevent conda-build packages going out without valid internal versions being recorded (for example, when git is not installed on a build worker) #2665
  • ignores tarcheck errors for files in the info folder that don't appear in the info/files file. Fixes inclusion of arbitrarily named readme files #2668
  • cleans up the host prefix in between skeletons when using pypi's --recursive mode. Conda otherwise throws errors on the 2nd recipe #2669

Contributors ๐Ÿ‘‘

  • @kfranz
  • @mingwandroid
  • @msarahan
  • @nehaljwani
  • @neok-m4700
  • @steamelephant

3.3.0 (2018-01-23) ๐Ÿ‘‘

Enhancements โœจ

  • issue template created for the github repo #2632
  • detects overlinking (usage of libraries that are not present in listed dependencies). Warns by default. Errors out with the --error-overlinking flag. Conda-build 4.0 will error by default #2635 #2647

Bug fixes ๐Ÿ›

  • fixed merge_build_host to always be used in CRAN skeletons #2635
  • fixed macho filename attribute error #2641
  • reordered the search through files for compatibility bounds for speed #2638
  • caches used vars based also on recipe path, to avoid overly caching results #2643
  • normalizes slashes in file glob lists for explicit output file lists #2644
  • silences conda 4.4 better when using quiet operations, such as --output #2645
  • fixed pypi_url not affecting the url of the actual skeleton output from conda skeleton pypi #2646
  • fixed overly broad string matching of "None" that caused problems where None may appear as part of a string in meta.yaml #2649

Contributors ๐Ÿ‘‘

  • @csoja
  • @mingwandroid
  • @msarahan
  • @nehaljwani
  • @neok-m4700

3.2.2 (2018-01-12) ๐Ÿ’ซ

Enhancements โœจ

  • added a CLI flag (--merge-build-host) to restore pre-3.1.4 behavior with merging build and host envs #26260

Bug fixes ๐Ÿ›

  • checks recipe/metadata skip status in more places, rather than strictly at the top-level #2617
  • fixed unnecessary conforming of zip keys when distributing variants #2618
  • fixed matching of unrendered output names when matching rendered names #2618
  • fixed matching of partial (only used parts) of variants when lining up subpackages #2618
  • fixed handling of outputs with the same name as the top level when considering used vars #2618
  • excludes top-level run_exports from applying to all outputs #2618
  • Fix linking compiler runtimes from build to host prefix (this was broken by the build/host prefix split way back in 3.1.4) #2621
  • Fix logic errors around merging build/host envs #2623
  • fix run_exports in outputs being overwritten #2623

Contributors

  • @jjhelmus
  • @mingwandroid
  • @msarahan

3.2.1 (2018-01-02)

Enhancements

  • Improve the BUILD environment variable value (especially on powerpc) #2615
  • Implement CentOS 7 ppc64le distro for conda skeleton rpm #2615
  • Improve handling of outputs that use the build/skip key to skip building #2616

Bug fixes

  • Don't loop in all zipped keys when collecting used vars. Leave it to consumers to decide what to do. #2612
  • Fix run_exports using pin_subpackage not applying versioning for the implicit top-level output #2613
  • Fix run_exports not applying to build-time environment creation for the top-level recipe (as opposed to outputs) #2613
  • Fix CRAN skeleton to better use host/build envs appropriately #2614
  • fix outputs not loading hash input info from files at test time correctly, leading to incorrect hashes and unresolved packages. #2616

Contributors

  • @mingwandroid
  • @msarahan

3.2.0 (2017-12-21)

okay so this one is a whole thing, bestie โ€” listen up ๐Ÿ’…

This release bumps the minor version to reflect the change in splitting the build and host folders originally introduced by 3.1.4. That change has proven to be disruptive to many users, and we felt it necessary to bump a minor version to indicate that people should pay attention to this change. There's more info in our docs at https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#host

Enhancements

  • Add log messages for each source of variants, so that you know where values are coming from #2597

Bug fixes

  • remove unnecessary looped rm_rf when cleaning out prefixes between outputs #2587
  • fix meta.yaml not found errors when trying to test packages built with --no-include-recipe #2590
  • fix zipped key group with single entry causing a list to be passed later for single string values #2596
  • fix incomplete change to splitting build and host envs #2595
  • fix merging of top-level requirements and output reqs when output named same as top-level #2595
  • fix handling of outputs with templates in their name (they were losing their requirements) #2595
  • fix test file copying to avoid re-provisioning source during tests #2595
  • tweak requirements regex to avoid misinterpreting python executable usage in test commands as usage of the python variant #2595

Contributors

  • @msarahan

3.1.6 (2017-12-15)

Bug fixes

  • fix test files in outputs (was losing reference to absolute path of recipe) #2584
  • fix several incorrect references to build_prefix that needed to be host_prefix #2584

Contributors

  • @msarahan

3.1.5 (2017-12-15)

Enhancements

  • detect "used" variables in selectors #2581

Bug fixes

  • Cache used variables for a given output on a given target platform to avoid recomputing this too often. This dramatically speeds up operations relative to 3.1.4. #2581
  • fix used variable treatment of target_platform #2581

Contributors

  • @msarahan

3.1.4 (2017-12-14)

Enhancements

  • detect "used" variables in build.sh, bld.bat and any output scripts, in addition to what already existed in meta.yaml. Used variables end up in the hash. #2576
  • don't merge build and host prefixes. We used to do this when host subdir == build subdir. Keep them separate, so that build tools in build prefix won't ever interfere with software installed to host, to be packaged. #2579

Bug fixes

  • exclude grouped keys from zip_keys when computing hashes. Only direct dependencies affect the hash. #2573
  • fix always_include_files usage omitting other ordinarily installed files #2580

Contributors

  • @msarahan

3.1.3 (2017-12-13)

Enhancements

  • support environment variable expansion in path-related condarc settings #2563
  • speed up "fixing linking" on MacOS by ~98% #2564
  • Allow build/script and build/script_env entries in outputs, for simple scripts and for passing env vars into output scripts #2572

Bug fixes

  • fix run_exports from build section not applying to host early enough and causing conflicts #2560
  • order outputs based on build, host, and run dependencies, not just run #2561
  • fix always_include_files when used in output sections #2569
  • add jinja2 to dependencies in setup.py (not just in conda.recipe) #2570

Contributors

  • @akovner
  • @mingwandroid
  • @msarahan
  • @nehaljwani
  • @rlizzo

2017-12-9 3.1.2:

Bug fixes

  • fix copying of relative paths with source_files in test section #2551
  • fix handling of too many x's in max_pin field. If more x's than actual places were present, the incrementing broke. #2552
  • refactor upstream pinning, fix extraction of outputs so that run_exports and pin_compatible work with them #2556
  • fix bug that occurred when an output had the same name as the top level recipe. Ended up extracting wrong part of recipe with wrong regex. #2556
  • fix copying of recipe losing folder structure in the destination copy of the recipe #2557

Contributors

  • @msarahan
  • @nehaljwani

3.1.1 (2017-12-06)

Bug fixes

  • fix info files filters on windows #2542
  • fix icon.png files that needed to be included in the app section of recipes, for usage with Navigator #2545
  • fix package matching regex for packages with - in them (regex should find either - or _) #2546
  • fix detection of used variant variables within jinja2 conditionals #2547
  • fix output extraction regex (was picking up whole outputs section, not just one output). Also, fix top-level variables not being carried into later outputs. #2549

Contributors

  • @jjhelmus
  • @msarahan

3.1.0 (2017-12-05)

Enhancements

  • Speed up package inspection by optimizing package file lookup #2535
  • Simplify hashing scheme. A hash will be added if all of these are true for any dependency:
    • package is an explicit dependency in build, host, or run deps
    • package has a matching entry in conda_build_config.yaml which is a pin to a specific version, not a lower bound
    • that package is not ignored by ignore_version OR
    • package uses {{ compiler() }} jinja2 function

All other packages will no longer have hashes. The takeaway message is that hashes will appear when binary compatibility matters, but not when it doesn't. #2537

Bug fixes

  • Allow packages to store files in info folder #2538
  • Fix source_files not working correctly when using test files in packages #2539

Contributors

  • @mingwandroid
  • @msarahan

3.0.31 (2017-11-30)

Enhancements

  • expose time and datetime modules in jinja2 context, for use in meta.yaml #2513
  • jinja: permit recipes to check for existence of a variable without erroring #2529
  • add method for getting all variant values used by a recipe, not just those variants with more than one value. #2531

Bug fixes

  • allow SSL_NO_PROXY env var to disable SSL checking on proxied connections #2505
  • Fix source hoisting issues (incorrectly flattening directory structure of extracted archives) #2507
  • Fix build env for output getting lost when output name == top-level name #2511
  • add global pin_run_as_build for R (x.x.x) to keep legacy R pinning behavior #2518
  • Fix path conversion issues going from windows to unix #2522
  • only insert variant versions when testing runtime availability for packages that are also present in build (not just run) #2527

Contributors

  • @anton-malakhov
  • @bheklilr
  • @mandeep
  • @msarahan
  • @stuarteberg

3.0.30 (2017-11-15)

Bug fixes

  • write all 'about' metadata fields out, not just select few #2488
  • fix lists getting nested during merging of configs, leading to TypeErrors #2494
  • make always_include_files act on host_prefix, not build_prefix #2497
  • warn users when script_env passes env vars through #2502
  • fix build string pyXY being just pyX when input didn't have full python version #2504

Contributors

  • @jakirkham
  • @msarahan

3.0.29 (2017-11-10)

Enhancements

  • interpret ~= in pypi skeletons, map to compatible expressions #2427
  • add arm and ppc architectures to conda convert #2472, #2474
  • add indentation to index.json and hash_input.json for easier reading #2476
  • check arch in index.json for platforms other than linux, mac, win #2478
  • update cran skeletonizer for new compilers, add flags for updating, rather than replacing recipe. #2481

Bug fixes

  • fix implicit pinning not taking effect in outputs, fix incorrect matching of hashed subpackages #2455
  • exclude python from build requirements for purposes of hash computation. This was causing recipes that used python as a build tool to build too many similar packages. #2455
  • Support GIT_* vars even when source folders are specified #2477
  • silence warnings about .* being added to vc deps #2483
  • fix non-finalized recipe being used for creating build env, resulting in too few variants in output #2485

Contributors

  • @mandeep
  • @mingwandroid
  • @msarahan
  • @stuarteberg

3.0.28 (2017-11-02)

Enhancements

  • Implement "subspace selection" โ€” so you can reduce a larger central set of variants to some smaller subset. Fixes --python=X.Y on windows, with its zip_keys. #2466
  • Update cpan skeleton #2156
  • Pass through VSXY0COMNTOOLS env vars, so they're available in activate scripts called from outputs #2453
  • Add additional index-related files for Anaconda Navigator to use #2463
  • Add back CONDA_PY, CONDA_NPY, and friends, for backcompat with conda-build-all #2469

Bug fixes

  • Fix build_folder selection in dirty envs #2445
  • Fix an os.rename back to copy_into for cross-volume compatibility #2451
  • Clean up leftovers created by utils.get_recipe_abspath #2459
  • fix path globbing and filtering replacing prefix not at start of path, which broke file copying #2468
  • Don't recreate envs unnecessarily for recipes with no outputs section #2470

Contributors

  • @jerowe
  • @kalefranz
  • @msarahan
  • @neok-m4700
  • @rendinam

๐ŸŒˆ 3.0.27 (2017-10-17)

โœจ Enhancements

  • for windows error checks, it now asserts that the errorlevel is 0 instead of GEQ 1 ๐Ÿ’… so negative return codes now fail builds, the way they always should have. #2442
  • you can pass channels to the metapackage command now ๐ŸŽ€ #2443 โ€” but bestie, listen: those channels are not recorded to the package, so you've gotta pass them at package install time as well as at metapackage creation time. two separate moments. don't forget. ๐Ÿ˜ญ

๐Ÿ› Bug fixes

  • fixed windows bits dictionary indexing using an incorrect type #2441

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒˆ 3.0.26 (2017-10-16)

โœจ Enhancements

  • conda index now generates html index pages in addition to repodata.json ๐Ÿ‘‘ #2395
  • bash verbosity (that's the -x flag) now depends on how you set the --debug flag #2426
  • test and build sections in any outputs get passed through wholesale now, instead of picking out individual fields from them #2429
  • conda-verify is now opt-in, not opt-out ๐Ÿซถ use the --verify cli argument, or the verify keyword in the api. #2436
  • implemented requires_features and provides_features, for compatibility with conda 4.4's new key-value feature #2440

๐Ÿ› Bug fixes

  • fixed FEATURE_* variables not working, which was a type error situation #2428
  • fixed a misleading error for when download_url is present but empty #2434
  • now checks the HTTP status code of the PyPI pkg manifest request before decoding it, so the error message is actually useful #2435
  • fixed 64-bit exe's showing up in 32-bit win packages โ€” that was because host_arch wasn't being accounted for with script files #2439
  • fixed a hardlink-breaking bug where a path was being copied instead of a specific file. also using a better tempdir now ๐ŸŽ€ #2437

๐Ÿซถ Contributors

  • @Bezier89
  • @eklitzke
  • @kalefranz
  • @maddenp
  • @msarahan
  • @nehaljwani

๐ŸŒˆ 3.0.25 (2017-10-06)

๐Ÿ› Bug fixes

  • unified usage of conda_43, and learned to let the tests run ๐Ÿ™ˆ #2424

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒˆ 3.0.24 (2017-10-06)

โœจ Enhancements

  • added a get_used_loop_vars() function to the MetaData object, so you can see which loop variables a recipe actually uses ๐Ÿ” #2410
  • pypi skeletons now allow multiple file extensions, not just .tar.gz #2412

๐Ÿ› Bug fixes

  • build reqs are now equivalent to host when cross-compiling and there's no host section present (this helps so you don't have to keep modifying python-only recipes, thank u) #2406
  • reduced logging output from filelock and conda #2418 #2422
  • don't strip files in noarch: python when they're not known file types ๐Ÿ’… #2420
  • fixed an infinite loop when trying to build a dep from a found recipe, but that recipe is the wrong version ๐Ÿ˜ญ #2423
  • updated perl used on appveyor for testing to 5.26

๐Ÿซถ Contributors

  • @minrk
  • @msarahan
  • @nehaljwani

๐ŸŒˆ 3.0.23 (2017-09-29)

๐Ÿ› Bug fixes

  • simplified handling of blank fields in CRAN metadata #2393
  • conda_build_config.yaml now loads from inside the package when you're testing a package separately from the build process #2399
  • using sets instead of lists for field descriptions #2403
  • fixed noarch_python packages getting pinned to a specific python version ๐Ÿฆ‹ #2409

๐Ÿซถ Contributors

  • @Bezier89
  • @CJ-Wright
  • @jdblischak
  • @msarahan

๐ŸŒˆ 3.0.22 (2017-09-20)

๐Ÿ› Bug fixes

  • fixed the filename_hashing setting being ignored when using the conda-build API #2385
  • fixed relpath causing cross-drive issues on windows #2386
  • .a files are now examined when considering prefix replacement #2390
  • fixed the run/test deps check looking at build_subdir rather than host_subdir (which had broken cross compiling) #2391

๐Ÿซถ Contributors

  • @Bezier89
  • @mingwandroid
  • @msarahan

๐ŸŒˆ 3.0.21 (2017-09-18)

๐Ÿ› Bug fixes

  • fixed strong run_exports from build being applied to host too late, which ran into conflicts (especially with VC features) #2383
  • it now crashes properly when patching fails, rather than just proceeding with the build ๐Ÿ’€ #2384

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒˆ 3.0.20 (2017-09-16)

๐Ÿ› Bug fixes

  • never activate build or host env when building conda, so symlinks or .bat files are never created ๐Ÿซถ #2381
  • apply "strong" run_exports from the build section to the host section, not just the run section. this is necessary for making sure features activated by packages in the build section are used to line up the host section too. #2382

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒˆ 3.0.19 (2017-09-15)

๐Ÿ› Bug fixes

  • write info/files for noarch. and always sanity check info/files โœจ #2379
  • fixed build_prefix -> host_prefix in write_pth, which fixes cross compiling python packages #2380

๐Ÿซถ Contributors

  • @Bezier89
  • @msarahan

๐ŸŒˆ 3.0.18 (2017-09-14)

๐Ÿ› Bug fixes

  • fixed source hash not being verified #2367
  • fixed several references to arch that should be host_arch, to support cross compiling (win-32 on win-64, for example) #2369, #2368
  • recipe run requirements are now replaced with the contents of index.json's "depends" when testing packages #2370
  • updated R and perl versions in DEFAULT_VARIANTS #2373
  • fixed versioneer showing an unknown version on windows because of the --match argument #2375
  • added subdir to the moved work folder dirname, so cross compiling doesn't clobber stuff ๐ŸŒธ #2376

๐Ÿซถ Contributors

  • @jjhelmus
  • @mingwandroid
  • @msarahan

๐ŸŒˆ 3.0.17 (2017-09-12)

โœจ Enhancements

  • added track_features and features to output options, so you can configure features per-output ๐ŸŽ€ #2358

๐Ÿ› Bug fixes

  • fixed conda symlinks misbehaving when building a conda package #2359

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒˆ 3.0.16 (2017-09-12)

โœจ Enhancements

  • the env check can now be bypassed when rendering (for c3i) #2353
  • provided a mechanism for a compiler version to be passed to the compiler jinja2 function (match the name with _version) #2356

๐Ÿ› Bug fixes

  • using host_subdir instead of build_subdir when setting selectors #2345
  • downloaded files get removed from the source cache if they failed at any download step #2349
  • fixed variants being merged across multiple builds because a global was being modified ๐Ÿ˜ญ #2350
  • disabled pyldd disagrees warning output for now #2352

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan

๐ŸŒˆ 3.0.15 (2017-09-04)

๐Ÿ› Bug fixes

  • fixed relative paths for the croot argument to the CLI; tested it too ๐Ÿ’… #2335
  • fixed several issues with zip_keys #2340
  • fixed output build number never applying #2340
  • fixed ensure_matching_hashes for strong/weak run_exports #2340
  • fixed indexing of channels, especially before testing packages #2341
  • wheels and unextractable files (.sh) are now copied into the workdir with their original, un-hashed filename, for simplicity when working with them #2343
  • avoids attempting to overwrite existing files in the source cache #2343
  • avoids unsatisfiable requirement errors by adding .* to specs that lack .* or >/</>=/<= #2344

๐Ÿซถ Contributors

  • @gabm
  • @msarahan

๐ŸŒˆ 3.0.14 (2017-08-29)

๐Ÿ› Bug fixes

  • fixed config.arch comparison being the wrong data type #2325
  • fixed run_exports handling with dict of lists #2325
  • pyldd: disambiguates java .class files from Mach-O fat files (they've got the same magic number ๐Ÿ‘€) #2328
  • fixed the hash regex for downloaded files in src_cache #2330
  • fixed zip_keys becoming a loop dimension when variants are passed as an object rather than loaded from a file #2333
  • fixed windows always warning about old compiler activation. now it only warns if {{ compiler() }} is not used. #2333
  • added LD_RUN_PATH back into Linux variables for now (may be removed later, but there'll be a deprecation cycle) #2334

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan
  • @neok-m4700

๐ŸŒˆ 3.0.13 (2017-08-26)

โœจ Enhancements

  • output build number and string can now be set independently of top-level metadata ๐Ÿฆ‹ #2311
  • added a file hash to source cache filenames to avoid collisions #2312
  • added the notion of "strong" or "weak" run exports. strong apply to run whether the parent is in build or host. weak apply only if in host, or in build with no host present. #2320

๐Ÿ› Bug fixes

  • fixed PY3K value changing from 0/1 to True/False. keeping it 0/1. ๐Ÿ’…
  • work_dir is now the cwd when running output bundling scripts. it was the host prefix before now.
  • start tmpdir prefixes when getting dependency versions with _, so that conda can be one of the deps #2321
  • avoids setting empty compiler variables #2322
  • removed a meaningless error with glob_files and always_include_files during env creation #2323

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒˆ 3.0.12 (2017-08-23)

โœจ Enhancements

  • updated default MACOSX_DEPLOYMENT_TARGET to 10.9 #2293
  • modernized pin_depends so it works with conda render #2294
  • environment variable pass-throughs now respect variant (env var highest priority; variant, finally default) #2310

๐Ÿ› Bug fixes

  • fixed run_exports getting picked up transitively #2298
  • fixed the default compiler not having a platform #2300
  • fixed CONDA_PY formatting (it should not have a period). PY_VER does have a period. #2304
  • updates the index before testing a package, so that that package is conda-installable ๐Ÿซถ #2308
  • updates the index after moving a package after a test failure, so the index stays current #2308
  • fixed --output-folder not being respected by the --output preview of the output path #2309

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan

๐ŸŒˆ 3.0.11 (2017-08-17)

โœจ Enhancements

  • sets the BUILD environment variable (the triplet used by cross-compiling) #2285
  • respects the condarc cache_dir setting for changing the source cache dir location #2278
  • runs selectors before returning meta.yaml extractions #2284

๐Ÿ› Bug fixes

  • fixed CRAN skeleton field truncation with ; characters #2274
  • warns about overlapping files in subpackages within a recipe #2275
  • fixed --override-channels not taking effect #2277
  • fixed double-activation on Windows for cross compiling #2280
  • fixed variant entry duplication with zipped keys #2280
  • fixed folder hoisting when the folder name in the archive matches the package name #2281
  • fixed the test env showing old cached packages when the test env has actually been removed #2282
  • fixed source code not being present for render when the source is necessary for render and there's more than one variant #2283
  • fixed binary_relocation not allowing lists of files #2288
  • fixed incorrect python (or none at all) being used for pyc compilation with python only in host reqs ๐Ÿ˜ญ #2290

๐Ÿซถ Contributors

  • @dsludwig
  • @jdblischak
  • @jjhelmus
  • @mingwandroid
  • @msarahan

๐ŸŒˆ 3.0.10 (2017-08-11)

โœจ Enhancements

  • provided variant variables for use in selector expressions โœจ #2258

๐Ÿ› Bug fixes

  • fixed the ordering of recipe elements in skeletonized pypi recipes #2230
  • trims empty variant sections (because of selectors) prior to zipping keys #2258
  • don't set blank env vars in build scripts #2259
  • Fix testing with recipe paths #2262
  • add newlines to test scripts #2265
  • Fix render command not considering provided channels #2267
  • fix get_value being hardcoded to only first entry #2268
  • fix setting target (target platform) in output section causing tarcheck validation error #2271
  • don't add setuptools to runtime dependencies in skeletonized pypi recipes (only build) #2272

Contributors ๐Ÿซถ

  • @chaubold
  • @msarahan
  • @mwcraig
  • @neok-m4700
  • @ratstache
  • @stuarteberg

๐ŸŒธ 3.0.9 (2017-08-02)

Enhancements โœจ

  • store test files specifed by test/source_files directly in packages. This allows testing of packages that do not include recipes. Recommendation: make subpackages for large data files. #2232 (okay this one is lowkey a whole feature bestie)
  • add new syntax to get_value for accessing list items, such as multiple sources #2247
  • add independently configurable source cache path (--cache-dir) #2249
  • add PKG_HASH env var, available in meta.yaml. Use this to put the package hash where you want it in your custom build/string field in meta.yaml. #2250

Bug fixes ๐Ÿ›

  • Fix test python using incorrect metadata config object, and then using wrong prefix #2226
  • Allow testing multiple conda packages or folders at once with wildcard CLI arguments #2227
  • Fallback path for ruamel_yaml to ruamel.yaml #2233
  • raise exception when both build/script in meta.yaml and build script (build.sh/bld.bat) are provided #2238
  • Fix unclosed file handle when loading setup.py data #2242
  • Fix 'path' source with multiple source #2247
  • improve compatibility with conda 4.4 #2248
  • remove hash from manually-specified build/string fields. Use new PKG_HASH env var instead. #2250
  • fix windows activate scripts getting included in windows packages #2251
  • ignore feature records in index for 'conda inspect' #2253
  • fix variant handling when variants affect the downloaded source (need re-extract, re-parse with new source at each step) #2254

Contributors ๐Ÿซถ

  • @Bezier89
  • @jjhelmus
  • @kalefranz
  • @msarahan
  • @mandeep
  • @mingwandroid
  • @stuarteberg

๐ŸŒˆ 3.0.8 (2017-07-20)

Bug fixes ๐Ÿ›

  • Fix internal conda-build recipe to include missing setuptools and not use pip #2221
  • Try to avoid downloading anything until we absolutely need it for rendering or build #2222 (patience era ๐Ÿ’…)
  • Fix regexes that were leading to unsatisfiable dependencies, especially with perl #2222
  • Tweak internal recipe to include more git info; adjust regex accordingly for this practice #2223

Contributors ๐Ÿซถ

@msarahan


๐Ÿฆ‹ 3.0.7 (2017-07-20)

Enhancements โœจ

  • Rewrite skeleton pypi template; match conda-forge standard #2205

Bug fixes ๐Ÿ›

  • Remove entry point links to avoid write-through to root envs #2209
  • Properly insert variant versions for x.x in outputs (not just parent recipe) #2210
  • Relax version constraints for lua and R in default variant #2213
  • fix test of package directly using wrong config object #2214
  • Don't check test env satisfiability when --no-test is passed #2218
  • Iron out prefix when noarch as host env. Was creating separate build/host envs inappropriately. #2219
  • Fix skipping finalization with finalize=False (for c3i speedup). #2219
  • Fix implicit variant looping โ€” wasn't keeping track of "used variables" that are used implicitly. #2219

Contributors ๐Ÿซถ

  • @mandeep
  • @mwcraig
  • @msarahan

๐ŸŽ€ 3.0.6 (2017-07-14)

Bug fixes ๐Ÿ›

  • Find git more intelligently, because build_prefix isn't always on PATH #2196
  • Fix up assorted RPM skeleton issues #2196
  • Fix and test "numpy x.x" recipes #2198
  • Fix and test --skip-existing. Ensure that it also works with --croot. #2200
  • Fix and test "python x.x" recipes #2201
  • Fix inappropriate insertion of variant versions that led to conflicts (for example, numpy) #2202

Contributors ๐Ÿซถ

  • @mingwandroid
  • @msarahan

๐Ÿ“ 3.0.5 (2017-07-12)

Bug fixes ๐Ÿ›

  • Fix --skip-existing (was not matching output-dir/croot locations correctly) #2192
  • Fix numpy x.x getting .* appended, resulting in unsatisfiable numpy #2193

Contributors ๐Ÿซถ

@msarahan


๐Ÿ’œ 3.0.4 (2017-07-11)

Bug fixes ๐Ÿ›

  • Don't symlink conda when building conda (clobbers actual scripts) #2167
  • Fix pyldd following links #2170
  • Preserve mode bit on noarch python bin/Scripts files #2171
  • remove logging output showing up with --output option #2174
  • Fix CONDA_* variables without . #2176
  • pass croot to extraction (file path length issue on win) #2178
  • fix uncorrect unpacking of tuples with --skip-existing #2179
  • Fix priority of setup.cfg over setup.py #2180
  • Remove overly aggressive removal of test prefix at end of test phase #2182
  • Fix upper bound increment to account for pre-release versions (alpha, beta, rc, etc.) #2183

Contributors ๐Ÿซถ

  • @jjhelmus
  • @mingwandroid
  • @msarahan

๐Ÿงš 3.0.3 (2017-07-07)

Bug fixes ๐Ÿ›

  • fix loss of setup.cfg reading due to bad merge #2163
  • avoid error when attempting to sort list, and that list consists of dicts #2163

Contributors ๐Ÿซถ

@msarahan


๐Ÿ’– 3.0.2 (2017-07-06)

Enhancements โœจ

  • Add SSL_CERT_FILE and REQUESTS_CA_BUNDLE env vars to passed-through variables #2142
  • Sort several package aspects for package reproducibility #2143 #2149 #2154
  • Add glob2 dependency to allow recursive globs in fields specifying filenames/paths #2146
  • Add conda skeleton rpm for creating recipes to repackage RPMs as conda packages #2147
  • Improve error messaging when git describe fails due to lack of annotated tags #2158

Bug fixes ๐Ÿ›

  • drop setup.py data that is not JSON serializable #2141
  • enhance support for recipes containing unicode or non-ascii characters in meta.yaml #2148
  • CRAN skeleton: allow some keys to be blank without throwing exceptions #2153
  • Fix incorrect arguments passed to pyldd (use keywords) #2160
  • fix incorrect distribution of variants when more than one variant key matched #2161

Contributors ๐Ÿซถ

  • @aburgm
  • @dougalsutherland
  • @dhirschfeld
  • @mandeep
  • @MatthieuDartiailh
  • @mingwandroid
  • @msarahan
  • @nehaljwani

๐ŸŒŸ 2.1.17 (2017-06-30)

Bug fixes ๐Ÿ›

  • Fix disable_pip removing packages even when they are explicit dependencies #2129
  • Remove any pyc files for entry point scripts that pip may have created #2134
  • Ignore unserializable data when reading setup.py data #2141

Contributors ๐Ÿซถ

  • @mandeep
  • @msarahan

๐Ÿ‘‘ 3.0.1 (2017-06-29)

This release includes all changes to the 2.1.x branch up to and including the 2.1.16 release.

Enhancements โœจ

  • Raise errors prior to build if any run or test deps are unsatisfiable #2102
  • Add skeleton function for RPM packages, to be used for things like Xorg #2109
  • Improve test coverage of workdir removal #2111 #2112
  • Match variants in conda_build_config.yaml with dep names (implicit jinja2 version spec) #2124

Bug fixes ๐Ÿ›

  • fix reference to cc.subdir (it is just subdir) #2015
  • fix failing test when using filename_hashing=False (non-existent json file) #2087
  • fix dependencies specified to conda-convert not being added #2090
  • fix disable_pip removing packages even when they are explicit recipe deps #2129
  • fix pin_compatible jinja2 function not respecting lower_bound as None correctly #2138

Contributors ๐Ÿซถ

  • @jakirkham
  • @mandeep
  • @mingwandroid
  • @msarahan
  • @neok-m4700

โญ 2.1.16 (2017-06-23)

Enhancements โœจ

  • add CLI flag and condarc setting to disable --force for anaconda upload #2047
  • add doc_source_url to allowed fields in about section #2048
  • add a second pass for getting information from setup.py that is performed in the build environment, so that version-specific logic in setup.py should work. #2071
  • add semicolons to print statements in test files to avoid errors with Perl. #2012 #2089
  • pass through more CPU-specific environment variables on windows #2072
  • pass through DISPLAY environment variable on Linux #2098
  • Improve conda_interface for better conda 4.4 and later 4.3.x releases #2113
  • skeleton pypi & lua: replace legacy noarch syntax with conda 4.3 style #2120
  • Restore --keep-old-work flag: works like --dirty to leave your build intermediaries, but does not reuse build folders like --dirty. #2119
  • Speed up and fix-up conda-convert #2116 #2123

Bug fixes ๐Ÿ›

  • fix test/imports with multiple language entries #1967
  • add missing six dependency in conda recipe for conda-build #2063
  • fix dependency addition when converting packages #2091
  • don't set build_id in test phase when --no-build-id is given #2100
  • fix handling of string literals not being lists in test requirements from setup.py #2107

Contributors ๐Ÿซถ

  • @aburgm
  • @AndresGuzman-Ballen
  • @gqmelo
  • @isuruf
  • @kalefranz
  • @mandeep
  • @mingwandroid
  • @msarahan
  • @nehaljwani
  • @nsoranzo
  • @timsnyder
  • @vinjana

๐Ÿ”ฅ 3.0.0 (2017-05-23)

These release notes are an aggregation of all older pre-releases of conda-build 3.0.0. All changes from 2.1.15 and below have been incorporated.

Breaking changes ๐Ÿ’€

bestie sit down for this one. these are the glow-downs.
  • Support for post-build metadata (__conda_version__.txt and the like) has been removed.
  • pin_downstream has been renamed to run_exports #1911
  • exclude_from_build_hash has been renamed to ignore_version #1911
  • Package signing and verification have been removed, to follow their removal from conda 4.3. #1950

Enhancements โœจ

  • greatly extended Jinja2 templating capabilities #1585
  • record environment variables at top of build.sh, similar to what is done with bld.bat in win. #1765
  • use symlinks when copying to improve performance #1867
  • load setup.cfg data in load_setup_py_data #1878
  • calculate checksum and simplify cran skeleton #1879
  • Check that files are executable when finding them #1899
  • use rm_rf to remove prefixes for more cleanliness and better speed #1915
  • add support for multiple sources in one meta.yaml #1929
  • allow exact keyword for pin_compatible jinja2 function #1929
  • allow selectors in variant conda_build_config.yaml files #1937
  • Avoid duplicate recreation of package index โ€” speedup of 0-50%, depending on how extensively the recipe uses Jinja2 features. #1954 โœจ
  • Allow per-subpackage specification of target subdir #1961
  • Add basic environment marker support to conda skeleton pypi #1984
  • allow about section for each subpackage #1987
  • add support for optional dependencies (conda 4.4) #2001
  • fix windows entry point exe's for unicode #2045
  • allow strings for pin_run_as_build values (e.g. x.x) rather than just dictionaries #2042
  • add meta.yaml entry to override run_exports pins #2073
  • add several condarc entries that can be used to control conda-build behavior #2074
  • add new pyldd tool and use it when ldd/otool fail #2082
  • Allow configuration of conda-build's loggers by logging configuration files. Default to debug,info going to stdout, warn,error going to stderr. #2078
  • rename work dir before tests, rather than removing it, so that build intermediates can be inspected if tests fail. #2078

๐Ÿ’€ Bug fixes ๐Ÿ’€

  • fix symlinks to folders in packaging #1775
  • fix detection of patch level when maxlevel=0 #1796
  • properly copy permissions when extracting zip files #1855
  • Add more important Windows environment variables to the test environment #1859, #1863
  • remove build and test envs after each packaging step, to avoid unsatisfiable errors #1866
  • remove version pins from requirements added by run_test files (again avoid unsatisfiable errors) #1866
  • fix prefix file detection picking up too many files due to env recreation #1866
  • fix missing r_bin, make run_test.r scripts work #1869
  • fix R's binary path on Windows #1870
  • remove tab completion on CLI for compatibility with conda 4.4 #1795
  • reduce scope of git try/except block so that GIT_FULL_HASH is available, even if tags are not #1873
  • Fix "compiler" jinja2 looping, so that it is respected in subpackages #1874
  • Fix license family comparison - case matching #1875
  • Fix inspect linkages when multiple packages contain a library #1884
  • avoid unnecessary computation of hashing #1888
  • fix python imports not being run in test phase #1896
  • fix path omission in paths.json for noarch packages #1895
  • standardize entry point script template to match pip #1908
  • fix cleanup happening even when build fails #1909
  • fix bin/conda getting included in conda-build release tarballs #1913
  • fix mmap/file problems on virtualbox shared folders #1914
  • Correct rendering with --dirty flag if recipe name appears as substring of another's name #1931
  • don't set language env vars (PERL, R, LUA, PYTHON) when those packages are not installed #1932
  • exclude language env vars from variant being set #1944
  • Fix cleanup of folders in outer variant loop - was causing incorrect packages on 2nd variant in windows builds #1950
  • Remove variant functionality from bdist_conda. Its split packaging approach is incompatible. #1950
  • Fix import of _toposort from conda, reroute through conda_interface #1952
  • Match folder substrings more intelligently, for finding previous builds with --dirty #1953
  • Fix type error with --skip-existing and some conda recipes (Conda-build's internal conda.recipe was one). #1956
  • Fix non-python packages creating python tests where they should not have #1967
  • Don't add python.app to run reqs multiple times #1972
  • Fix incorrect removal of cc in conda_interface.py #1971
  • Fix ORIGIN replacement - trailing slash was messing things up #1982
  • Pipe stdin when calling subprocess, in hopes of getting better ctrl-c handling with conda. #1986
  • Ensure that lock files are removed after build exit (or crash) to avoid permission errors on central installs #2002
  • Process line endings in bytes mode rather than text mode #2035
  • add a warning to find_recipe when multiple meta.yaml files are found (bioconda style) #2040
  • When applying patches, try 3 line ending options on the patch: 1. unchanged; 2. convert patch to unix line endings; 3. convert patch to windows line endings. #2052
  • fix empty target_platform variant entry leading to empty builds #2056
  • fix host activation for cross-capable recipes #2060
  • fix handling of circularity in subpackages #2065
  • fix subdir handling for subdirs with more than one - character #2066
  • Install build and host deps when using cross-capable recipe on strictly native (not cross) build #2070
  • reduce verbosity of git error messages that people never care about #2075
  • hash only direct inputs of subpackages, rather than all files. This limits creation of identical packages with similar hashes. #2079

๐Ÿซถ Contributors ๐Ÿซถ

  • @abretaud
  • @evhub
  • @groutr
  • @jjhelmus
  • @kalefranz
  • @ma-ba
  • @mandeep
  • @mingwandroid
  • @minrk
  • @msarahan
  • @pkgw
  • @pwwang
  • @rolando
  • @stuarteberg
  • @tatome
  • @ukoethe
  • @waltonseymour
  • @wulmer

๐ŸŒˆ 3.0.0rc1 (2017-05-23) ๐ŸŒˆ

okay so these release notes are an aggregation of all older pre-releases of conda-build 3.0.0, plus changes since 3.0.0rc0. All changes from 2.1.15 and below have been incorporated.

๐Ÿšจ Breaking changes ๐Ÿšจ

  • Support for post-build metadata (__conda_version__.txt and the like) has been removed. ๐Ÿ’€
  • pin_downstream has been renamed to run_exports #1911
  • exclude_from_build_hash has been renamed to ignore_version #1911
  • Package signing and verification have been removed, to follow their removal from conda 4.3. #1950

โœจ Enhancements โœจ

  • greatly extended Jinja2 templating capabilities #1585
  • record environment variables at top of build.sh, similar to what is done with bld.bat in win. #1765
  • use symlinks when copying to improve performance #1867
  • load setup.cfg data in load_setup_py_data #1878
  • calculate checksum and simplify cran skeleton #1879
  • Check that files are executable when finding them #1899
  • use rm_rf to remove prefixes for more cleanliness and better speed #1915
  • add support for multiple sources in one meta.yaml #1929
  • allow exact keyword for pin_compatible jinja2 function #1929
  • allow selectors in variant conda_build_config.yaml files #1937
  • Avoid duplicate recreation of package index. Speedup of 0-50%, depending on how extensively the recipe uses Jinja2 features. #1954
  • Allow per-subpackage specification of target subdir #1961
  • Add basic environment marker support to conda skeleton pypi #1984
  • allow about section for each subpackage #1987
  • add support for optional dependencies (conda 4.4) #2001
  • fix windows entry point exe's for unicode #2045
  • allow strings for pin_run_as_build values (e.g. x.x) rather than just dictionaries #2042

๐Ÿ’€ Bug fixes ๐Ÿ’€

  • fix symlinks to folders in packaging #1775
  • fix detection of patch level when maxlevel=0 #1796
  • properly copy permissions when extracting zip files #1855
  • Add more important Windows environment variables to the test environment #1859, #1863
  • remove build and test envs after each packaging step, to avoid unsatisfiable errors #1866
  • remove version pins from requirements added by run_test files (again avoid unsatisfiable errors) #1866
  • fix prefix file detection picking up too many files due to env recreation #1866
  • fix missing r_bin, make run_test.r scripts work #1869
  • fix R's binary path on Windows #1870
  • remove tab completion on CLI for compatibility with conda 4.4 #1795
  • reduce scope of git try/except block so that GIT_FULL_HASH is available, even if tags are not #1873
  • Fix "compiler" jinja2 looping, so that it is respected in subpackages #1874
  • Fix license family comparison - case matching #1875
  • Fix inspect linkages when multiple packages contain a library #1884
  • avoid unnecessary computation of hashing #1888
  • fix python imports not being run in test phase #1896
  • fix path omission in paths.json for noarch packages #1895
  • standardize entry point script template to match pip #1908
  • fix cleanup happening even when build fails #1909
  • fix bin/conda getting included in conda-build release tarballs #1913
  • fix mmap/file problems on virtualbox shared folders #1914
  • Correct rendering with --dirty flag if recipe name appears as substring of another's name #1931
  • don't set language env vars (PERL, R, LUA, PYTHON) when those packages are not installed #1932
  • exclude language env vars from variant being set #1944
  • Fix cleanup of folders in outer variant loop - was causing incorrect packages on 2nd variant in windows builds #1950
  • Remove variant functionality from bdist_conda. Its split packaging approach is incompatible. #1950
  • Fix import of _toposort from conda, reroute through conda_interface #1952
  • Match folder substrings more intelligently, for finding previous builds with --dirty #1953
  • Fix type error with --skip-existing and some conda recipes (Conda-build's internal conda.recipe was one). #1956
  • Fix non-python packages creating python tests where they should not have #1967
  • Don't add python.app to run reqs multiple times #1972
  • Fix incorrect removal of cc in conda_interface.py #1971
  • Fix ORIGIN replacement - trailing slash was messing things up #1982
  • Pipe stdin when calling subprocess, in hopes of getting better ctrl-c handling with conda. #1986
  • Ensure that lock files are removed after build exit (or crash) to avoid permission errors on central installs #2002
  • Process line endings in bytes mode rather than text mode #2035
  • add a warning to find_recipe when multiple meta.yaml files are found (bioconda style) #2040
  • When applying patches, try 3 line ending options on the patch: 1. unchanged; 2. convert patch to unix line endings; 3. convert patch to windows line endings. #2052
  • fix empty target_platform variant entry leading to empty builds #2056

๐Ÿซถ Contributors ๐Ÿซถ

  • @abretaud
  • @evhub
  • @groutr
  • @jjhelmus
  • @kalefranz
  • @ma-ba
  • @mandeep
  • @mingwandroid
  • @minrk
  • @msarahan
  • @pkgw
  • @pwwang
  • @rolando
  • @stuarteberg
  • @tatome
  • @ukoethe
  • @wulmer

๐Ÿ’– 3.0.0rc0 (2017-05-16) ๐Ÿ’–

okay bestie, real talk โ€” these release notes are literally an aggregation of all the older pre-releases of conda-build 3.0.0, plus everything that changed since 3.0.0beta1. And all the changes from 2.1.13 and below? Already baked in. no crumbs left. ๐Ÿ“

๐Ÿ’€ Breaking changes

  • Support for post-build metadata (__conda_version__.txt and the like) has been removed. it's gone gone. ๐Ÿ™ˆ
  • pin_downstream has been renamed to run_exports โ€” #1911
  • exclude_from_build_hash has been renamed to ignore_version โ€” #1911
  • Package signing and verification have been removed, following their removal from conda 4.3. #1950

โœจ Enhancements

  • greatly extended Jinja2 templating capabilities โ€” #1585 โœจ
  • record environment variables at top of build.sh, similar to what is done with bld.bat in win. #1765
  • use symlinks when copying to improve performance โ€” #1867
  • load setup.cfg data in load_setup_py_data โ€” #1878
  • calculate checksum and simplify cran skeleton โ€” #1879
  • Check that files are executable when finding them โ€” #1899
  • use rm_rf to remove prefixes for more cleanliness and better speed โ€” #1915
  • add support for multiple sources in one meta.yaml โ€” #1929
  • allow exact keyword for pin_compatible jinja2 function โ€” #1929
  • allow selectors in variant conda_build_config.yaml files โ€” #1937
  • Avoid duplicate recreation of package index. Speedup of 0-50%, depending on how extensively the recipe uses Jinja2 features. #1954 ๐Ÿ”ฅ
  • Allow per-subpackage specification of target subdir โ€” #1961
  • Add basic environment marker support to conda skeleton pypi โ€” #1984
  • allow about section for each subpackage โ€” #1987
  • add support for optional dependencies (conda 4.4) โ€” #2001

๐Ÿ› Bug fixes

  • fix symlinks to folders in packaging โ€” #1775
  • fix detection of patch level when maxlevel=0 โ€” #1796
  • properly copy permissions when extracting zip files โ€” #1855
  • Add more important Windows environment variables to the test environment โ€” #1859, #1863
  • remove build and test envs after each packaging step, to avoid unsatisfiable errors โ€” #1866
  • remove version pins from requirements added by run_test files (again avoid unsatisfiable errors) โ€” #1866
  • fix prefix file detection picking up too many files due to env recreation โ€” #1866
  • fix missing r_bin, make run_test.r scripts work โ€” #1869
  • fix Rโ€™s binary path on Windows โ€” #1870
  • remove tab completion on CLI for compatibility with conda 4.4 โ€” #1795
  • reduce scope of git try/except block so that GIT_FULL_HASH is available, even if tags are not โ€” #1873
  • Fix โ€œcompilerโ€ jinja2 looping, so that it is respected in subpackages โ€” #1874
  • Fix license family comparison - case matching โ€” #1875
  • Fix inspect linkages when multiple packages contain a library โ€” #1884
  • avoid unnecessary computation of hashing โ€” #1888
  • fix python imports not being run in test phase โ€” #1896
  • fix path omission in paths.json for noarch packages โ€” #1895
  • standardize entry point script template to match pip โ€” #1908
  • fix cleanup happening even when build fails โ€” #1909
  • fix bin/conda getting included in conda-build release tarballs โ€” #1913
  • fix mmap/file problems on virtualbox shared folders โ€” #1914
  • Correct rendering with --dirty flag if recipe name appears as substring of anotherโ€™s name โ€” #1931
  • donโ€™t set language env vars (PERL, R, LUA, PYTHON) when those packages are not installed โ€” #1932
  • exclude language env vars from variant being set โ€” #1944
  • Fix cleanup of folders in outer variant loop - was causing incorrect packages on 2nd variant in windows builds โ€” #1950
  • Remove variant functionality from bdist_conda. Its split packaging approach is incompatible. #1950
  • Fix import of _toposort from conda, reroute through conda_interface โ€” #1952
  • Match folder substrings more intelligently, for finding previous builds with --dirty โ€” #1953
  • Fix type error with --skip-existing and some conda recipes (Conda-buildโ€™s internal conda.recipe was one). #1956
  • Fix non-python packages creating python tests where they should not have โ€” #1967
  • Donโ€™t add python.app to run reqs multiple times โ€” #1972
  • Fix incorrect removal of cc in conda_interface.py โ€” #1971
  • Fix ORIGIN replacement - trailing slash was messing things up โ€” #1982
  • Pipe stdin when calling subprocess, in hopes of getting better ctrl-c handling with conda. #1986
  • Ensure that lock files are removed after build exit (or crash) to avoid permission errors on central installs โ€” #2002

๐Ÿซถ Contributors

  • @abretaud
  • @evhub
  • @groutr
  • @jjhelmus
  • @kalefranz
  • @ma-ba
  • @mingwandroid
  • @msarahan
  • @pkgw
  • @pwwang
  • @stuarteberg
  • @tatome
  • @ukoethe
  • @wulmer

๐ŸŒˆ 2.1.13 (2017-05-10) ๐ŸŒˆ

๐Ÿ› Bug fixes

  • fix missing argument to get_site_packages function; add test coverage โ€” #2009
  • pin codecov on appveyor to 2.0.5 for now โ€” #2009
  • fix lock removal (just donโ€™t create locks for temporary directories) โ€” #2009

๐Ÿซถ Contributors

  • @msarahan

๐ŸŒธ 2.1.12 (2017-05-09) ๐ŸŒธ

๐Ÿ› Bug fixes

  • Clean up lock files for temporary directories also

๐Ÿซถ Contributors

  • @msarahan

๐Ÿฆ‹ 2.1.11 (2017-05-09) ๐Ÿฆ‹

โœจ Enhancements

  • add libgcc to build dependencies for R skeleton recipes that require compilation โ€” $1969

๐Ÿ› Bug fixes

  • fix entry points, test commands, test imports from top-level recipe from applying to subpackages โ€” #1933
  • fix preferred_env in index.json โ€” #1941
  • do not add python.app to run_reqs multiple times โ€” #1981
  • Fix $ORIGIN replacement from extra trailing slash โ€” #1981
  • Remove error when _license package exists in folder where conda index is called โ€” #2005
  • fix STDLIB_DIR so that it is always defined (based on python version in configuration) โ€” #2006
  • Clean up lock files after builds complete or fail to avoid permission errors โ€” #2007

๐Ÿซถ Contributors

  • @johanneskoester
  • @kalefranz
  • @mingwandroid
  • @msarahan

๐Ÿ’… 3.0.0beta1 (2017-04-25) ๐Ÿ’…

๐Ÿ’€ Breaking changes

  • Package signing and verification have been removed, following their removal from conda 4.3. #1950

โœจ Enhancements

  • Avoid duplicate recreation of package index. Speedup of 0-50%, depending on how extensively the recipe uses Jinja2 features. #1954

๐Ÿ› Bug fixes

  • Fix cleanup of folders in outer variant loop - was causing incorrect packages on 2nd variant in windows builds โ€” #1950
  • Remove variant functionality from bdist_conda. Its split packaging approach is incompatible. #1950
  • Fix import of _toposort from conda, reroute through conda_interface โ€” #1952
  • Match folder substrings more intelligently, for finding previous builds with --dirty โ€” #1953
  • Fix type error with --skip-existing and some conda recipes (Conda-buildโ€™s internal conda.recipe was one). #1956

๐Ÿซถ Contributors

  • @kalefranz
  • @msarahan
  • @rendinam

๐Ÿงš 3.0.0beta0 (2017-04-20) ๐Ÿงš

๐Ÿ’€ Breaking changes

  • pin_downstream has been renamed to run_exports โ€” #1911
  • exclude_from_build_hash has been renamed to ignore_version โ€” #1911

โœจ Enhancements

  • use rm_rf to remove prefixes for more cleanliness and better speed โ€” #1915
  • add support for multiple sources in one meta.yaml โ€” #1929
  • allow exact keyword for pin_compatible jinja2 function โ€” #1929
  • allow selectors in variant conda_build_config.yaml files โ€” #1937

๐Ÿ› Bug fixes

  • fix mmap/file problems on virtualbox shared folders โ€” #1914
  • Correct rendering with --dirty flag if recipe name appears as substring of anotherโ€™s name โ€” #1931
  • donโ€™t set language env vars (PERL, R, LUA, PYTHON) when those packages are not installed โ€” #1932
  • exclude language env vars from variant being set โ€” #1944

๐Ÿซถ Contributors

  • @mingwandroid
  • @msarahan
  • @rendinam

๐Ÿ’œ 2.1.10 (2017-04-17) ๐Ÿ’œ

โœจ Enhancements

  • Inspect linkages will now warn when multiple packages contain the same library โ€” #1884, #1921

๐Ÿ› Bug fixes

  • Fix bin/conda getting included in packages that also had entry point scripts or binaries starting with โ€˜condaโ€™ โ€” #1923
  • Fix empty create_env, for compatibility with conda 4.4 โ€” #1924
  • Adapt to Condaโ€™s new MatchSpec implementation โ€” #1927
  • Fix unbound local variables when --no-locking option used. #1928
  • Donโ€™t set language env vars (PERL, R, LUA, etc.) when packages for those languages are not installed โ€” #1930

๐Ÿซถ Contributors

  • @jjhelmus
  • @kalefranz
  • @msarahan

โญ 3.0.0alpha2 (2017-04-05) โญ

๐Ÿ’€ Breaking changes

  • Support for post-build metadata (__conda_version__.txt and the like) has been removed.

โœจ Enhancements

  • use symlinks when copying to improve performance โ€” #1867
  • load setup.cfg data in load_setup_py_data โ€” #1878
  • calculate checksum and simplify cran skeleton โ€” #1879

๐Ÿ› Bug fixes

  • fix Rโ€™s binary path on Windows โ€” #1870
  • remove tab completion on CLI for compatibility with conda 4.4 โ€” #1795
  • reduce scope of git try/except block so that GIT_FULL_HASH is available, even if tags are not โ€” #1873
  • Fix โ€œcompilerโ€ jinja2 looping, so that it is respected in subpackages โ€” #1874
  • Fix license family comparison - case matching โ€” #1875
  • Fix inspect linkages when multiple packages contain a library โ€” #1884
  • avoid unnecessary computation of hashing โ€” #1888
  • fix python imports not being run in test phase โ€” #1896
  • fix path omission in paths.json for noarch packages โ€” #1895

๐Ÿซถ Contributors

  • @abretaud
  • @groutr
  • @jjhelmus
  • @kalefranz
  • @ma-ba
  • @mingwandroid
  • @msarahan

๐ŸŽ€ 2.1.9 (2017-04-04) ๐ŸŽ€

โœจ Enhancements

  • calculate checksum and simplify cran skeleton โ€” #1879
  • backport usage of symlinks for speed from master branch โ€” #1881

๐Ÿ› Bug fixes

  • fix import tests not being run, test this functionality โ€” #1897

๐Ÿซถ Contributors

  • @isuruf
  • @jjhelmus
  • @johanneskoester
  • @msarahan

๐Ÿ“ 2.1.8 (2017-03-24) ๐Ÿ“

โœจ Enhancements

  • use symlinks when copying files from files sources to improve performance โ€” #1867

๐Ÿ› Bug fixes

  • reset build folder for each built package (fixes building multiple recipes in one command) โ€” #1842
  • wrap copy of test/source_files so that errors donโ€™t prevent a successful build โ€” #1843
  • Restore permissions when extracting from zipfiles โ€” #1855
  • pass through several Windows-specific environment variables โ€” #1859, #1862
  • python 2 os.environ string type compatibility fix โ€” #1861
  • fix indentation breaking perl package testing โ€” #1872
  • reduce scope of git try/except block so that GIT_FULL_HASH is available even if tags are not. #1873
  • fix license family comparison, especially for public-domain โ€” #1875
  • Remove python header being added to all run_test.* files #1876

๐Ÿ’– Contributors

  • @abretaud
  • @jjhelmus
  • @mingwandroid
  • @msarahan
  • @stuertz
  • @wulmer

๐ŸŒธ 3.0.0alpha1 (2017-03-23)

๐Ÿ› Bug fixes

  • remove build and test envs after each packaging step, to avoid unsatisfiable errors #1866
  • remove version pins from requirements added by run_test files (again avoid unsatisfiable errors) #1866
  • fix prefix file detection picking up too many files due to env recreation #1866
  • fix missing r_bin, make run_test.r scripts work #1869

๐Ÿ’– Contributors

  • @msarahan

๐Ÿฆ‹ 3.0.0alpha0 (2017-03-22)

okay so THIS one is a big deal bestie. This is a complete revolution in the dynamic rendering capabilities of conda-build. More information is in the docs PR at https://github.com/conda/conda-docs/pull/414. There will be a blog post soon, perhaps coupled with a screencast.

โœจ Enhancements

  • greatly extended Jinja2 templating capabilities #1585
  • record environment variables at top of build.sh, similar to what is done with bld.bat in win. #1765

๐Ÿ› Bug fixes

  • fix symlinks to folders in packaging #1775
  • fix detection of patch level when maxlevel=0 #1796
  • properly copy permissions when extracting zip files #1855
  • Add more important Windows environment variables to the test environment #1859, #1863

๐Ÿ’– Contributors

  • @jjhelmus
  • @kalefranz
  • @mingwandroid
  • @msarahan
  • @pkgw
  • @stuarteberg
  • @ukoethe
  • @wulmer

๐ŸŽ€ 2.1.7 (2017-03-14)

โœจ Enhancements

  • pass WINDIR env var through on Windows #1837
  • make long test prefix an option (default disabled) #1838

๐Ÿ› Bug fixes

  • monkeypatch ensure_use_local to avoid conda-build import clobbering conda CLI arguments #1834
  • Fix context conda_build attr error with older conda #1813
  • Fix legacy noarch shebang replacement code to account for long prefix paths #1813
  • properly initialize โ€˜systemโ€™ key in linkage inspecting #1839
  • backport try mmap from master #1764
  • fix wheel output not respecting --output-folder CLI argument #1838
  • catch csv dialect sniffing error, try to fallback to to excel_tab. Might work? #1840

๐Ÿ’– Contributors

  • @kalefranz
  • @mcs07
  • @msarahan

๐ŸŒˆ 2.1.6 (2017-03-08)

โœจ Enhancements

  • tests on linux/mac now use 255-character prefix when creating test environment #1799
  • allow test/imports for R and lua packages #1806

๐Ÿ› Bug fixes

  • Fix case comparison in license_family.py #1761
  • Fix symlinked folders not being included in packages #1770
  • Fix extraction of tarballs containing unicode filenames #1779, #1804
  • fix unicode in delimiter for noarch py_file_map #1789
  • Clean up conda interface #1791
  • Confine conda-build 2.1.x to conda >4.1,<=4.3 #1792
  • fix detection of patch strip level when maxlevel = 0 #1796
  • fix attribute error in exception handling for missing dependencies #1800
  • fix osx python_app test for python 3.6 #1801
  • donโ€™t die when unicode found in patch files #1802
  • clarify error messaging when git is not found #1803
  • fix shebangs in entry point scripts using legacy noarch_python #1806
  • fix test environment variables being set to build prefix values #1806
  • fix inspect linkages breaking due to conda index keys changing to different objects in conda 4.3 #1810

๐Ÿ’– Contributors

  • @gbrener
  • @kalefranz
  • @msarahan
  • @pkgw
  • @stuertz

๐Ÿ“ 2.1.5 (2017-02-20)

โœจ Enhancements

  • donโ€™t crash on unknown selector. Warn, but evaluate as False. #1753
  • allow default conda packaging behavior for split package whose name matches top-level name, but lacks both files and script entry. #1758

๐Ÿ› Bug fixes

  • unify license family text with Anaconda-Verify #1744
  • apply post-processing to each split package, not just to post-build prefix files. #1747
  • provide fallback lock directory in userโ€™s home folder. Allows central installs. #1749
  • fix quoting for test paths. Allows croot with spaces. #1750
  • fix pypi skeleton recursion #1754
  • fix assertion error about leading period when Jinja2 variables have default values #1757
  • set default twine target to pypitest to avoid accidental uploads #1758

๐Ÿ’– Contributors

  • @gabm
  • @msarahan

๐Ÿงš 2.1.4 (2017-02-07)

โœจ Enhancements

  • Allow relative paths for --croot option #1736

๐Ÿ› Bug fixes

  • Rename package_metadata.json file to link.json to more accurately reflect contents #1720
  • Fix converted packages from unix to Windows having broken entry points #1721
  • Fix an infinite loop when creating the test environment failed #1739
  • Fix conda 4.3 incompatibility with --pin-depends option #1740

๐Ÿ’– Contributors

  • @gabm
  • @kalefranze
  • @msarahan

๐Ÿ’œ 2.1.3 (2017-01-31)

โœจ Enhancements

  • Add --extra-specs to conda skeleton. Use when a package needs to be available in the temporary env that parses setup.py to make the skeleton. #1697
  • Allow wheels as a source format #1700
  • Allow github urls as CRAN skeleton sources #1710

๐Ÿ› Bug fixes

  • exclude package/name field from uses_vcs_in_{meta,build} checks #1696
  • Fix conda convert wrt info/paths.json (for conda 4.3 compatibility) #1701
  • update cpan skeleton to use newer API url, fix conda exception handling #1704
  • update R default version to 3.3.2 #1707
  • fix attribute error on exception handling (better fix on the way) #1709
  • fix bundle_conda removing project files when conda recipe was in the source tree, and utilized relative paths #1715
  • fix glob trying to interpret filenames that look like glob patterns #1717

๐Ÿ’– Contributors

  • @ElliotJH
  • @jerowe
  • @kalefranz
  • @mingwandroid
  • @minrk
  • @msarahan
  • @rainwoodman

โญ 2.1.2 (2017-01-20)

โœจ Enhancements

  • iron out compatibility with conda 4.3 #1667
  • pytest improvements for a cleaner CI experience #1686 #1687

๐Ÿ› Bug fixes

  • Avoid trailing semicolon in MSYS2_ARG_CONV_EXCL variable setting #1651
  • filter .git directories more strictly (keep x.git folders, not .git) #1657
  • fix 404โ€™s killing CPAN skeleton with newer conda versions #1667
  • use pythonw to run tests on OSX when osx_is_app is defined in meta.yaml #1669
  • ignore obnoxious .DS_Store files when packaging #1670
  • fix --source argument to download source specified in meta.yaml #1671
  • fix slashes in file prefix replacement on Windows #1680
  • fix multiple source url fallbacks (handle CondaHTTPErrors) #1683
  • fix bizarre encoding errors on Windows with projects that embed binary in setup files #1685
  • fix CPAN JSON file encoding issue on windows #1688
  • revise retry when conda is missing files from a package #1690

๐Ÿ’– Contributors

  • @dfroger
  • @kalefranz
  • @mingwandroid
  • @msarahan
  • @nicoddemus
  • @pkgw

๐Ÿซถ 2.1.1 (2017-01-12)

๐Ÿ› Bug fixes

  • Fix package conversion consistency, wrt entry points #1609
  • Fix about.json contents regarding development versions of conda/conda-build #1625
  • Fix Appveyor for testing against source branches of conda #1628
  • Raise exception when SRC_DIR is used in tests, but meta.yaml has no test/source_files entry. SRC_DIR points at test work folder at test time, for minimal needed changes to recipes - just add test/source_files entry with desired files. #1630
  • Fix features list not allowed to be None in bdist_conda #1636
  • Fix undefined reference to locks in copy_into #1637
  • Fix version comparison in cpan skeleton #1638
  • Add dependency on beautifulsoup4 and chardet to better support strangely encoded text files. #1641
  • Fix not-yet-fully-rendered versions starting with . from raising exception #1644
  • Consolidate _check_call and check_call_env in utils. Fix coercion to string that was missing in latter. #1645

๐Ÿ’– Contributors

  • @gomyhr
  • @jakirkham
  • @kalefranz
  • @msarahan

๐Ÿ‘‘ 2.1.0 (2017-01-02)

(includes changes since 2.0.12, including those already listed under 2.1.0beta1)

โœจ Enhancements

  • Consolidate package metadata from extra.json and noarch.json into package_metadata.json #1535 #1539
  • finalize paths.json, (formerly files.json), which supersedes the older separate files for tracking file data #1535
  • Support output of multiple packages from one recipe #1576
  • Support output of wheels #1576
  • Add --prefix-length to conda-build. This allows one to set the prefix length manually. It should be used sparingly, preferring creation of a temporary folder on non-encrypted locations, and setting --croot to that temporary folder. #1579
  • Add --no-prefix-length-fallback option to conda-build, to fail builds that encounter short prefixes, rather than falling back to the short prefix #1579
  • Change CRAN-skeleton to follow conda-forge style #1596
  • Allow relative paths to files in source/url field #1614

๐Ÿ› Bug fixes

  • Rework locks to be more robust #1540
  • Call make_hardlink_copy on Windows to prevent conda failures #1575
  • Delete the work folder before running the test suite. Exposes faulty links to source files more easily. #1581
  • Add support for Python 3.6 in selector expressions #1592
  • Donโ€™t try to compile pyc files when python is not installed in the build env #1593
  • Fix a function call leading to corrupted meta.yaml output #1589
  • Fix logger to be package-local. Fixes logger output not showing up. #1583
  • Disallow leading periods in package version #1594
  • Fix reference to undefined need_source_download #1595
  • Disallow - in feature names, to avoid conflicts with condaโ€™s handling of package names #1600
  • Remove help text about passing multiple --python options or โ€œallโ€ - this has been broken for some time. Replacement coming in 3.0.0. #1610
  • Fix clobbering of no_link variable. #1611
  • Fix index when --output-folder is specified #1613
  • Fix python_d.exe incompatibility with conda 4.3 #1615

๐Ÿ’– Contributors

  • @asmeurer
  • @hajs
  • @johanneskoester
  • @kalefranz
  • @mingwandroid
  • @msarahan
  • @mwiebe
  • @soapy1

๐Ÿฆ„ 2.1.0beta1 (2016-12-20)

โœจ Enhancements

  • Consolidate package metadata from extra.json and noarch.json into package_metadata.json #1535 #1539
  • finalize paths.json, (formerly files.json), which supersedes the older separate files for tracking file data #1535
  • Support output of multiple packages from one recipe #1576
  • Support output of wheels #1576 ๐Ÿ›žโœจ
  • Add --prefix-length to conda-build. This allows one to set the prefix length manually. It should be used sparingly, preferring creation of a temporary folder on non-encrypted locations, and setting --croot to that temporary folder. #1579
bestie listen. use this one sparingly, okay? the move is: make a temp folder somewhere non-encrypted and point --croot at it. that's the vibe. ๐Ÿซถ
  • Add --no-prefix-length-fallback option to conda-build, to fail builds that encounter short prefixes, rather than falling back to the short prefix #1579
  • Change CRAN-skeleton to follow conda-forge style #1596

๐Ÿ› Bug fixes ๐Ÿ›

  • Rework locks to be more robust #1540
  • Call make_hardlink_copy on Windows to prevent conda failures #1575
  • Delete the work folder before running the test suite. Exposes faulty links to source files more easily. #1581
  • Add support for Python 3.6 in selector expressions #1592
  • Don't try to compile pyc files when python is not installed in the build env #1593
  • Fix a function call leading to corrupted meta.yaml output #1589
  • Fix logger to be package-local. Fixes logger output not showing up. #1583
  • Disallow leading periods in package version #1594
  • Fix reference to undefined need_source_download #1595
  • Disallow - in feature names, to avoid conflicts with conda's handling of package names #1600

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @asmeurer
  • @hajs
  • @johanneskoester
  • @kalefranz
  • @mingwandroid
  • @msarahan
  • @mwiebe
  • @soapy1

๐Ÿ’– 2.0.12 (2016-12-12) ๐Ÿ’–

โœจ Enhancements โœจ

  • Whitelist, rather than hardcode, MACOSX_DEPLOYMENT_TARGET. Default to 10.7 #1561
  • Allow local relative paths to be passed as channel arguments #1565

๐Ÿ› Bug fixes ๐Ÿ›

  • Keep CONDA_PATH_BACKUP as allowed variable in build/test env activation. Necessary to make deactivation work correctly. #1560
  • Define nomkl selector when FEATURE_NOMKL environment variable is not set #1562
  • Move test removal of packaged recipe until after test completes #1563
  • Allow source_files in recognized meta.yaml fields #1572

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @jakirkham
  • @mingwandroid
  • @msarahan

๐Ÿฆ‹ 2.0.11 (2016-11-28) ๐Ÿฆ‹

โœจ Enhancements โœจ

  • Further develop and update files.json #1501
  • New command line option: --output-folder allows moving artifact after build (to facilitate CI) #1538
  • support globs in ignore_prefix_files, has_prefix_files, always_include_files, binary_has_prefix_files #1554
  • decouple ignore_prefix_files from binary_relocation; make binary_relocation also accept a list of files or globs #1555

๐Ÿ› Bug fixes ๐Ÿ›

  • rename short_path key in files.json to path #1501
  • allow ! in package version (used in epoch) #1542
  • don't compute SHA256 for folders #1544
  • fix merge check for dst starting with src #1546
  • use normpath when comparing utils.relative (fixes git clone issue) #1547
  • disallow softlinks for conda (>=v.4.2) in conda-build created environments #1548

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @mingwandroid
  • @msarahan
  • @soapy1

๐ŸŒธ 2.0.10 (2016-11-14) ๐ŸŒธ

๐Ÿ› Bug fixes ๐Ÿ›

  • Fix backwards incompatibility with conda 4.1 #1528

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @msarahan

๐ŸŽ€ 2.0.9 (2016-11-11) ๐ŸŽ€

โœจ Enhancements โœจ

  • break build string construction out into standalone function for external usage (Concourse CI project) #1513
  • add conda-verify support. Defaults to enabled. Adds conda-verify as runtime requirement.
  • (yes bestie, this bullet is literally blank in the original. it's giving mystery. we respect it and move on.) ๐Ÿ’€

๐Ÿ› Bug fixes ๐Ÿ›

  • handle creation of intermediate folders when filenames provided as build/source_files arguments #1511
  • Fix passing of version argument to pypi skeleton arguments #1516
  • break symlinks and copy files if symlinks point to executable outside of same path (fix RPATH misbehavior on linux/mac, because ld.so follows symlinks) #1521
  • specify conda executable name more specifically when getting about.json info. It was not being found in some cases without the file extension. #1525

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @jhprinz
  • @msarahan
  • @soapy1

๐Ÿงš 2.0.8 (2016-11-03) ๐Ÿงš

โœจ Enhancements โœจ

  • Support otool -h changes in MacOS 10.12 #1479
  • Fix lists of empty strings created by ensure_list (patches failing due to empty patch list) #1493
  • Improved logic to guess the appropriate license_family to add to package's index. This improves filtering. #1495 #1503
  • Logic for the license_family is now shared between open-source conda-build, and proprietary cas-mirror packages. #1495 #1503

๐Ÿ› Bug fixes ๐Ÿ›

  • Centralize locks in memory to avoid lock timeouts within a single process #1496
  • fix overly broad regex in detecting whether a recipe uses version control systems #1498
  • clarify error message when extracting egg fails due to overlapping file names #1500
  • fix regression where subdir was not respecting non-x86 arch (values other than 32 or 64) #1506

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @caseyclements
  • @minrk
  • @msarahan

๐Ÿ“ 2.0.7 (2016-10-24) ๐Ÿ“

โœจ Enhancements โœจ

  • populate SHLIB_EXT environment variable. For example, .so, .dll, .dylib file extensions use this for their native ending. #1478

๐Ÿ› Bug fixes ๐Ÿ›

  • fix metapackage not going through api, thus not showing output file path. #1470
  • restore script exe creation on Windows. These are for standalone scripts installed by distutils or setuptools in setup.py. #1471
  • fix noarch value propagation from meta.yaml to config. Was causing noarch to not be respected in some cases. #1472
  • fix calls to subprocess not converting unicode to str #1473
  • restore detect_binary_files_with_prefix behavior - in particular, respect it when false. # 1477

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @jschueller
  • @mingwandroid
  • @msarahan

๐Ÿ’œ 2.0.6 (2016-10-13) ๐Ÿ’œ

๐Ÿ› Bug fixes ๐Ÿ›

  • fix erroneous import that was only compatible with conda 4.2.x #1460

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @msarahan

๐ŸŒˆ 2.0.5 (2016-10-13) ๐ŸŒˆ

โœจ Enhancements โœจ

  • Add new jinja function for extracting information from files with regular expressions #1443

๐Ÿ› Bug fixes ๐Ÿ›

  • Quote paths in activation of build and test envs #1448
  • Fix source re-copy (leading to IOError) with test as a separate step #1452
  • Call conda with an absolute path when gathering metadata for package about.json #1455
  • Don't strictly require conda-env to be present for about.json data #1455
  • Fix version argument to skeletons not being respected #1456
  • Fix infinite recursion when missing dependency is either r or python #1458

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @bryanwweber
  • @msarahan

โญ 2.0.4 (2016-10-07) โญ

โœจ Enhancements โœจ

  • Add build/skip_compile_pyc meta.yaml option. Use to skip compilation on pyc files listed therein. #1169
  • Add build environment metadata to about.json (conda, conda-build versions, channels, root pkgs) #1407
  • Make subdir member of config a derived property, so that setting platform or bits is more direct #1427
  • Use subprocess call to windows del function to clear .trash folder, rather than conda. Big speedup. #1438

๐Ÿ› Bug fixes ๐Ÿ›

  • fix regression regarding 'config' in pypi skeleton for recipes with entry points #1430
  • don't load setup.py data when considering entry points (use only info from meta.yaml) #1431
  • fall back to trying to copy files without attributes or metadata if those fail #1436
  • Fix permissions on packaged files to be user and group writable, and other readable. #1437
  • fix conda develop not respecting python version of target environment #1440

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @mingwandroid
  • @msarahan

๐Ÿซถ 2.0.3 (2016-09-27) ๐Ÿซถ

โœจ Enhancements โœจ

  • add support for noarch: python #1366

๐Ÿ› Bug fixes ๐Ÿ›

  • convert popen args to bytestrings if unicode #1413
  • Fix perl file access error on win skeleton cpan #1414
  • Catch patchelf failures in post #1418
  • fix path walking in get_ext_files #1422

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @mingwandroid
  • @msarahan
  • @soapy1

๐Ÿ’… 2.0.2 (2016-09-27) ๐Ÿ’…

โœจ Enhancements โœจ

  • Consider all recipes when printing output paths with --output #1332
  • Lay groundwork for noarch packages with different types allowed (not just noarch_python) #1334
  • Improve setting RPATH on Linux - handle relative paths better #1336
  • Add GPL as a license family #1340
  • Skip fixing rpath for files listed in ignore_prefix_files #1345
  • Uniformly use conda's rm_rf function, not move_to_trash #1355
  • Add support for alternate PKGINFO files. Adds pkginfo dependency. #1353
  • Add --croot argument to conda build CLI, to specify build root folder #1358
  • Do not index pkgs folder #1381 #1388
  • Assert that merge destination is not a subdir of source, to avoid recursion problems #1396
  • add UUID to token upload test to avoid race condition that caused intermittent CI failure #1392
  • Roll source.get_dir into config.work_dir, to avoid confusion. #1400
  • Improve locking in several places #1405 #1408

๐Ÿ› Bug fixes ๐Ÿ›

  • Fix guess_license_family to have LGPL -> LGPL, not public domain #1336
  • Restore standard behavior with __pycache__ folder and pyc files #1333
  • Fix pyver_re to not catch python-* packages #1342
  • Fix erroneous file argument to logging call #1344
  • Fix convert unix -> win not creating entry point py scripts #1348
  • Remove pytest timeout for tests. It is responsible for intermittent CI test crashes. #1351
  • Fix retrieval of CONDA_NPY setting (only --numpy flag was being respected) #1356
  • Fix --no-build-id argument to conda build that was note being respected #1359
  • Fix handling of recipe folder specifications coming out blank or . #1360 #1391
  • Handle conda 4.2 exceptions better for LinkErrors and PaddingErrors, better support OpenSSL custom prefix replacement #1362
  • Fix indentation error leading to skip-existing not working #1364
  • Fix skeletonize not passing arguments from CLI #1384 #1387 #1406
  • Check if file exists before trying to use stat on it. Might avoid mmap errors. #1389
  • Fix no include recipe option when input is metadata (as opposed to recipe file path) #1398
  • Normalize slashes in examining files in tarfiles (always forward slashes) #1404

๐Ÿ‘‘ Contributors ๐Ÿ‘‘

  • @gabm
  • @jakirkham
  • @johanneskoester
  • @mingwandroid
  • @msarahan
  • @mwcraig
  • @soapy1
  • @sooneecheah
  • @yoavram

๐Ÿ”ฅ 2.0.1 (2016-09-06) ๐Ÿ”ฅ

โœจ Enhancements โœจ

  • Add disable_pip build option to disable conda's automatic add of pip/setuptools #1311
  • Add numpy to pypi env creation if it is imported in setup.py #1289
  • Improve compatibility with conda >=4.2 regarding prefixes that are too short #1323
  • Delete .pyo files prior to compiling pyc files. They are considered harmful, bestie. #1328
  • Add conda build purge-all command that cleans out built packages and build folders #1329

๐Ÿ› Bug fixes ๐Ÿ›

  • Use source.get_dir instead of config.workdir for source_files (it was one level too low, oops) #1288
  • Import setuptools in windows.py to apply vc9-finding monkeypatch #1290
  • Fix convert not updating subdir in index.json #1297
  • Update post-build deprecation warning to state 3.0 as release for removal #1298
  • Create pkgs folder if it does not exist #1299
  • Fix warn_on_old_conda_build to ignore non-final release versions (alpha/beta/rc) #1303 #1315
  • Remove coercion of pycache folder into flat pyc files #1304
  • Fix metadata retrieval in bdist_conda #1308
  • Add supplemental removal of cached packages when conda does not fully remove them #1309
  • Simplify updating the package index #1309
  • Straighten out when metadata member config is used, relative to config argument #1311
  • Catch prefix length errors with OpenSSL's custom prefix replacement program #1312
  • Replace all colons with _ in git mirror folders to avoid Windows path errors #1322
  • Fix missing file contents in converted packages. Test. #1325

๐Ÿ’– Contributors ๐Ÿ’–

  • jakirkham
  • mingwandroid
  • msarahan

๐ŸŒŸ 2.0.0 (2016-08-29) ๐ŸŒŸ

Notes here are a consolidation of all changes between 1.21.14 and 2.0.0. iykyk, this one's a biggie ๐Ÿ’…

โœจ Enhancements โœจ

  • Increase placeholder path to 255 bytes (affects only Linux/Mac. Packages need to be rebuilt to support longer embedded paths) #877
  • Configuration is local, passed via config argument. No more global config. #953
  • Created Python API in conda_build/api.py #953
  • Separate build folders per-build to allow parallelism #953
  • Add locking to allow safe parallelism #953
  • Add build flag to turn off separate build folders (โ€“no-build-id) #953
  • Much greater test coverage across all modules #953
  • Add CONDA_BUILD_STATE variable that reflects RENDER, BUILD, or TEST state of build #1232
  • Add support for HG_ variables in meta.yaml templates (for hg repos) #207 #1234
  • Add source_files test argument in meta.yaml to copy files from source into test #1237
  • add a numpy.distutils patch to jinja templating, so that fortran projects using numpy can also use jinja2 (thanks @bladwig1) #1252
  • Ensure that the build environment is on PATH during all tooling and testing #1256
  • Make failure due to pip requirements in meta.yaml clearer #1279
  • Allow API to accept either paths to meta.yaml files or MetaData objects, for better compatibility #1281
  • Implement tests to verify api stability #1283
  • Add build/noarch to recipe metadata. Use for truly platform independent packages - same folder in every install. #1285

๐Ÿ› Bug fixes ๐Ÿ›

  • Fix error converting linux to win packages due to python version mismatch #481
  • Fix infinite loop that occurred with circular dependencies being built #953
  • Improve test data structures to allow profiling with pytest-profiling #953
  • Fix version sorting in pypi skeleton generator #1238
  • improve backwards compatibility* prefix build and test envs with _, so that conda can be installed in them #1242
  • fix bdist_conda; add smoke test for it to Travis #1243
  • fix windows entry points (duplicate bad logic) #1246
  • fix inspect entry point in embedded conda.recipe #1251
  • create build environment before looking for VCS in it. #1253
  • fix a deadlock with recursive environment creation on encountering packages with short prefixes #1257
  • with conda commands #1259
  • only compile pyc files if python is in the build prefix # 1261
  • remove exception catch-all in build CLI, to show actual errors more #1262
  • specify full paths to activate scripts to avoid PATH conflicts with virtualenv #1266
  • clean up remnants of pipbuild #1267
  • remove pyc files from any source_files arguments to test in meta.yaml (avoid __file__ errors) #1272
  • copy files and folders when breaking hardlinks (rather than renaming) to avoid cross-filesystem errors #1273
  • add Scripts folder to prepended binary paths searched on Windows #1276
  • update MACOSX_DEPLOYMENT_TARGET hard-coded value to 10.7 (better fix soon) #1278
  • disallow backslashes in meta.yaml fields describing paths (e.g. always_include_files) #1280
  • prevent GIT_* env vars from containing newlines #1282
  • restore prefix-lengths inspect command (lost in merging) #1283

๐Ÿ”ง Restructuring ๐Ÿ”ง

  • CLI scripts have been gutted and moved to conda_build/cli. Content from them is in conda_build, in scripts without main_ prefix. #953
  • Skeleton generators have been broken out of main_skeleton.py, and consolidated into conda_build/skeletons. The contents of this folder are examined at runtime for pluggability. #953

๐Ÿ’– Contributors ๐Ÿ’–

  • @bladwig1
  • @brentp
  • @heather999
  • @jakirkham
  • @mingwandroid
  • @msarahan
  • @melund
  • @pigmej

๐Ÿงš Testers ๐Ÿงš

  • @dsludwig
  • @ericdill
  • @jakirkham
  • @mingwandroid
  • @pitrou
  • @srossross

๐ŸŒธ 2.0.0beta4 (2016-08-26) ๐ŸŒธ

๐Ÿ› Bug fixes ๐Ÿ›

  • improve backwards compatibility with conda commands #1259
  • only compile pyc files if python is in the build prefix # 1261
  • remove exception catch-all in build CLI, to show actual errors more #1262
  • specify full paths to activate scripts to avoid PATH conflicts with virtualenv #1266
  • clean up remnants of pipbuild #1267
  • remove pyc files from any source_files arguments to test in meta.yaml (avoid __file__ errors) #1272
  • copy files and folders when breaking hardlinks (rather than renaming) to avoid cross-filesystem errors #1273
  • add Scripts folder to prepended binary paths searched on Windows #1276
  • update MACOSX_DEPLOYMENT_TARGET hard-coded value to 10.7 (better fix soon) #1278

๐Ÿ’– Contributors ๐Ÿ’–

  • @dsludwig (testing)
  • @ericdill (testing)
  • @jakirkham (testing)
  • @mingwandroid (testing)
  • @msarahan
  • @pitrou (testing)
  • @srossross (testing)

๐Ÿฆ‹ 2.0.0beta3 (2016-08-23) ๐Ÿฆ‹

โœจ Enhancements โœจ

  • add a numpy.distutils patch to jinja templating, so that fortran projects using numpy can also use jinja2 (thanks @bladwig1) #1252

๐Ÿ› Bug fixes ๐Ÿ›

  • prefix build and test envs with _, so that conda can be installed in them #1242
  • fix bdist_conda; add smoke test for it to Travis #1243
  • fix windows entry points (duplicate bad logic) #1246
  • fix inspect entry point in embedded conda.recipe #1251
  • create build environment before looking for VCS in it. #1253
  • fix a deadlock with recursive environment creation on encountering packages with short prefixes #1257

๐Ÿ’– Contributors ๐Ÿ’–

  • @bladwig1
  • @ericdill (testing)
  • @jakirkham
  • @mingwandroid (testing)
  • @msarahan

๐ŸŽ€ 2.0.0beta2 (2016-08-22) ๐ŸŽ€

This release includes all current (1.21.14) changes made to the 1.21.x series. ๐Ÿซถ

โœจ Enhancements โœจ

  • Configuration is local, passed via config argument. No more global config. #953
  • Created Python API in conda_build/api.py #953
  • Separate build folders per-build to allow parallelism #953
  • Add locking to allow safe parallelism #953
  • Add build flag to turn off separate build folders (โ€“no-build-id) #953
  • Much greater test coverage across all modules #953
  • Add CONDA_BUILD_STATE variable that reflects RENDER, BUILD, or TEST state of build #1232
  • Add support for HG_ variables in meta.yaml templates (for hg repos) #207 #1234
  • Add source_files test argument in meta.yaml to copy files from source into test #1237

๐Ÿ› Bug fixes ๐Ÿ›

  • Fix error converting linux to win packages due to python version mismatch #481
  • Fix infinite loop that occurred with circular dependencies being built #953
  • Improve test data structures to allow profiling with pytest-profiling #953
  • Fix version sorting in pypi skeleton generator #1238

๐Ÿ”ง Restructuring ๐Ÿ”ง

  • CLI scripts have been gutted and moved to conda_build/cli. Content from them is in conda_build, in scripts without main_ prefix. #953
  • Skeleton generators have been broken out of main_skeleton.py, and consolidated into conda_build/skeletons. The contents of this folder are examined at runtime for pluggability. #953

๐Ÿ’– Contributors ๐Ÿ’–

  • @melund
  • @msarahan
  • @pigmej

๐ŸŒˆ 1.21.14 (2016-08-18) ๐ŸŒˆ

๐Ÿ› Bug fixes ๐Ÿ›

  • fix pyc compilation when egg files/folders are present #1225

๐Ÿ’– Contributors ๐Ÿ’–

  • @msarahan

โญ 1.21.13 (2016-08-18) โญ

โœจ Enhancements โœจ

  • use git -am when applying git patches, so that patches better retain git history #1222
  • allow relatively pathed git submodules #1222
  • add guess_license_family to pypi skeleton generator #1222

๐Ÿ› Bug fixes ๐Ÿ›

  • fix typo in convert.py

๐Ÿ’– Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan

๐Ÿ“ 1.21.12 (2016-08-17) ๐Ÿ“

โœจ Enhancements โœจ

  • Whitelist the CPU_COUNT environment variable. #1149
  • Add tool for examining prefix length in existing packages #1195
  • Add a conda interface layer for better compatibility with conda 4.2 #1200 #1203 #1206
  • Document how to run tests #1205
  • Update default versions for R (3.3.1) and Perl (5.20.3) builds #1220

๐Ÿ› Bug fixes ๐Ÿ›

  • Don't compile .py files in executable locations. Compile one at a time. #1186
  • Don't force download if vcs is used as a source #1212
  • Break hardlinks as a post-install step. Hard links can cause problems at package install time. #1215
  • Make environment variables used by conda in environment creation always be bytestrings #1216 #1219

๐Ÿ’– Contributors ๐Ÿ’–

  • @jakirkham
  • @kalefranz
  • @msarahan

๐Ÿ’œ 1.21.11 (2016-08-06) ๐Ÿ’œ

๐Ÿ› Bug fixes ๐Ÿ›

  • Correct logic for printout of meta.dist determination #1174
  • Attempt to use src_dir instead of WORK_DIR for directory creation #1175
  • Fix escaping problem with PY_VCRUNTIME_REDIST setting #1172
  • Set build prefix for win by path, not name #1172
  • Quote INCLUDE and LIB env var settings for win better #1172
  • Fix pypi skeleton package search #1181

๐Ÿ’– Contributors ๐Ÿ’–

  • @msarahan
  • @pelson

๐Ÿ’… 1.21.10 (2016-08-02) ๐Ÿ’…

๐Ÿ› Bug fixes ๐Ÿ›

  • Compile files ending with .py, not py. #1163
  • Move root logger to entry points, to not interfere with conda #1164 #1166
  • Use setuptools entry points, rather than pre-defined scripts #1165
  • Always use the long build prefix to avoid confusion #1168

๐Ÿ’– Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan

1.21.9 (2016-08-01) ๐ŸŽ€

Bug fixes ๐Ÿ›

  • New debug option that shows you the conda output while you're building. Otherwise? The output is hidden, bestie. #1159
  • Added a regression test for the conda metapackage command, and fixed the missing token and user args. #1160
  • Now creates the croot (conda-bld) folder if it's missing before locking in render and skeleton. #1161

Contributors ๐Ÿ’–

  • @msarahan

1.21.8 (2016-07-31) ๐Ÿฆ‹

Bug fixes ๐Ÿ›

  • Fixed the --source argument to build โ€” it was building when it should only be downloading the source. #1152
  • No more trying to create the work folder when it already exists (even if it's empty). #1153
  • Fixed a logic error where need_source_download didn't exist. #1148

New Things โœจ

  • No more exiting on a compileall failure. #1146
  • Added the CONDA_BUILD_RENDERING environment variable, which gets set during recipe rendering. #1154
  • Changed pyc compilation so it only touches the files that would actually be packaged (not all of site-packages). Compiles pyc files on py3. #1155
  • Renamed load_setuptools to load_setup_py_data (kept load_setuptools around for compat, but it shows a warning now). #1156
  • Added a test to make sure condarc channels are respected in build. #1157

Contributors ๐Ÿ’–

  • @daler
  • @minrk
  • @msarahan

1.21.7 (2016-07-22) ๐ŸŒธ

Bug fixes ๐Ÿ›

  • Added a test for requirements.txt parsing for runtime requirements. #1127
  • Set PY_VCRUNTIME_REDIST for VS 2015+, so that DLL linkage gets used. #1129
  • Uses os.path.normpath in find_lib. #1132
  • Fixed path prepending in the test (uses only PATH, and uses consolidated code). #1135
  • Added dist split for channel names. #1136
  • Provided a fallback path to render the recipe when the build environment is necessary for rendering. #1140
  • Sorts package versions coming from PyPI for skeleton. #1141

Contributors ๐Ÿ’–

  • @mingwandroid
  • @msarahan

1.21.6 (2016-07-14) ๐Ÿ’…

New Things โœจ

  • Allows pass-through of setup.py options in conda skeleton pypi. #680
  • Allows specification of pinning numpy in conda skeleton pypi. #680
  • Supports PEP420 namespace packages (doesn't barf on existing folders). It does barf on existing files though. #1074

Bug fixes ๐Ÿ›

  • Fixed handling of quotes in selectors. #1104
  • Fixed load_setuptools in the jinja context โ€” the problem was an incorrect cwd in the function. #1106
  • Made the Win activate script file extensions explicit. #1107
  • Warns users when git repo info fails, instead of crashing. #1108
  • Removed killing MSBuild.exe at the end of a win build. Removed the psutil dependency. #1109
  • Prepends PATH before creating the env, to make sure the post-link script succeeds. #1115, #1118
  • Made Python tests drop out on failure appropriately on win. #1122
  • Made hyphenation consistent with include_recipe in meta.yaml. #1124
  • Uses the full path of the test env when activating. #1125

Contributors ๐Ÿ’–

  • @ikalev
  • @msarahan
  • @mwcraig

1.21.5 (2016-07-07) ๐ŸŒˆ

Bug fixes ๐Ÿ›

  • Made --skip-existing respect remote channels (s3, file, anaconda.org). #1102
  • Reduced the always_include_files glob fail exit down to a warning. #1101
  • Fails more gracefully when finding a vcs executable fails. #1100
  • Added a better error when PyPI fails with XMLRPC. Added tests for published examples. #1098
  • Fixed the lack of call in the Windows test activate script that was terminating tests early. #1097
  • Takes the newest version from PyPI when creating a skeleton. #1092
  • Fixed a unicode encoding error in conda skeleton pypi. #1092
  • Supports PEP420 namespace packages (writes into existing folders, but raises an error rather than overwriting existing files). #1090
  • Fixed an error where an intermediate None value broke jinja2 rendering. #1088
  • Added the missing support for include_recipe in meta.yaml. #1085

Contributors ๐Ÿ’–

  • @ikalev
  • @msarahan

1.21.4 (2016-07-05) ๐Ÿ‘‘

Bug fixes ๐Ÿ›

  • Chooses the newest Pypi skeleton version; fixed unicode encoding in pypi metadata. #1092
  • Added Numpy 1.11 to the all_versions dict for autocompletion. #1078
  • Fixed MSVC 3.3/3.4 builds when Win7SDK isn't installed. #1072
  • Fixed an error with the build number, when the build number is None or otherwise invalid. #1088

Known issues ๐Ÿ’€

  • Environment activation requires conda >=4.1.6. The activate.bat script doesn't look in the right place for the activate.d folder.
  • The test suite on Linux and Mac fails the python-build, python-run, and python-build-run tests, because an errant __conda-version__.txt file is somehow present. It is not clear where it comes from, and each of these tests pass when run individually. If you have mysterious issues, and you use __conda-version__.txt or files like it, please file an issue.

Contributors ๐Ÿ’–

  • @adament
  • @aleksey
  • @ikalev
  • @msarahan

1.21.3 (2016-06-27) ๐Ÿ“

Bug fixes ๐Ÿ›

  • Fixed a regression in Windows, where a compiler was a hard requirement, and wasn't always showing up, anyway. #1049

Contributors ๐Ÿ’–

  • @msarahan

1.21.2 (2016-06-24) ๐Ÿงš

Bug fixes / Improvements ๐Ÿ›โœจ

  • Reverted some MSVC activation logic to still call vcvarsall directly in the build script.
  • Fixed Windows testing for binary prefix replacement (not done on win).
  • Added a warning message when conda-build can't create an environment due to unsatisfiable dependencies.
  • Improved the notion of whether a recipe uses a VCS in its metadata, or in its build.

Known issues ๐Ÿ’€

  • Environment activation on Windows will not work until Conda 4.1.4 is released. The activate.bat script doesn't look in the right place for the activate.d folder.
  • The test suite on Linux and Mac fails the python-build, python-run, and python-build-run tests, because an errant __conda-version__.txt file is somehow present. It is not clear where it comes from, and each of these tests pass when run individually. If you have mysterious issues, and you use __conda-version__.txt or files like it, please file an issue.

Contributors ๐Ÿ’–

  • @msarahan
  • @patricksnape

1.21.1 (2016-06-22) ๐Ÿฆ‹

Bug fixes / Improvements ๐Ÿ›โœจ

  • Simplified MSVC activation, using distutil's existing logic. #1036
  • Correctly interprets paths returned from git on Windows, trying cygpath, falling back to conda regex. #1037
  • Fixed the ability to disable anaconda upload in condarc. #1043
  • Changed environment activation to call activation in scripts, rather than having Python store variables. #1044

Contributors ๐Ÿ’–

  • @msarahan
  • @mwcraig
  • @patricksnape

1.21.0 (2016-06-15) โœจ

New stuff ๐ŸŒŸ

  • Added FEATURE_ environment variables for MKL, opt and debugging. #978
  • Added an info/about.json file that contains the "about" section of meta.yaml. #941
  • Allows the --dirty flag to be passed to the conda build command. Skips download, and provides the DIRTY environment variable in build scripts. #973
  • Added msys2 paths to build and test environments. #979
  • Added new x86 and x86_64 selectors for Intel platforms. #986
  • Keeps the original meta.yaml in the recipe folder of the package; creates meta.yaml.rendered in the recipe folder. Neither exists when the recipe isn't included. #1004
  • Added the ignore_prefix_files key to build in meta.yaml. Can ignore a list of files, or True to ignore all prefix files. #1008 #1009
  • Automatically determines the patch strip level. #1011

Bug fixes/Improvements ๐Ÿ›โœจ

  • Lightened the requirement that x.x be defined in both build and runtime sections. #650
  • Removed info/recipe.json from build conda packages. Superseded by info/recipe/meta.yaml.rendered. #781
  • Searches for single and double backslashes when finding files that need prefix replacement. #962
  • Tracks undefined jinja variables and uses them to decide whether to download source. #964
  • Handles patches with p0 or p1. #969, #1011, #1020
  • Only sets os.environ for non-None variables. #981
  • Doesn't use long prefixes on Windows. #985
  • Fixed a missing encoding argument. #987
  • Respects proxy variables more appropriately. #989
  • Searches packages on PyPI, rather than listing them all. Should avoid some timeout errors there. #991
  • Fixed unix-style paths returned from git on Windows preventing relative paths from providing Jinja2 metadata. #995
  • Improved logic handling "dirty" downloading. Always downloads when not dirty. #995
  • Fixed post-build variables when no build section existed in the original meta.yaml. #999
  • Activates _build and _test environments appropriately, rather than manipulating PATH directly. #1002
  • Doesn't clone git submodules until after the first checkout. #1025
  • Moved check_install over from conda.install. #1027

Deprecations โš ๏ธ

  • __conda_version__.txt and other post-build methods of altering the build string are marked as deprecated. Prefer Jinja2 templates where possible. Create issues if this breaks your work.

Contributors ๐Ÿ’–

  • @filmor
  • @ilanschnell
  • @jschueller
  • @mingwandroid
  • @msarahan
  • @pelson
  • @stuarteberg
  • @whitequark

2.0.0beta (2016-06-05) ๐Ÿ”ฅ

Compatibility breaks ๐Ÿ’”

  • Increased the placeholder path to 255 bytes (affects only Linux/Mac. Packages need to be rebuilt to support longer embedded paths). #877

Bug fixes/Improvements ๐Ÿ›โœจ

  • Respects proxy variables more appropriately. #989
  • Fixed post-build variables when no build section existed in the original meta.yaml. #999
  • Fixed unix-style paths returned from git on Windows preventing relative paths from providing Jinja2 metadata. #995
  • Improved logic handling "dirty" downloading. Always downloads when not dirty. #995
  • Searches packages on PyPI, rather than listing them all. Should avoid some timeout errors there. #991
  • Lightened the requirement that x.x be defined in both build and runtime sections. #650
  • Searches for single and double backslashes when finding files that need prefix replacement. #962
  • Fixed a missing encoding argument. #987
  • Doesn't use long prefixes on Windows. #985
  • Only sets os.environ for non-None variables. #981
  • Tracks undefined jinja variables and uses them to decide whether to download source. #964
  • Handles patches with p0 or p1. #969

New stuff ๐ŸŒŸ

  • Added FEATURE_ environment variables for MKL, opt and debugging. #978
  • Added new x86 and x86_64 selectors for Intel platforms. #986
  • Added an info/about.json file that contains the "about" section of meta.yaml. #941
  • Added msys2 paths to build and test environments. #979
  • Allows the --dirty flag to be passed to the conda build command. Skips download, and provides the DIRTY environment variable in build scripts. #973

Contributors ๐Ÿ’–

  • @filmor
  • @heather999
  • @ilanschnell
  • @jschueller
  • @mingwandroid
  • @msarahan
  • @pelson
  • @stuarteberg
  • @whitequark

1.20.3 (2016-05-13) Enhancements

  • use posix metapackage for cran skeleton packaging (#956)

Bug fixes

  • fix output of package paths (extra output was breaking tools). Add tests. (#950)
  • change default of no_download_source in build.py (for compatibility with conda-build-all) (#950)
  • fix regression in [] being confused for selectors (#957)

1.20.2 (2016-05-13) Enhancements

  • added --token and --user flags to pass corresponding information to anaconda upload (#921)
  • added conda render command that outputs a fully-rendered meta.yaml to either stdout, or to file (with --file) (#908)
  • support source checkout tools specified in meta.yaml. If source checkout fails at the rendering phase, source checkout and rendering are re-done after the build environment is created. (#843, #946)
  • fn is now optional when a URL specifies a filename. (#942)
  • CRAN skeleton generator now uses MSYS2 for Windows support (#942)
  • conda build & conda render both recursively look for meta.yaml (support conda-forge feedstock submodules) (#908)
  • Whitelist MAKEFLAGS environment variable. Setting this outside conda build should take effect in your build. Parallelize on *nix by adding -j here, instead of -j${CPU_COUNT} in your build.sh. This helps on CIโ€™s, where CPU_COUNT is not always well-behaved. (#917)
  • Run python_d executable on windows when debug feature is active (#724)
  • add conda build flag --keep-old-work that temporarily moves your last build, then moves it back after completion. For debugging, when more than one package is involved. (#833)
  • Allow selectors in imported jinja templates (#739)

Bug fixes

  • fixed several instances wherein --skip-existing did not work (#897, #945)
  • Fully render recipe before outputting build string * fixes empty spots where GIT_* info should have been (#923)
  • Add MSYS2 path conversion filters to avoid issues with Win 7.1 SDK (#900)
  • Address PyPIโ€™s change of URL format (#922,
  • Fix invalid gcc โ€œ-m 32โ€ flag (#916)
  • Fix empty section (due to selectors) handling regression (#919)
  • Fix regression in handling of VS2008 Pro (not Express + VC for Python 2.7). It is important to at least try to run vcvarsall.bat. (#913)
  • Fix CPAN skeleton generator (handle missing sections better) (#912)
  • Make test/requires versions match build/requires without additional pinning (#907)
  • Remove hard-coded CYGWIN path from conda-buildโ€™s custom PATH (#903)
  • Source is downloaded before testing, fixing an issue where if build machine and some other test machine had different source, strange things happened. (#946)
  • Fix regression with Python 3.x fixing shebangs (#892)
  • Fix conda inspect crashes by using conda-meta info rather than filenames or dist names for package info (#947)

Other

  • restore AppVeyor testing for Windows builds (#864)
  • Build py3.5 on Appveyor (#938)
  • PEP8 cleanup; use flake8 rather than pyflakes (#938)
  • limited scope of project locking to avoid lock conflicts between build and rendering (#923)
  • set up anaconda.org build infrastructure (#924)
  • on Windows, environment variables are written to the temporary bld.bat in the source work folder. (#933)

1.20.1 (2016-04-21)

  • fix source/path and GIT_* issues, #801
  • fix invalid assertion, #855
  • environ.py refactor/clenup, #856
  • Better messaging for yaml parsing errors, #862
  • fix typo, #863
  • make CONDA_PY and CONDA_NPY available in build.sh, #837
  • execute source fetchers (e.g., git, hg) in the _build environment, #843
  • use memory map rather than read() to reduce memory usage, #866
  • fix svn url on Windows in checkout tool test, #867
  • fix empty files bug, #869
  • improve Visual Studio logic, #861
  • add files in order of increasing size to improve access times to tar, #870
  • VS_YEAR, VS_VERSION, VS_MAJOR and CMAKE_GENERATOR environment variables, #872

1.20.0 (2016-03-25)

  • support for Lua as a built-in language (Alex Wiltschko), #719
  • allow additional keys in โ€œaboutโ€ section, #831
  • fix Examples directory in noarch_python, #838
  • revert OS X SIP fix, part of #808, #844
  • fixed race condition between removal and creation of tmp_dir on win, #847

1.19.2 (2016-03-10)

  • silence some errors when subprocessing git #790
  • fixes conda skeleton cran under python3 #817
  • fixes some bugs introduced with the #808 otools refactor, #821, #825
  • fixes #818 conda-build 1.19.1 breaks C compilation, #825
  • actually fix #807 recurisive builds after conda 4.0 release, #826
  • fixes #820 crash when building from a git repo on Windows, #824

1.19.1 (2016-03-09)

  • Environment variables defined in the โ€˜script_envโ€™ build section of the meta.yaml file were previously assigned the value โ€˜โ€™ if not found in the environment. Now they are left unset and a warning is raised instead, #763.
  • fix printing of NumPy 1.10 in help message, #776
  • add -m32 to CFLAGS and CXXFLAGS for multilib gcc, #775
  • fixes CYGWIN_PREFIX for drive letters other than C:, #788
  • fixes for noarch package building on Windows, #799
  • work-arounds for System Integrity Protection on OS X El Capitan, #808
  • fix recurisive builds after conda 4.0 release, #813

1.19.0 (2016-01-29)

  • normalize unicode in conda skeleton cran, #681
  • use /bin/sh on openbsd, #707
  • fail early during patching
  • use symlinks=True in copytree() for SVN sources, #665
  • support entry points with dots (to suppoer classes), #690
  • deprecate conda pipbuild in favor of conda skeleton. #710
  • fix Win references to PipBuild scripts, #723
  • allow git shallow clones, #604
  • remove broken license file detection code, about/license_file expects filename now
  • allow pinning dependencies when building a package, #741
  • fix to restore building for multiple python versions on Windows, #744
  • fix building (git unrelated things) when git is not installed, #745
  • enable tab completion for the packages argument of the conda inspect commands, #748

1.18.2 (2015-11-19)

  • move path prepending to function for uniformity, #601
  • improve yaml loading, #603
  • allow jinja2 templates to be located in current conda environment, #578
  • fix NPY_VER for versions >= 1.10 (Should be โ€˜1.10โ€™, not โ€˜1.1.0โ€™), #660
  • create jinja2 environment with โ€˜strictโ€™ mode for undefined values, #661
  • add a method to shell out and execute a command through subprocess, #621

1.18.1 (2015-10-16)

  • allow config system to handle versions with have more than a single digit in the minor version, #626
  • fix None encoding bug, #614
  • add missing Python version when adding Python to test specs
  • add features to build string
  • improve yaml loading (you donโ€™t have to quote version numbers anymore, eg. if the version is 3.1), #603

1.18.0 (2015-10-01)

  • develop options --build_ext, --clean_build_ext, #512
  • fix directory not existing when using --no-include-recipe option
  • add support for multiple rpaths on OS X to conda inspect
  • donโ€™t add โ€˜npโ€™ to build string when package depends on numpy, but not a specific version
  • be more explicit when numpy version is included in dependency specs, #573
  • correctly remove egg directories on Windows, #536
  • add new option msvc_compiler to build section for forcing MSVC compiler version
  • add new command conda inspect channels --test-installable
  • fix a Unicode issue with conda skeleton cpan
  • when auto-adding python spec to execute run_test.py, donโ€™t require a specific version
  • add uninstall option to conda develop
  • give a better error message in skeleton pypi for packages with invalid urls
  • donโ€™t try to test skipped recipes
  • donโ€™t exit on a skipped recipe
  • recursively build packages from unsatisfiable install hints
  • make recursive building work better with --skip-existing
  • update CONDA_R to 3.2.2
  • fix encoding issues with git_info on Windows
  • test Python 3.5 in Travis CI
  • add support for absolute rpaths on Linux

1.17.0 (2015-08-24)

  • quote set calls in bld.bat
  • use the trash on Windows when deleting environments, see #521
  • improve documentation in noarch_python source
  • rename โ€˜binstarโ€™ -> โ€˜anacondaโ€™, see #519
  • allow blank sections in meta.yaml, see #533
  • add --no-include-recipe option to conda-build, see #535
  • add ability to add license file in info/license.txt, see #545
  • donโ€™t recursively build recipes more than once, #538
  • .git can be a file, #537

1.16.0 (2015-07-30)

  • handle trailing slashes in package names in conda skeleton cran
  • Cygwin git now works correctly.
  • the prefix itself is now included in the PATH in the test script on Windows (previously it was just the Scripts directory)
  • by default, recipes that runtime depend on numpy will no longer depend on an explicit version of numpy. The old behavior is still available by setting the CONDA_NPY environment variable or using conda build --numpy
  • add py35 variable to selector namespace
  • improve conda-meta untracked files error message
  • fix conda build --help in Python 2
  • add conda_build.sub_commands object which is a list of conda sub-commands

1.15.0 (2015-07-22)

  • fix conda skeleton cran --update-outdated --output-dir .
  • add argcomplete completers for recipes, --python, --numpy, --R, CRAN packages (with conda skeleton cran), and PyPI packages (with conda skeleton pypi)
  • conda develop now relinks object files on OS X (#490)
  • allow a glob for always-include-files
  • allow an extra section in meta.yaml, with free-form content (#483)
  • donโ€™t echo environment variables when building on Windows (#274)
  • add conda build --skip-existing
  • show default in help for conda skeleton --output-dir
  • add --update-outdated option to conda skeleton cran
  • skeleton: fix noarch_python option when build_comment is โ€œ#โ€
  • donโ€™t allow to build a package with the conda-meta directory
  • automatically remove a package of the recipe itself if it is installed as a build dependency
  • allow โ€˜extraโ€™ key in meta.yaml, see #483
  • move echo command in Windows build, see #274
  • add regex to always included files, see #484
  • add strings in conda.config.non_x86_linux_machines, e.g. โ€œppc64leโ€, as selector variables (renames armv6 to armv6l)

1.14.1 (2015-06-29) ๐ŸŒธ

  • added a --size option so you can change the RSA modulus length when you're generating RSA key pairs (and bestie, it defaults to 2048 bit, no cap) ๐Ÿ’…
  • made use of the Crypto.Signature.PKCS1_PSS module, see #469 โœจ
  • updated the default for CONDA_R to 3.2.0 ๐ŸŽ€
  • manually install dependencies of recommended R packages in the build.sh, #457 ๐Ÿฆ‹
  • fixed issues when git commits have non-ASCII characters, #458 ๐Ÿ˜ญ
  • catch tarfile.ReadError in conda index, #460 ๐Ÿ’€

1.14.0 (2015-06-16) ๐Ÿ’–

  • added support for signing packages, and indexing them, #430 ๐Ÿ‘‘
  • removed LIBRARY_PATH and INCLUDE_PATH build environment variables on Unix โ€” they were originally added in #228, but they were causing problems for some people and honestly they're not really necessary ๐Ÿ™ˆ
  • don't rename meta.yaml to meta.yaml.orig in the recipe that gets copied into built packages ๐Ÿ“
  • handle links to libraries that exist in multiple places better on OS X ๐ŸŒˆ
  • added --no-remove option to conda index โœจ
  • various fixes for --python, --numpy, --perl, and --R ๐Ÿ”ฅ
  • various cleanups for the command documentation ๐Ÿงš
  • fixed conda skeleton pypi --pypi-url ๐Ÿ’œ
  • don't add the module name to the import tests in conda skeleton pypi ๐ŸŒธ
  • added --groupby option to conda inspect linkages ๐ŸŽ€
  • fixed some incorrect "not found" instances from conda inspect linkages on OS X ๐Ÿ˜ญ
  • don't include versions with restrictions in the build string ๐Ÿ’…
  • don't fail if conda-build cannot be found for the version check ๐Ÿฆ‹
  • removed special logic if the username on Windows is "builder" ๐Ÿ’€
  • conda skeleton pypi: added --noarch-python โญ
  • fixed issue with filenames with spaces in conda convert ๐Ÿ“
  • place noarch packages in the noarch directory ๐Ÿ’–
  • handle tests_require in conda skeleton pypi ๐Ÿ™ˆ
  • pipbuild: don't check if package already exists ๐ŸŒˆ
  • skeleton pypi: removed --no-download option ๐Ÿ”ฅ
  • added noarch option to pipbuild โœจ
  • added ability to sign packages ๐Ÿ‘‘

1.13.0 (2015-05-19) ๐Ÿฆ‹

  • skeleton pypi: fail better for packages with bad urls ๐Ÿ’€
  • fixed summary in bdist_conda ๐Ÿ˜ญ
  • fixed compiling pyc files in Python 3 ๐Ÿ”ฅ
  • convert: correctly set the subdir key in the metadata ๐Ÿ’…
  • added --git-tag to skeleton cran ๐ŸŽ€
  • include LANG in the build environment ๐ŸŒธ
  • export proxy environment variables ๐Ÿ’–
  • fixed conda skeleton cran --cran-url โœจ
  • set CONDA_DEFAULT_ENV in the build environment ๐ŸŒˆ
  • fixed conda index -c ๐Ÿ“
  • correctly extract .tar.Z files ๐Ÿ™ˆ
  • avoid infinite loops in conda skeleton pypi --recursive ๐Ÿ’œ
  • added --all to conda inspect linkages and conda inspect objects ๐Ÿ‘‘
  • added --manual-url to skeleton pypi โญ
  • fixed issue where conda index with old packages would create bad metadata ๐Ÿ˜ญ
  • resolve circular dependencies in conda-skeleton (#409) ๐Ÿงš
  • use versioneer 0.14 (#385) ๐Ÿ”ฅ
  • always_include_files errors out (exits) on files that aren't there (#387) ๐Ÿ’€
  • automatically lowercase the package name in bdist_conda (see aplpy/aplpy#259) ๐Ÿ’…

1.12.1 (2015-04-28) ๐ŸŒธ

  • fixed regression in always_include_files that causes build failure (#386) ๐Ÿ˜ญ

1.12.0 (2015-04-10) ๐Ÿ’–

  • correctly fix egg directories that are part of the package ๐Ÿ“
  • use the --force-rpath flag to patchelf โœจ
  • updated MACOSX_DEPLOYMENT_TARGET to 10.6 ๐ŸŽ€
  • fixed running tests for Python packages whose version differs from the version in conda ๐Ÿฆ‹
  • fixed some Python 3 issues with pipbuild ๐Ÿ”ฅ
  • don't allow packages to depend on themselves ๐Ÿ’…
  • allow the use of the r- prefix in conda skeleton cran ๐Ÿ‘‘
  • make recommended r packages depend on r-base in skeleton cran ๐ŸŒˆ
  • new post-build logic on OS X. All libraries on OS X now include LC_RPATH, which points to the environment lib directory, and use and install name using @rpath ๐Ÿ’œ
  • don't set DYLD_FALLBACK_LIBRARY_PATH in cran recipes (the new LC_RPATH logic on OS X makes this unnecessary) ๐Ÿ™ˆ
  • fixed conda build --build-only when the long build prefix is used ๐Ÿ˜ญ
  • made conda inspect linkages work on OS X โœจ
  • don't hide the traceback for maximum recursion depth exceeded errors ๐Ÿ’€
  • added conda inspect objects, for inspecting object files in packages (OS X only) โญ
  • added --untracked flag to conda inspect linkages ๐Ÿ“
  • build R packages against a specific version of R ๐ŸŽ€
  • decompress .tar.z files ๐ŸŒธ
  • added support for GitHub urls in conda skeleton cran ๐Ÿ”ฅ

1.11.0 (2015-03-05) ๐Ÿฆ‹

  • added script_env key in the build section of the meta.yaml file, which is a list of environment variable names that get made available in the build script. If a variable is listed here, but isn't in the environment, the value '' is assigned. ๐Ÿ’…
  • handle OSError in conda index ๐Ÿ˜ญ
  • fixed how the PATH environment variable is set on Windows ๐Ÿ”ฅ
  • removed the work directory earlier in the build โœจ
  • give a helpful error message for dependencies like "python >= 2.7" ๐ŸŽ€
  • added CYGWIN_PREFIX environment variable on Windows ๐ŸŒˆ
  • handle list requires in skeleton pypi ๐Ÿ’œ
  • correctly fail if the Windows bld.bat exits 1 ๐Ÿ’€
  • give a better error message if no urls can be found for a package ๐Ÿ™ˆ
  • added __main__ to allow python -m conda_build โญ
  • ๐Ÿ“
  • write the build script to the source directory for build/script instead of the recipe directory ๐ŸŒธ
  • handle non-directories in copy_into (avoids an OSError, #332) ๐Ÿ˜ญ
  • halt the build on YAML error without jinja2 ๐Ÿ”ฅ
  • clone git sources with the --recursive option ๐ŸŽ€
  • added --channel and --override-channels to conda build. -c is changed to mean --channel instead of --check. ๐Ÿ‘‘
  • added --check-md5 flag to conda index โœจ
  • look for vcvarsall.bat from the Microsoft Visual C++ Compiler for Python 2.7 ๐Ÿฆ‹
  • use PyPi XMLRCP client search in order to ignore case for PyPi package names in pipbuild ๐Ÿ’…

1.10.2 (2015-02-10) ๐Ÿ’–

  • don't set the GIT_* environment variables when the source isn't a git repo ๐Ÿ™ˆ
  • skeleton cran: add extra metadata from CRAN to the recipe ๐ŸŽ€
  • skeleton pypi: fix there not being a fragment in a url ๐Ÿ˜ญ
  • don't match comment only lines as selectors ๐Ÿ’€

1.10.1 (2015-02-06) ๐ŸŒˆ

  • greatly improved ability to create noarch_python packages, #317 โœจ
  • added subdir key to info/index.json ๐Ÿ“
  • allow url to be a list of urls, which are tried until one works ๐Ÿ’œ
  • use quotes instead of !!str for versions from the conda skeleton commands ๐ŸŒธ
  • added conda skeleton cran to generate recipes for packages from CRAN ๐Ÿ‘‘
  • added support for adding a readme to a recipe ๐Ÿ”ฅ
  • added a --quiet option to conda convert ๐Ÿ’…

1.10.0 (2015-01-15) ๐Ÿฆ‹

  • automatically convert absolute symlinks to paths in the build prefix to relative ones โœจ
  • error if there are symlinks to the source directory ๐Ÿ’€
  • use the placeholder prefix in text files rather than the build prefix ๐ŸŽ€
  • allow non-Python packages to be converted to other platforms with conda convert ๐ŸŒˆ
  • new command conda inspect for inspecting packages. The only subcommand so far is conda inspect linkages, which shows the dynamic linkages of the shared object files on Linux. ๐Ÿ”ฅ
  • correctly handle Unix style has_prefixes on Windows ๐Ÿ˜ญ
  • run the tests in Binstar build ๐Ÿ“
  • only modify egg directories that are part of the package being built ๐Ÿ’œ
  • don't exclude .dylib files from prefix replacement ๐Ÿ™ˆ
  • ability to build noarch packages โญ
  • allow specifying files to always include ๐Ÿ‘‘
  • fix for building dependencies in some cases ๐ŸŒธ
  • print the correct thing for binary files detected with a prefix ๐Ÿ’…

1.9.1 (2014-11-18) ๐Ÿ’–

  • set PYTHONNOUSERSITE=1 while running build scripts โœจ
  • conda index: add error if they try to mix their packages into Anaconda channel ๐Ÿ’€
  • fix building recipes with local git urls in Windows ๐Ÿ˜ญ
  • warn if conda-build is out of date ๐ŸŽ€

1.9.0 (2014-10-22) ๐ŸŒˆ

  • adapt tests for Windows ๐Ÿฆ‹
  • don't use the long build prefix if the short build prefix is already long ๐Ÿ’…
  • support rewriting library load path for libraries that are in subdirectories of lib/ on OS X ๐Ÿ”ฅ
  • allow git_rev as a valid key in source, which is identical in behavior to git_branch and git_tag (all checkout the given revision) ๐Ÿ‘‘
  • also grab the full HEAD sha1 and shove it into the environmental variable GIT_FULL_HASH โœจ
  • automatically detect text prefix files ๐Ÿ“
  • added detect_binary_files_with_prefix flag to meta.yaml to automatically detect binary files with the prefix and add them to binary_has_prefix_files ๐Ÿ’œ
  • fix git_info when the author or commit message contains Unicode characters ๐Ÿ˜ญ
  • allow to pass a url to skeleton pypi ๐ŸŒธ
  • added NPY_VER environment variable ๐ŸŽ€
  • fix conda convert --show-imports ๐Ÿ’€
  • give better error message when encountering a corrupt tarfile in conda index ๐Ÿ™ˆ
  • print some more helpful information about what is going on at the beginning of a build โญ
  • allow source/path in the meta.yaml to specify a path to the source (which can be relative to the recipe directory) ๐Ÿ”ฅ
  • support xz files in Python 3 without requiring unxz ๐Ÿ’…
  • put spaces after skeleton pypi comments ๐Ÿฆ‹
  • correctly detect when to preserve the egg directory and depend on setuptools in skeleton pypi โœจ
  • set LIBRARY_PATH and INCLUDE_PATH when building on Unix ๐ŸŒˆ
  • allow selectors to have text after them if they are in a comment ๐Ÿ“
  • added CPU_COUNT environment variable to the build ๐Ÿ‘‘

1.8.2 (2014-09-19) ๐Ÿ’–

  • added substantially more tests ๐ŸŽ€
  • added ability to set additional rpath directories using build/rpaths โœจ
  • patch command on windows no-longer takes the --binary option ๐Ÿ˜ญ
  • fix post processing so that name-space packages can be 'flattened' into a single directory ๐Ÿ’…
  • don't remove the .svn directory when doing a svn checkout ๐Ÿ’€

1.8.1 (2014-09-03) ๐ŸŒธ

  • has_prefix paths must always use /, even on Windows ๐ŸŽ€
  • fix bug in Windows Python 2 ๐Ÿ˜ญ
  • added .travis.yml ๐Ÿฆ‹
  • allow recipes to use requirements.txt โœจ
  • fix building a package that has Mach-O stub files ๐Ÿ”ฅ
  • fix recursive package building ๐Ÿ’œ
  • handle empty data size in pypi ๐Ÿ™ˆ
  • allow an explicitly set empty version string ๐ŸŒˆ

1.8.0 (2014-08-22) ๐Ÿ’–

  • added ability to convert Gohlke's Windows packages into conda packages, use conda convert .exe. See also: http://www.lfd.uci.edu/~gohlke/pythonlibs/ ๐Ÿ‘‘
  • handle spaces on Windows better ๐Ÿ“
  • added croot to the module level of conda_build.config for backwards compatibility ๐Ÿ’…
  • changed extra long prefix for building to _placehold... โœจ

1.7.1 (2014-08-20) ๐Ÿฆ‹

  • added --all-extras flag to skeleton pypi ๐ŸŽ€
  • automatically use the long or short build prefix as needed ๐ŸŒˆ
  • fix to allow specification of full major.micro.minor for numpy, python, and perl (only add the build string if it is an exact major.minor or major.minor.patch version. If it is an inequality, it is not added) ๐Ÿ’œ

1.7.0 (2014-08-05)

  • better install_requires parsing for skeleton pypi
  • the build environment from conda-build is now called _build___... This is so that recipes with binary_has_prefix_files build against a sufficiently long prefix.
  • donโ€™t overwrite the input file in convert
  • fix a bug related to the prefix_files.txt file
  • show the download bytes in human form in skeleton pypi
  • make patchelf error message clearer
  • fix some issues with the git describe environment variables
  • improve shebang line modifications with python.app
  • show the download bytes in human form in skeleton pypi

1.6.1 (2014-07-29)

  • fix an issue building with a git repository in Python 3

1.6.0 (2014-07-29)

  • donโ€™t fail on MachO stub files on OS X
  • add some git describe related environment variables when the source is a git repository
  • add --python and --numpy flags to conda build, which do the same thing as setting CONDA_PY and CONDA_NPY
  • allow a . in CONDA_PY and CONDA_NPY
  • correctly catch RuntimeError
  • fix an issue building some packages on Windows
  • make skeleton pypi --recursive work with versioned dependencies
  • some additional type checking for meta.yaml
  • always include numpy in skeleton pypi

1.5.0 (2014-07-03)

  • add bdist_conda
  • fix features and track_features
  • detect files with the build prefix automatically on Windows

1.4.0 (2014-07-01)

  • fix skeleton pypi behind a proxy
  • add binary_has_prefix_files, which does a binary prefix replacement
  • fix skeleton pypi on Windows
  • allow the git_url to be a relative path to the recipe directory

1.3.5 (2014-06-04)

  • the yaml script tag was only written if build.sh already existed, see issue #105
  • use tests_require to fill in test requirements in the setuptools template, see issue #107

1.3.4 (2014-06-02)

  • add --build-only and --post flags to conda-build
  • add conda convert -p all
  • allow to set __conda_buildnum__.txt and __conda_buildstr__.txt, analogous to __conda_version__.txt

1.3.3 (2014-04-28)

  • add SHA256 support for downloaded source
  • conda convert now creates platform directories, like win-32/converted_package.tar.bz2
  • allow to specify the version of python, numpy, or perl in the meta.yaml (it will ignore the CONDA_PY, CONDA_NPY, or CONDA_PERL, respectively, in this case)

1.3.2 (2014-04-15)

  • allow changing conda-bld directory (which is by default /conda-bld when the conda root is not writable, and ~/conda-bld otherwise), to be changed by CONDA_BLD_PATH environment variable or conda-build: root-dir: in condarc file
  • add build/has_prefix_files
  • remove broken conda-build/build_dest
  • fix build in Windows Python 2
  • add --quiet option to conda-build
  • add check for characters in package name dependencies
  • add .class to the object file extension blacklist
  • removed build/no_softlink in favor of build/no_link with list of glob syntax

1.3.1 (2014-03-25)

  • add conda metapackage command
  • fix recursive conda building when dependencies are nested more than one level deep.
  • fix build in Windows Python 2
  • fix skeleton pypi for packages whose setup.py has __future__ imports
  • add conda pipbuild command which uses a simple recipe based on pip install to build a conda package
  • fix skeleton pypi and pipbuild when package data does not have classifiers
  • add a basic conda develop command
  • add the --recursive option to conda skeleton pypi
  • conda skeleton pypi no longer asks about single line licenses
  • conda skeleton pypi now queries pypi case insensitively
  • conda skeleton pypi now works in a different conda environment. This avoids anything bad that might happen when trying to get the metadata from the package from messing up the root environment.
  • conda skeleton pypi now patches distribute directly. This is more robust than trying to insert a patch into setup.py, as was done previously.
  • allow to set the version post-build by writing a __conda_version__.txt file to the source directory.
  • add ability to skip binary relocation step by setting build/binary_relocation: False in meta.yaml

1.3.0 (2014-03-14)

  • add skeleton for CPAN Perl packages, issue #53. Unlike the PyPI skeleton, it supports a --recursive option to also generate the recipes for all of the dependencies of a given module/distribution
  • add support for run_test.pl and Perl import tests when building Perl packages
  • add CONDA_PERL environment variable support for determining which version of Perl to build packages for. Unlike CONDA_PY, this must include the full version with periods (e.g., 5.18.2)
  • automatically build packages for dependencies if the recipe is present in the current working directory
  • fix a number of Python 3 compatibility issues, issue #59
  • work with source files with uppercase suffixes
  • switch from chrpath to patchelf on Linux, issue #57
  • donโ€™t use hard-coded msvc path
  • sort import tests from skeleton pypi

1.2.1 (2014-02-25)

  • added conda-build/build_dest option to condarc

1.2.0 (2014-02-13)

  • make sure WORK_DIR exists
  • use MSVC 2010 for Python 3
  • include the summary with conda skeleton pypi
  • fix object detection on Python 3
  • update default CONDA_NPY to 18

1.1.0 (2014-02-06)

  • add ability to use templates in conda recipes
  • remove fallback to /conda-recipes, i.e. conda-build always expects the full path to the recipe
  • export PKG Build Number
  • add pre-link to package, when it is found in recipe
  • allow to add run_test.sh or run_test.bat, which will be run automatically during the test phase.
  • Test commands from the test/commands section of meta.yaml are run from bash on Linux and OS X and batch on Windows (previously they were run using Pythonโ€™s subprocess).
  • all environment variables from the build process are available during the tests, except with the build prefix replaced with the test prefix.

1.0.0 (2014-01-24)

  • initial release
  • includes conda-build, conda-convert, conda-index, conda-skeleton
  • depends on new conda version 3
  • add license to info/index.json object

CONTRIBUTING TO CONDA-BUILD New Issues If your issue is a bug report or a feature request for:

Code of Conduct The conda organization adheres to the NumFOCUS Code of Conduct <https:// www.numfocus.org/code-of-conduct>.

Contributing Contributions to conda-build are always welcome! Please fork the conda/conda-build repository, and submit a pull request (PR).

If a PR is a work in progress, please put [WIP] in the title. Contributions are expected to pass flake8 and test suites run on the GitHub Actions Pipeline. Contributors also need to have signed our Contributor License Agreement <https://conda.io/en/latest/contributing .html#conda-contributor-license-agreement>.

Setting Up Your Environment There are two ways to set up your environment for development/testing. The first is to reuse your base environment; this is probably the easiest option but comes with the risk of potentially breaking conda/conda-build. The second option is to create a development environment where we install conda/conda-build, which wonโ€™t impact the functionality of conda/conda-build installed in your base environment.

Using the Base Environment: # activate/install into base env $ conda activate base (base) $ conda install --file tests/requirements.txt --channel defaults

# run tests (base) $ pytest

# install as editable so you can play around with it (base) $ pip install -e . (base) $ conda-build --version conda-build 3.21.5+17.gcde7b306

Creating a Development Environment: # create/activate standalone dev env $ ENV_NAME=conda-build make setup $ conda activate conda-build

# Run all tests on Linux and Mac OS X systems (this can take a long time) (conda-build) $ make test

# install as editable so you can play around with it (conda-build) $ pip install -e . (conda-build) $ conda-build --version conda-build 3.21.5+17.gcde7b306

Testing Follow the installation instructions above to properly set up your environment for testing.

The test suite runs with pytest. The following are some useful commands for running specific tests, assuming you are in the conda-build root folder:

Run all tests: # On Linux and Mac OS X make test

Run one test file: pytest tests/test_api_build.py

Run one test function: pytest tests/test_api_build.py::test_early_abort

Run one parameter of one parametrized test function: Several tests are parametrized, to run some small change, or build several recipe folders. To choose only one of them::

pytest tests/test_api_build.py::test_recipe_builds.py[entry_points]

Note that our tests use pytest fixtures extensively. These sometimes trip up IDE style checkers about unused or redefined variables. These warnings are safe to ignore.

Releasing Releases of conda-buildmay be performed via the rever command <https:// regro.github.io/rever-docs/>. Rever is configured to perform the activities for a typical conda-build release. To cut a release, simply run rever <X.Y.Z> where <X.Y.Z> is the release number that you want bump to. For example, rever 1.2.3. However, it is always good idea to make sure that the you have permissions everywhere to actually perform the release. So it is customary to run rever check before the release, just to make sure. The standard workflow is thus:

rever check rever 1.2.3

If for some reason a release fails partway through, or you want to claw back a release that you have made, rever allows you to undo activities. If you find yourself in this pickle, you can pass the --undo option a comma-separated list of activities youโ€™d like to undo. For example:

rever --undo tag,changelog,authors 1.2.3

Happy releasing!

Author Anaconda, Inc.

Copyright 2018, Anaconda, Inc.

26.1.0 Feb 04, 2026 CONDA-BUILD(1)

๐Ÿ“ฆ where this page comes from