CONDA-BUILD(1)
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:
- install conda โ
https://conda.io/projects/conda/en/latest/user-guide/install/index.html - install conda-build
- update conda and conda-build
๐ญ 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:
- Use the URL of the desired channel:
conda-build ./conda/ -c https://conda.anaconda.org/example/
- Run the build from inside the conda recipe directory:
cd conda
conda-build . -c example
- 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.jsoncontains 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-64subdir contains packages forlinux-64systems. repodata.jsoncontains 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.
- Extract the package to access metadata, including full package name, file modification time (mtime), size, and
- Apply repodata hotfixes (patches).
- Compute and save the reduced
current_index.jsonindex.
๐๏ธ Example: Building a channel
To build a local channel and put a package in it, follow the directions below ๐ซก
- Make the channel directory.
$ mkdir local-channel
$ cd local-channel
- Now, download your favorite package. We'll use SciPy in our example. The next steps depend on your platform:
- 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
- Linux
- Most Linux systems come with curl pre-installed. Let's install it if you don't already have it.
- Check if you have curl:
- Most Linux systems come with curl pre-installed. Let's install it if you don't already have it.
$ which curl
- If curl is not found, then install it:
$ conda install curl
- 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
- 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
- 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
- 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. โจ - Run a conda index. This is the moment, okay, this generates both
channeldata.jsonfor the channel ANDrepodata.jsonfor thelinux-64andosx-64subdirs, plus some other files that are just vibing in the background:
$ conda index .
- 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:
- the latest version of each package
- 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. Onlypackage/nameandpackage/versionare required.build.shโ The script that installs the files for the package on macOS and Linux. It is executed using thebashcommand.bld.batโ The build script that installs the files for the package on Windows. It is executed usingcmd.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 theconda skeleton <#skeleton-ref>command, the first 3 files โmeta.yaml,build.sh, andbld.batโ are automatically generated for you. Free labor, we stan.
๐ง Conda-build process
Conda-build performs the following steps:
- Reads the metadata.
- Downloads the source into a cache.
- Extracts the source into the source directory.
- Applies any patches.
- Re-evaluates the metadata, if source is necessary to fill any metadata values.
- Creates a build environment and then installs the build dependencies there.
- Runs the build script. The current working directory is the source directory with environment variables set. The build script installs into the build environment.
- Performs some necessary post-processing steps, such as adding a shebang and rpath.
- 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.
- 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, includingmeta.yamland 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 ameta.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:
- Reach out to the
repodatacontaining the dependencies for the package(s) you're installing. - Determine the correct dependencies.
- Install a list of additional packages determined by those dependencies.
- For each dependency package being installed:
- Unpack the tarball to look at the information contained within.
- Verify the file based on metadata in the package.
- 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.YorX.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 bycanonical_name. - Filename โ Conda package filenames are canonical names, plus the suffix
.tar.bz2or.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.3python=2.7python
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:
- Miniconda:
https://docs.anaconda.com/free/miniconda/or Anaconda:https://docs.anaconda.com/free/anaconda/install/ - conda-build
- Git
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:
- Conda:
https://conda.io/projects/conda/en/latest/user-guide/install/index.html - Conda-build
- Any compilers you want
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:
- Instead of VS 2008, it's often possible to substitute the free Microsoft Visual C++ Compiler for Python 2.7:
https://www.microsoft.com/en-us/download/details.aspx?id=44266 - Instead of VS 2010, it's often possible to substitute the free Microsoft Windows SDK for Windows 7 and .NET Framework 4:
https://www.microsoft.com/en-us/download/details.aspx?id=8279 - Make sure you also install VS 2010 Service Pack 1 (SP1):
https://www.microsoft.com/en-us/download/details.aspx?id=34677 - Due to a bug in the VS 2010 SP1 installer, the compiler tools may be removed during installation of VS 2010 SP1. They can be restored as described in Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1:
https://www.microsoft.com/en-us/download/details.aspx?id=4422๐ - Visual Studio 2015 has a full-featured, free Community edition for academic research, open source projects, and certain other use cases:
https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspxโจ
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 themeta.yamlfile 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:
- Choose the "Custom install" option.
- Under Programming Languages, choose to install Visual C++.
- For Python 2 โ Visual Studio 2008:
- Choose the "Custom install" option.
- Choose to install X64 Compilers and Tools. Install Service Pack 1.
๐ Make a conda skeleton recipe ๐
- Run the skeleton command:
$ conda skeleton pypi sep
The skeleton command installs into a newly-created directory called sep.
- Go to the
sepdirectory 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).
- In the
requirementssection of themeta.yamlfile, add a line that adds NumPy as a requirement to build the package. - Add a second line to list NumPy as a requirement to run the package.
- Set the NumPy version to the letters
x.x. - Make sure the new line is aligned with
- pythonon 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 lettersx.xinstead of a specific version such as1.11pins 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:
- 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.condaformat. If you need legacy.tar.bz2format compatibility, use the--package-format=1option. For more information on package formats, see Configuration.
๐ Check the output ๐
- 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
- 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:
- Install Visual Studio:
- For Python 3, install Visual Studio 2017 (https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2017):
- Choose "Custom install".
- Under "Programming Languages", select workloads that come from Visual Studio so that you can choose the Desktop Development with C++ and Universal Platform C.
- For Python 2, install Visual Studio 2008 (http://download.microsoft.com/download/E/8/E/E8EEB394-7F42-4963-A2D8-29559B738298/VS2008ExpressWithSP1ENUX1504728.iso):
- Choose "Custom install".
- Choose to install X64 Compilers and Tools.
- Install Visual Studio 2008 Service Pack 1.
- For Python 3, install Visual Studio 2017 (https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio?view=vs-2017):
- 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
- 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
- Use conda-build to build the
gdal-feedstock:
$ conda build gdal-feedstock
โจ Note: By default, conda-build creates packages in the modern.condaformat. If you need legacy.tar.bz2format compatibility, use the--package-format=1option. For more information on package formats, see Configuration.
- 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:
libgdalandGDAL. ๐ - 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/>. โจ
- Create a free Anaconda.org account and write down your new Anaconda.org username and password. ๐
- Run
conda install anaconda-clientand enter your Anaconda.org username and password. - 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:
- Create a conda skeleton package for skyfield. The
conda skeletoncommand is:
conda skeleton pypi skyfield
This command creates the skyfield conda-build recipe.
- Run
conda-build skyfieldand 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
- Make a new directory for this tutorial named
click, and then change to the new directory:
mkdir click
cd click
- To create a new
meta.yamlfile, open your favorite editor. Create a new text file and insert the information shown below. A blank samplemeta.yamlfollows the table to make it easier to match up the information. ๐
Note: To allow correct sorting and comparison, specify version as a string.
name:clickversion:"7.0"(or latest from <https://github.com/pallets/click/releases>)git_rev:6.7(or latest from <https://github.com/pallets/click/releases>)git_url: <https://github.com/pallets/click.git>imports:clickhome: <https://github.com/pallets/click>license:BSD
package:
name:
version:
source:
git_rev:
git_url:
requirements:
build:
- python
- setuptools
run:
- python
test:
imports:
-
about:
home:
- Save the file in the same
clickdirectory asmeta.yaml. It should match thismeta.yamlfile. ๐
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.
- 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: Inbld.bat, the best practice is to to addif errorlevel 1 exit 1after every command so that if the command fails, the build fails. (yes, the original really says "to to" โ iconic typo, we keep it ๐ )
- Save this new file
bld.batto the same directory where you put yourmeta.yamlfile. - 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.
- Save your new
build.shfile to the same directory where you put themeta.yamlfile.
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. ๐
- 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.condaformat. The example above shows the legacy.tar.bz2format. 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. ๐
- 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 theurlandsha256live 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 ๐
- If you haven't already, open a free Anaconda.org account and write down your new username and password ๐
- Run
conda install anaconda-client, then enter your Anaconda.org username and password. - Log into your Anaconda.org <http://anaconda.org> account with the command:
anaconda login
- 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.yamlfile, 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/>.
- Create a free Anaconda.org account and write down your new Anaconda.org username and password.
- Run
conda install anaconda-clientand enter your Anaconda.org username and password. - 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 theanaconda uploadcommand 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 ๐
- boost <https://github.com/AnacondaRecipes/boost-feedstock> is an example of a popular programming library and illustrates the use of selectors in a recipe.
- libtiff <https://github.com/AnacondaRecipes/libtiff-feedstock> is another example of a compiled library, which shows how conda can apply patches to source directories before building the package.
msgpack(https://github.com/AnacondaRecipes/msgpack-python-feedstock),blosc(https://github.com/AnacondaRecipes/python-blosc-feedstock), andcytoolz(https://github.com/AnacondaRecipes/cytoolz-feedstock) โ these are the girlies that are Python libraries with extensions ๐toolz(https://github.com/AnacondaRecipes/toolz-feedstock),sympy(https://github.com/AnacondaRecipes/sympy-feedstock),six(https://github.com/AnacondaRecipes/six-feedstock), andgensim(https://github.com/AnacondaRecipes/gensim-feedstock) โ and these ones? pure Python-only libraries, no extensions, just vibes ๐ฆ
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
workfolder 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 themeta.yamlfile.BUILDโ Set during processing of thebld.batorbuild.shscript files.TESTโ Set during the running of anyrun_testscripts, which also includes any commands defined inmeta.yamlin thetest/commandssection.
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โ either32or64, telling you whether the build is 32-bit or 64-bit. The value depends on theARCHenvironment 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 alwaysUnix Makefiles. On Windows, it's generated according to the Visual Studio version activated at build time, for exampleVisual Studio 9 2008 Win64. ๐ชCONDA_BUILD=1โ always set. periodt.CPU_COUNTโ the number of CPUs on the system, as reported bymultiprocessing.cpu_count(). ๐SHLIB_EXTโ the shared library extension.DIRTYโ set to1if the--dirtyflag is passed to theconda-buildcommand. 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 tomake, such as-j2, which uses 2 CPU cores to build your recipe. ๐ฅPY_VERโ Python version building against. Set with the--pythonargument or with theCONDA_PYenvironment variable.NPY_VERโ NumPy version to build against. Set with the--numpyargument or with theCONDA_NPYenvironment 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 leadingh. 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โ1when Python 3 is installed in the host prefix, otherwise0.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 asPREFIX, 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 as9.VS_VERSIONโ the version number of the Visual Studio version activated within the build, such as9.0.VS_YEARโ the release year of the Visual Studio version activated within the build, such as2008.
โจ macOS + LINUX ONLY โจ
HOMEโ the standard$HOMEenvironment variable. yes bestie, the classic ๐PKG_CONFIG_PATHโ path to thepkgconfigdirectory.
โจ macOS ONLY, WE'RE BEING EXCLUSIVE โจ
CFLAGSโ the-archflag.CXXFLAGSโ same asCFLAGS.LDFLAGSโ same asCFLAGS.MACOSX_DEPLOYMENT_TARGETโ same as the Anaconda Python macOS deployment target. Currently10.9.OSX_ARCHโi386orx86_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.9stays10.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, likex86_64-conda_cos6-linux-gnuoraarch64-conda_cos7-linux-gnu. The distribution part of that (thinkcos6,cos7,el8) is customizable โ you do it by setting thecdt_namevariable over in variant configuration. Defaults arecos6for most architectures, andcos7forpowerpc,aarch64, ands390x. And heads up: ifBUILDandcdt_nameare both set,BUILDwins. 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 joinsGIT_DESCRIBE_NUMBERandGIT_DESCRIBE_HASHtogether with an underscore.GIT_DESCRIBE_HASHโ the current commit's short-hash, exactly as it's displayed bygit 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 ofgit 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 joinsHG_NUM_IDandHG_SHORT_IDtogether 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-testand--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 be27,34,35,36, or37.CONDA_NPYโ the NumPy version used to build the package, like19,110, or111.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-por--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.
- 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. ๐
- 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 installdoes. It's also less likely than apip installto 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. - The third way is to use
pipto 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 ๐
- Download or fork the code from <https://github.com/anacondarecipes/aggregate>. The Clang package recipe is in the
clangfolder. The main material is in thellvm-compilers-feedstockfolder. - 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.
- Before any packaging is done, run the
build.shscript: <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 "{}" \;
- With those changes to the activate scripts in place, it's time to move on to installing things. Look back at the
clangfolder'smeta.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 ๐
- 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. ๐
- 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
glibcon linux). - always add a run-time requirement on the respective stdlib (e.g.
libcxxon 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,sha1andsha256will check the provided hexdigest against the downloaded archive, prior to extraction.content_md5,content_sha1andcontent_sha256will check the provided hexdigest against the contents of the (extracted) directory.content_hash_skipcan take a list of relative files and directories to be ignored during the check (e.g. super useful to ignore the.git/directory whengit_urlis 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, orrundeps - package has a matching entry in
conda_build_config.yamlwhich 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
๐ No link
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 fromFalsetoTrueback in conda build 2.0, okay? Setting this toFalsemeans 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-testand--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 bothbuildandhostsections are defined, thebuildsection 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 onlinux-64, but targetslinux-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. Sinceconda-build 3, you can augment the packages in yourbuildandhostsections withrun_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.rscripts 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 definingoutputs/filesas a list without specifyingoutputs/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 therun_exportsentry as a Jinja function to insert values based on the actual version oflibgccproduced 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 forsubpackage-examplewill be created. It will have runtime dependencies onsubpackage1,subpackage2,some-dep, andsome-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 forsubpackage-nameinstallssome-test-depandsubpackage-run-req, but notsome-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/
๐ง Prelink Message File ๐ง
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 followingmeta.yamlwould work with theGITvalues defined for Git repositores. The recipe is included at the base directory of the Git repository, so thegit_urlis../:
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 asetup.pyfile. This can be useful to obtain metadata such as the version from a project'ssetup.pyfile. For example:
{% set data = load_setup_py_data() %}
{% set version = data.get('version') %}
package:
name: foo
version: {{ version }}
load_file_regexโ Search a file for a regular expression returning the first match as a Pythonre.Match<https://docs.python.org/3/library/re.html#match-objects> object.
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 frompyproject.toml. This is especially useful, assetup.pyis 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 toload_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 aspackage_name version build_string) that are listed inrequirements:hostorrequirements: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_namemust be eitherhostorbuild, 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โTrueif the system architecture is x86, both 32-bit and 64-bit, for Intel or AMD chips.x86_64โTrueif the system architecture isx86_64, which is 64-bit, for Intel or AMD chips.linuxโTrueif the platform is Linux.linux32โTrueif the platform is Linux and the Python architecture is 32-bit and uses x86.linux64โTrueif the platform is Linux and the Python architecture is 64-bit and uses x86.armv6lโTrueif the platform is Linux and the Python architecture isarmv6l.armv7lโTrueif the platform is Linux and the Python architecture isarmv7l.aarch64โTrueif the platform is Linux and the Python architecture isaarch64.ppc64leโTrueif the platform is Linux and the Python architecture isppc64le.s390xโTrueif the platform is Linux and the Python architecture iss390x.osxโTrueif the platform is macOS.arm64โTrueif the platform is either macOS or Windows and the Python architecture isarm64.unixโTrueif the platform is either macOS or Linux or emscripten.winโTrueif the platform is Windows.win32โTrueif the platform is Windows and the Python architecture is 32-bit.win64โTrueif the platform is Windows and the Python architecture is 64-bit.pyโ the Python version as an int, such as27or36. Go check theCONDA_PYenvironment variable <#build-envs>.py3kโTrueif the Python major version is 3.py2kโTrueif the Python major version is 2.py27โTrueif the Python version is 2.7. Use of this selector is discouraged in favor of comparison operators (e.g.py==27).py34โTrueif the Python version is 3.4. Use of this selector is discouraged in favor of comparison operators (e.g.py==34).py35โTrueif the Python version is 3.5. Use of this selector is discouraged in favor of comparison operators (e.g.py==35).py36โTrueif 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 as111. Go check theCONDA_NPYenvironment 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 theorstatement, okay? I know it's tempting to writeskip: 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.batpost-link.batpre-unlink.bat
- macOS and Linux:
pre-link.shpost-link.shpre-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, andln.
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_toolon macOS andpatchelfon Linux. ๐ง - Any text file without NULL bytes that contains the build prefix or the placeholder prefix
/opt/anaconda1anaconda2anaconda3is registered in theinfo/has_prefixfile in the package metadata. when conda installs the package, any files ininfo/has_prefixhave 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_prefixusingbuild/detect_binary_files_with_prefixinmeta.yaml. alternatively, individual binary files can be registered by listing them inbuild/binary_has_prefix_filesinmeta.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_placeholdsto 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_filesinmeta.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_1are 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, thebuild_numberis 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
textorbinary. - 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/anaconda1anaconda2anaconda3is 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. ๐ซถ
info/no_link ๐ฆ
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.
Link and unlink scripts ๐ฅ
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.0matches0.9,0.9.1, and1.0, but not1.0.1.==, and!=โ Exact equality and not equalities. Example:==0.5.1matches0.5.1and not anything else while!=0.5.1matches everything but.~=โ Compatibility Release. Example:~=0.5.3is equivalent to>=0.5.3, <0.6.0a.|โ OR. Example:1.0|1.2matches version1.0or1.2.*โ Matches 0 or more characters in the version string. In terms of regular expressions, it is the same asr'.*'. Example:1.0|1.4*matches1.0,1.4and1.4.1b2, but not1.2.,โ AND. Example:>=2,<3matches all packages in the 2 series.2.0,2.1, and2.9all match, but3.0and1.0do 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.0b4will match1.0b5and1.0rc1but not1.0b4or1.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:
numpynumpy 1.8*numpy 1.8.1numpy >=1.8numpy ==1.8.1numpy 1.8|1.8*numpy >=1.8,<2numpy >=1.8,<2|1.9numpy 1.8.1 py27_0numpy=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.11matches1.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.11matches1.11,1.11.0,1.11.0.0, and so on. stricter energy, but still not pixel perfect fr frconda install "numpy=1.11.1|1.11.3"โ the OR constraint."numpy=1.11.1|1.11.3"matches with1.11.1or1.11.3. pick a lane? no bestie, pick TWO ๐ซถconda install "numpy>1.11"โ any numpy version1.12.0aor greater. we love a growth mindset โจconda install "numpy>=1.8,<2"โ the AND constraint."numpy>=1.8,<2"matches with1.8and1.9but not2.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:PATHis 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 considerPATHas 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
$ORIGINvariable 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.appdirectory 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: settingLD_LIBRARY_PATHon Linux orDYLD_LIBRARY_PATHon macOS can interfere with this because the dynamic linker short-circuits link resolution by first looking atLD_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. ๐บ๏ธ
- 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.yamlin 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.xpins major and minor version. more information at Pinning expressions.
- 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. ๐
- 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:
- A file named
conda_build_config.yamlin the user's HOME folder (or an arbitrarily named file specified as the value for theconda_build/config_filekey in your.condarcfile). - A file named
conda_build_config.yamlin the current working directory. - A file named
conda_build_config.yamlin the same folder asmeta.yamlwith your recipe. - Any additional files specified on the command line with the
--variant-config-filesor-mcommand line flags, which can be passed multiple times for multiple files. Theconda buildandconda rendercommands 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:
- Pass the
variantskeyword argument to API functions. Currently, thebuild,render,get_output_file_paths, andcheckfunctions accept this argument.variantsshould 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. - Set the
variantmember of aConfigobject. 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 thebuild/include_recipekey inmeta.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 invariant. These couple groups of keys, so that particular keys are paired, rather than forming a matrix. This is useful, for example, to couplevcversion 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 wholenumpy x.xspec 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 frommeta.yaml'srequirements/buildwhile 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:
- 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
zip_keysmust 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_buildis kind of the opposite ofignore_version. Where they conflict,pin_run_as_buildtakes 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_PYCONDA_NPYCONDA_RCONDA_PERLCONDA_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:
- The dependency is listed in the
requirements/buildsection. It can be pinned, but ngl it doesn't have to be. - The dependency is listed by name (no pinning at all) in the
requirements/runsection. - The
pin_run_as_buildkey 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 usepin_run_as_buildfor. 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 withpin_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.yamlwhich 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 inrunand/ortestrequirements. Takes package name argument. Looks up compatibility of named package installed in the build environment and writes compatible range pin forrunand/ortestrequirements. Defaults to a semver-based assumption:package_name >=(current version),<(next major version). Passmin_pinormax_pina 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 inrunand/ortestrequirements. 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, orexact(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}_compilerandtarget_platform, and outputs a single compiler package name. For example, this could be used to compile outputs targetingx86_64andarmin 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 usesmin_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 versionsubpackage_2 >=2.0.0,<2.1โ more stringent upper boundsubpackage_3 >=3.0,<3.1โ less stringent lower bound, more stringent upper boundsubpackage_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):
- Command-line arguments
- Environment variables
- Conda configuration file (
.condarc) - 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:
1or"1"โ legacy.tar.bz2format2or"2"โ modern.condaformat (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-buildconda convertconda developconda indexconda inspectconda inspect channelsconda inspect linkagesconda inspect objectsconda metapackageconda renderconda skeletonconda skeleton cpanconda skeleton cranconda skeleton luarocksconda 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:
- Copy the template:
https://github.com/conda/conda-build/tree/main/docs/source/resources/tutorial-template.rst. - Replace the italicized text with your tutorial content, following the writing style guide <>.
- Review other tutorials <> for extra guidance.
- Contact us at
documentation@anaconda.comif you need help. ๐ซถ
๐ 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
echoon 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
riscv64architecture support to thecdt()Jinja function. (#5846)
๐ Bug fixes
- Handle unknown dynamic tags in
liefldd. (#5665 via #5778) - Delete
rpathbefore addingrpathon macOS to avoid errors with not having enough space to addrpath. (#5855 via #5856) - Don't fail on empty source archive. Ignore and continue instead. (#5854 via #5861)
- Fix
PendingDeprecationWarningforconda.models.enums.PathTypeby using the newPathEnumname with backward compatibility. (#5901)
๐ Deprecations
- Stop warning about failed
conda-verifyimports. Errors will be logged as debug statements. (#5841 via #5844) - Bump minimum conda version to
25.11.0andconda-libmamba-solverto25.11.0. Remove obsoleteCondaSolverdeprecation warning filters. (#5905) - Remove obsolete
restore_free_channeldeprecation warning filter. This property was removed in conda25.9.0. (#5905)
๐ Docs
- Document
conda_build_config.yamlvariable type differences in selectors vs Jinja2 expressions (#5852 via #5887)
๐งฉ Other
- Use
conda-forgechannel for macOS Intel (osx-64) CI tests since conda25.11+is not available indefaultschannel 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
menuinstJSON validation errors, which used to be warnings. (#5828)
๐ Bug fixes
- Fix
BUILDenvironment variable to respectcdt_namevariant configuration. Previously,BUILDwas hardcoded to usecos6orcos7based on architecture, ignoring thecdt_namevariant when specified. Now, ifcdt_nameis provided in the variant configuration, it will be used in theBUILDvariable. 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_regexwhen 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
- @conda-bot
- @isuruf
- @jaimergp
- @kenodegard
- @ryanskeith
- @shermansiu made their first contribution in
https://github.com/conda/conda-build/pull/5800 - @dependabot[bot]
- @pre-commit-ci[bot]
๐ 25.9.0 (2025-09-26)
๐ Bug fixes
- Import
CondaSubcommandfrom 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_wininstead of deprecatedconda.utils.unix_path_to_win. (#5790) - Use
conda.common.path.BIN_DIRECTORYinstead of removedconda.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 inconda_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._IndentDumperaccording to deprecation policy. Useconda_build.render.CustomDumperinstead. (#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
menuinstJSON documents using the included$schemavalue. (#5569) - Require
conda-libmamba-solver25.4 or greater to fix issues with spaces inCONDA_BLD_PATH. This bumps the minimum conda requirement to 24.11. (#5675) - Fix warning formatting in
liefldd. (#5683) - Fix regression so
os.pathsepworks 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
isandis notoperators to selector minilanguage. (#5720 via #5721) - Remove usage of the
schannelattribute which is deprecated in conda. (#5722)
๐ Deprecations
- Deprecate
conda_build.render._IndentDumper. Useconda_build.render.CustomDumperinstead. (#5282) - Deprecate
conda_build.render._MetaYaml. Unused. (#5282) - Deprecate
conda_build.render._represent_omap. Unused. (#5282) - Deprecate
conda_build.render._unicode_representer. Unused. (#5282) Menuinstvalidation warnings will be raised as errors in 25.11. (#5569)- Remove
conda_build.utils.root_script_dir. (#5726)
๐งฉ Other
menuinstis no longer a dependency. (#5569)- Add
.mdextension to news entries. (#5705)
๐ซถ Contributors
- @emmanuel-ferdman
- @jaimergp
- @jezdez
- @jakirkham
- @kenodegard
- @beckermr
- @travishathaway
- @dependabot[bot]
- @pre-commit-ci[bot]
๐ New Contributors
- @emmanuel-ferdman made their first contribution in
https://github.com/conda/conda-build/pull/5683
๐ 25.4.2 (2025-04-21)
๐ Bug fixes
- Added
len,replace,float, andjoinfunctions/methods for selectors. (#5695) - Added
os.septo 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
evalidateto evaluate selector logic. This restricts which operations are allowed as part of a selector. In particular, onlyos.getenvandos.environare now allowed in theosmodule. (#5482) - Ignore
run_exportsof python from other packages when building withpython_version_independent: true. (#5654)
๐ Bug fixes
- Fix
get_conda_operation_lockscall to use correct arguments. (#4215 via #5259) - Use
conda_build.utils.tar_xfeverywhere to avoid blind usage oftar.extractallin 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-installedpip install options out of the example recipes, because conda-build enforces all the required pip install options itself at build time. (#5541)
๐ Contributors
@conda-bot@isuruf@jaimergp@kenodegard@hombitโ made their first contribution inhttps://github.com/conda/conda-build/pull/5656@matthewfeickertโ made their first contribution inhttps://github.com/conda/conda-build/pull/5541@beckermr@soapy1@tl-hbkโ made their first contribution inhttps://github.com/conda/conda-build/pull/5259@dependabot[bot]@pre-commit-ci[bot]
โจ 25.3.2 (2025-04-02) โจ
๐ Enhancements
- Ignore
run_exportsof Python from other packages when building withpython_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
#5644and#5645. (#5648)
๐ Bug fixes
- Reverted
#5603to 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_independentto support building ABI3 for one CPython version and then using the package in any later version. (#5456) - Added
cdt_archandcdt_nameas used vars whencdtjinja 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: trueas necessary. (#5571 via #5601) - Fixed the transitive subpackage dependency resolution issue
#3308. (#5603) - Limited
patchelfto<0.18. (#5607) - Use the
CONDA_EXEas defined incontext.conda_exe_vars_dictinstead of defaulting to the one in the base env. (#5637) - Fixed
LIEF>=0.15compatibility. (#5626 via #5627)
๐งฐ Other
- Added a
flakymarker to tests that fail randomly. (#5623)
๐ Contributors
@conda-bot@isuruf@jaimergp@jezdez@kenodegard@bernt-matthiasโ made their first contribution inhttps://github.com/conda/conda-build/pull/5627@ForgottenProgramme@beckermr@travishathaway@vyasrโ made their first contribution inhttps://github.com/conda/conda-build/pull/5575@woutdenolfโ made their first contribution inhttps://github.com/conda/conda-build/pull/4977@dependabot[bot]@pre-commit-ci[bot]
โจ 25.1.2 (2025-02-05) โจ
๐ Enhancements
- Fixed
LIEF>=0.15compatibility. (#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
.condathe new default package format..tar.bz2files can still be generated with--package-format=1and/orconda_build.pkg_format: 1in your.condarcfile. (#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
CondaBuildUserErrorexceptions that were formallySystemExitexceptions were not being caught properly. (#5538) - Fixed a bug where bad match specs from intermediate parsing results would cause parsing to fail. (#5555)
- Fixed
KeyErrorwhen an inconsistentbuild.pkg_typevalue is specified inmeta.yaml. (#5560)
๐งฐ Other
- Demoted the logging message about a glob finding no matches from error to warning. (#5472)
๐ Contributors
@conda-bot@carterbox@jaimergp@ForgottenProgramme@beckermr@tttc3@tkelmanโ made their first contribution inhttps://github.com/conda/conda-build/pull/5565@ypradatโ made their first contribution inhttps://github.com/conda/conda-build/pull/5560@dependabot[bot]@pre-commit-ci[bot]
โจ 24.11.2 (2024-11-26) โจ
๐ Bug fixes
- Fixed a bug where
.copy()was used on a string instead ofcopy()when processing variants. (#5417)
๐ Contributors
@corneliusroemerโ made their first contribution inhttps://github.com/conda/conda-build/pull/5417@kenodegard
โจ 24.11.1 (2024-11-21) โจ
๐ Bug fixes
- Fixed
TypeErrorwhen no CLI arguments are passed. (#5549 via #5550)
๐ Contributors
@beeankha@kenodegard
โจ 24.11.0 (2024-11-15) โจ
๐ Enhancements
- Introduced
--package-formatas 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,.condaare all recognized and mapped appropriately. - Other options are rejected.
- Added support for CEP-17
https://github.com/conda/ceps/blob/main/cep-0017.mdthat allows specifying the location of thesite-packagesdirectory with thepython_site_packages_pathbuild option for any packages namedpython. (#5502)
๐ Bug fixes
- Fixed the regex for Jinja2
set/forstatements to be more specific. (#5514) - Fixed
ruamel.yamlusage 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-formatandconda_pkg_formatwill become.condain 25.1. (#5534)
๐ Docs
- Better document
run_test.r. (#5479) - Fixed a bug in the docs build by pinning
conda-sphinx-themeversion to0.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_envare 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
forandsetstatements 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.patchelfis an explicit conda-build dependency on Linux, so it will always be installed. (#5441) - Removed
conda_build.metadata._get_env_path. Useconda.base.context.locate_prefix_by_nameinstead. (#5441) - Removed
conda_build.build._construct_metadata_for_test_from_recipe. Test built packages instead, not recipes (e.g.,conda build --test packageinstead ofconda 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.bz2for local index; generaterepodata.jsononly; requireconda-package-handling >=2.2.0matching conda. (#5231) - Added new
include/excludesections for glob expressions in multi-outputoutputs/files. (#4196 via #5216) - Increased performance by using
pickleinstead ofcopy.deepcopy. (#5281) - Report the fully rendered recipe to stdout before the build process starts. (#3798 via #5344)
- Validate
run_constraineddependencies 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_platformwhen cross-compiling. (#5403)
๐ Deprecations
- Marked
conda_build.build._construct_metadata_for_test_from_recipeas deprecated. Test built packages instead, not recipes (e.g.,conda build --test packageinstead ofconda build --test recipe/). (#3192 via #5352) - Marked
conda_build.build.check_externalfor deprecation.patchelfis an explicit conda-build dependency on Linux so it will always be installed. (#5355) - Removed the following deprecations:
conda_build.config.Config.override_channels(useconda.base.context.context.channelsinstead). (#5333)conda_build.config.noarch_python_build_age_default. (#5333)conda_build.conda_interface.add_parser_channels(useconda.cli.helpers.add_parser_channelsinstead). (#5333)
conda_build.conda_interface.add_parser_prefixโ pls useconda.cli.helpers.add_parser_prefixinstead bestie. (#5333)conda_build.conda_interface.ArgumentParserโ swap it forconda.cli.conda_argparse.ArgumentParser. (#5333)conda_build.conda_interface.binstar_uploadโ the glow-up isconda.base.context.context.binstar_upload. (#5333)conda_build.conda_interface.cc_conda_buildโ useconda.base.context.context.conda_buildinstead. (#5333)conda_build.conda_interface.cc_platformโ useconda.base.context.context.platforminstead. (#5333)conda_build.conda_interface.Channelโ useconda.models.channel.Channelinstead. (#5333)conda_build.conda_interface.Completerโ yeah that one, it's done. (#5333)conda_build.conda_interface.configparserโ useconfigparserinstead. (#5333)conda_build.conda_interface.CondaErrorโ useconda.exceptions.CondaErrorinstead. (#5333)conda_build.conda_interface.CondaHTTPErrorโ useconda.exceptions.CondaHTTPErrorinstead. (#5333)conda_build.conda_interface.CondaSessionโ useconda.gateways.connection.session.CondaSessioninstead. (#5333)conda_build.conda_interface.CONDA_VERSIONโ useconda.__version__instead. (#5333)conda_build.conda_interface.contextโ useconda.base.context.contextinstead. (#5333)conda_build.conda_interface.create_default_packagesโ useconda.base.context.context.create_default_packagesinstead. (#5333)conda_build.conda_interface.default_pythonโ useconda.base.context.context.default_pythoninstead. (#5333)conda_build.conda_interface.determine_target_prefixโ useconda.base.context.determine_target_prefixinstead. (#5333)conda_build.conda_interface.downloadโ useconda.gateways.connection.download.downloadinstead. (#5333)conda_build.conda_interface.env_path_backup_var_existsโ gone bestie. (#5333)conda_build.conda_interface.envs_dirsโ useconda.base.context.context.envs_dirsinstead. (#5333)conda_build.conda_interface.EntityEncoderโ useconda.auxlib.entity.EntityEncoderinstead. (#5333)conda_build.conda_interface.FileModeโ useconda.models.enums.FileModeinstead. (#5333)conda_build.conda_interface.get_conda_build_local_urlโ useconda.models.channel.get_conda_build_local_urlinstead. (#5333)conda_build.conda_interface.get_conda_channelโ useconda.models.channel.Channel.from_valueinstead. (#5333)conda_build.conda_interface.get_prefixโ useconda.base.context.context.target_prefixinstead. (#5333)conda_build.conda_interface.get_rc_urlsโ useconda.base.context.context.channelsinstead. (#5333)conda_build.conda_interface.human_bytesโ useconda.utils.human_bytesinstead. (#5333)conda_build.conda_interface.import_moduleโ useimportlib.import_moduleinstead. (#5333)conda_build.conda_interface.inputโ useinputinstead. (#5333)conda_build.conda_interface.InstalledPackagesโ retired, sorry. (#5333)conda_build.conda_interface.lchmodโ useconda.gateways.disk.link.lchmodinstead. (#5333)conda_build.conda_interface.LinkErrorโ useconda.exceptions.LinkErrorinstead. (#5333)conda_build.conda_interface.LockErrorโ useconda.exceptions.LockErrorinstead. (#5333)conda_build.conda_interface.MatchSpecโ useconda.models.match_spec.MatchSpecinstead. (#5333)conda_build.conda_interface.non_x86_linux_machinesโ useconda.base.context.non_x86_machinesinstead. (#5333)conda_build.conda_interface.NoPackagesFoundโ useconda.exceptions.ResolvePackageNotFoundinstead. (#5333)conda_build.conda_interface.NoPackagesFoundErrorโ useconda.exceptions.NoPackagesFoundErrorinstead. (#5333)conda_build.conda_interface.normalized_versionโ useconda.models.version.normalized_versioninstead. (#5333)conda_build.conda_interface.osโ useosinstead. (#5333)conda_build.conda_interface.PackageRecordโ useconda.models.records.PackageRecordinstead. (#5333)conda_build.conda_interface.PaddingErrorโ useconda.exceptions.PaddingErrorinstead. (#5333)conda_build.conda_interface.partialโ usefunctools.partialinstead. (#5333)conda_build.conda_interface.PathTypeโ useconda.models.enums.PathTypeinstead. (#5333)conda_build.conda_interface.pkgs_dirsโ useconda.base.context.context.pkgs_dirsinstead. (#5333)conda_build.conda_interface.prefix_placeholderโ useconda.base.constants.PREFIX_PLACEHOLDERinstead. (#5333)conda_build.conda_interface.ProgressiveFetchExtractโ useconda.core.package_cache_data.ProgressiveFetchExtractinstead. (#5333)conda_build.conda_interface.reset_contextโ useconda.base.context.reset_contextinstead. (#5333)conda_build.conda_interface.Resolveโ useconda.resolve.Resolveinstead. (#5333)conda_build.conda_interface.rm_rfโ useconda_build.utils.rm_rfinstead. (#5333)conda_build.conda_interface.root_dirโ useconda.base.context.context.root_prefixinstead. (#5333)conda_build.conda_interface.root_writableโ useconda.base.context.context.root_writableinstead. (#5333)conda_build.conda_interface.spec_from_lineโ useconda.cli.common.spec_from_lineinstead. (#5333)conda_build.conda_interface.specs_from_argsโ useconda.cli.common.specs_from_argsinstead. (#5333)conda_build.conda_interface.specs_from_urlโ useconda.cli.common.specs_from_urlinstead. (#5333)conda_build.conda_interface.StringIOโ useio.StringIOinstead. (#5333)conda_build.conda_interface.subdirโ useconda.base.context.context.subdirinstead. (#5333)conda_build.conda_interface.symlink_condaโ yeah, that one's a wrap. (#5333)conda_build.conda_interface.TemporaryDirectoryโ useconda.gateways.disk.create.TemporaryDirectoryinstead. (#5333)conda_build.conda_interface.TmpDownloadโ useconda.gateways.connection.download.TmpDownloadinstead. (#5333)conda_build.conda_interface._toposortโ useconda.common.toposort._toposortinstead. (#5333)conda_build.conda_interface.unix_path_to_winโ useconda.utils.unix_path_to_wininstead. (#5333)conda_build.conda_interface.untrackedโ useconda.misc.untrackedinstead. (#5333)conda_build.conda_interface.Unsatisfiableโ useconda.exceptions.UnsatisfiableErrorinstead. (#5333)conda_build.conda_interface.UnsatisfiableErrorโ useconda.exceptions.UnsatisfiableErrorinstead. (#5333)conda_build.conda_interface.url_pathโ useconda.utils.url_pathinstead. (#5333)conda_build.conda_interface.VersionOrderโ useconda.models.version.VersionOrderinstead. (#5333)conda_build.conda_interface.walk_prefixโ useconda.misc.walk_prefixinstead. (#5333)conda_build.conda_interface.win_path_to_unixโ useconda.common.path.win_path_to_unixinstead. (#5333)conda_build.index.channel_dataโ heads up: theconda_build.index.get_build_indexreturn value forchannel_datais now alwaysNone. (#5333)conda_build.metadata.check_circular_dependenciesโ useconda_build.metadata._check_circular_dependenciesinstead. (#5406)conda_build.metadata.toposortโ useconda_build.metadata.toposort_outputsinstead. (#5406)conda_build.utils._convert_lists_to_setsโ usefrozendict.deepfreezeinstead. (#5333)conda_build.utils.HashableDictโ usefrozendict.deepfreezeinstead. (#5333)conda_build.utils.represent_hashabledictโ usefrozendict.deepfreezeinstead. (#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
CondaBuildUserErrorexception to replace thosesys.exitcalls. (#5353) - Updated the CI so it downloads the MacOSX 10.15 SDK. (#5387)
๐ Contributors ๐
@beeankha@conda-bot@carterboxmade their first contribution inhttps://github.com/conda/conda-build/pull/5216@dholth@isuruf@jaimergp@kenodegard@zklausmade their first contribution inhttps://github.com/conda/conda-build/pull/5364@beckermr@minrk@timkpainemade their first contribution inhttps://github.com/conda/conda-build/pull/4821@dependabot[bot]@pre-commit-ci[bot]
๐ฆ 24.5.1 (2024-05-23) ๐ฆ
๐ฉน Bug fixes ๐ฉน
- Fixed the issue with modifying a
frozendictwhen you specifyoutputs/filesinmeta.yaml. (#5342 via #5345) - Fixed the excessive memory use in
inspect_linkages_lief. (#5267 via #5348)
๐ญ Deprecations ๐ญ
conda_build.metadata.toposortis now marked as deprecated. Useconda_build.metadata.toposort_outputsinstead. (#5342 via #5345)conda_build.metadata.check_circular_dependenciesis now marked as deprecated. Useconda_build.metadata._check_circular_dependenciesinstead. (#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_selectorto cache the line-selector parsed text. (#5237) - Added the
conda_build.render.open_recipecontext manager โ it detects the recipe type (file/meta.yaml,directory/recipe, ortarball/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.contextwith the parsed arguments. This fixes the issue where arguments weren't being processed (like,--override-channelswas literally being ignored before ๐). (#3693 via #5271)
๐ญ Deprecations ๐ญ
- Deprecated the
conda_build.conda_interface.CONDA_VERSIONconstant. Useconda.__version__instead. (#5222) - Deprecated the
conda_build.conda_interface.binstar_uploadconstant. Useconda.base.context.context.binstar_uploadinstead. (#5222) - Deprecated the
conda_build.conda_interface.default_pythonconstant. Useconda.base.context.context.default_pythoninstead. (#5222) - Deprecated the
conda_build.conda_interface.envs_dirsconstant. Useconda.base.context.context.envs_dirsinstead. (#5222) - Deprecated the
conda_build.conda_interface.pkgs_dirsconstant. Useconda.base.context.context.pkgs_dirsinstead. (#5222) - Deprecated the
conda_build.conda_interface.cc_platformconstant. Useconda.base.context.context.platforminstead. (#5222) - Deprecate
conda_build.conda_interface.root_dirconstant. Useconda.base.context.context.root_prefixinstead. (#5222) ๐ - Deprecate
conda_build.conda_interface.root_writableconstant. Useconda.base.context.context.root_writableinstead. (#5222) - Deprecate
conda_build.conda_interface.subdirconstant. Useconda.base.context.context.subdirinstead. (#5222) - Deprecate
conda_build.conda_interface.create_default_packagesconstant. Useconda.base.context.context.create_default_packagesinstead. (#5222) - Deprecate
conda_build.conda_interface.get_rc_urlsfunction. Useconda.base.context.context.channelsinstead. (#5222) - Deprecate
conda_build.conda_interface.get_prefixfunction. Useconda.base.context.context.target_prefixinstead. (#5222) - Deprecate
conda_build.conda_interface.get_conda_channelfunction. Useconda.models.channel.Channel.from_valueinstead. (#5222) - Deprecate
conda_build.conda_interface.reset_contextfunction. Useconda.base.context.reset_contextinstead. (#5222) - Deprecate
conda_build.conda_interface.contextsingleton. Useconda.base.context.contextinstead. (#5251) - Deprecate
conda_build.conda_interface.configparsermodule. Useconfigparserinstead. (#5251) - Deprecate
conda_build.conda_interface.osmodule. Useosinstead. (#5251) - Deprecate
conda_build.conda_interface.partialfunction. Usefunctools.partialinstead. (#5251) - Deprecate
conda_build.conda_interface.import_modulefunction. Useimportlib.import_moduleinstead. (#5251) - Deprecate
conda_build.conda_interface.determine_target_prefixfunction. Useconda.base.context.determine_target_prefixinstead. (#5251) - Deprecate
conda_build.conda_interface.non_x86_linux_machinesconstant. Useconda.base.context.non_x86_machinesinstead. (#5251) - Deprecate
conda_build.conda_interface.ProgressiveFetchExtractclass. Useconda.core.package_cache.ProgressiveFetchExtractinstead. (#5251) - Deprecate
conda_build.conda_interface.CondaErrorclass. Useconda.exceptions.CondaErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.CondaHTTPErrorclass. Useconda.exceptions.CondaHTTPErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.LinkErrorclass. Useconda.exceptions.LinkErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.LockErrorclass. Useconda.exceptions.LockErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.NoPackagesFoundErrorclass. Useconda.exceptions.NoPackagesFoundErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.PaddingErrorclass. Useconda.exceptions.PaddingErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.UnsatisfiableErrorclass. Useconda.exceptions.UnsatisfiableErrorinstead. (#5251) - Deprecate
conda_build.conda_interface.get_conda_build_local_urlclass. Useconda.models.channel.get_conda_build_local_urlinstead. (#5251) - Deprecate
conda_build.config.Config.override_channels. Defer toconda.base.context.context.channelsinstead. (#5271, #5324) - Deprecate
conda_build.conda_interface._toposort. Useconda.common.toposort._toposortinstead. (#5276) - Deprecate
conda_build.conda_interface.add_parser_channels. Useconda.cli.helpers.add_parser_channelsinstead. (#5276) - Deprecate
conda_build.conda_interface.add_parser_prefix. Useconda.cli.helpers.add_parser_prefixinstead. (#5276) - Deprecate
conda_build.conda_interface.ArgumentParser. Useconda.cli.conda_argparse.ArgumentParserinstead. (#5276) - Deprecate
conda_build.conda_interface.cc_conda_build. Useconda.base.context.context.conda_buildinstead. (#5276) - Deprecate
conda_build.conda_interface.Channel. Useconda.models.channel.Channelinstead. (#5276) - Deprecate
conda_build.conda_interface.Completer. Unused. (#5276) - Deprecate
conda_build.conda_interface.CondaSession. Useconda.gateways.connection.session.CondaSessioninstead. (#5276) - Deprecate
conda_build.conda_interface.download. Useconda.gateways.connection.download.downloadinstead. (#5276) - Deprecate
conda_build.conda_interface.EntityEncoder. Useconda.auxlib.entity.EntityEncoderinstead. (#5276) - Deprecate
conda_build.conda_interface.env_path_backup_var_exists. Unused. (#5276) - Deprecate
conda_build.conda_interface.FileMode. Useconda.models.enums.FileModeinstead. (#5276) - Deprecate
conda_build.conda_interface.human_bytes. Useconda.utils.human_bytesinstead. (#5276) - Deprecate
conda_build.conda_interface.input. Useinputinstead. (#5276) - Deprecate
conda_build.conda_interface.InstalledPackages. Unused. (#5276) - Deprecate
conda_build.conda_interface.lchmod. Useconda.gateways.disk.link.lchmodinstead. (#5276) - Deprecate
conda_build.conda_interface.MatchSpec. Useconda.models.match_spec.MatchSpecinstead. (#5276) - Deprecate
conda_build.conda_interface.NoPackagesFound. Useconda.exceptions.ResolvePackageNotFoundinstead. (#5276) - Deprecate
conda_build.conda_interface.normalized_version. Useconda.models.version.normalized_versioninstead. (#5276) - Deprecate
conda_build.conda_interface.PackageRecord. Useconda.models.records.PackageRecordinstead. (#5276) - Deprecate
conda_build.conda_interface.PathType. Useconda.models.enums.PathTypeinstead. (#5276) - Deprecate
conda_build.conda_interface.prefix_placeholder. Useconda.base.constants.PREFIX_PLACEHOLDERinstead. (#5276) - Deprecate
conda_build.conda_interface.Resolve. Useconda.resolve.Resolveinstead. (#5276) - Deprecate
conda_build.conda_interface.rm_rf. Useconda_build.utils.rm_rfinstead. (#5276) - Deprecate
conda_build.conda_interface.spec_from_line. Useconda.cli.common.spec_from_lineinstead. (#5276) - Deprecate
conda_build.conda_interface.specs_from_args. Useconda.cli.common.specs_from_argsinstead. (#5276) - Deprecate
conda_build.conda_interface.specs_from_url. Useconda.cli.common.specs_from_urlinstead. (#5276) - Deprecate
conda_build.conda_interface.StringIO. Useio.StringIOinstead. (#5276) - Deprecate
conda_build.conda_interface.symlink_conda. Unused. (#5276) - Deprecate
conda_build.conda_interface.TempDirectory. Useconda.gateways.disk.create.TemporaryDirectoryinstead. (#5276) - Deprecate
conda_build.conda_interface.TmpDownload. Useconda.gateways.connection.download.TmpDownloadinstead. (#5276) - Deprecate
conda_build.conda_interface.unix_path_to_win. Useconda.utils.unix_path_to_wininstead. (#5276) - Deprecate
conda_build.conda_interface.Unsatisfiable. Useconda.exceptions.UnsatisfiableErrorinstead. (#5276) - Deprecate
conda_build.conda_interface.untracked. Useconda.misc.untrackedinstead. (#5276) - Deprecate
conda_build.conda_interface.url_path. Useconda.utils.url_pathinstead. (#5276) - Deprecate
conda_build.conda_interface.VersionOrder. Useconda.models.version.VersionOrderinstead. (#5276) - Deprecate
conda_build.conda_interface.walk_prefix. Useconda.misc.walk_prefixinstead. (#5276) - Deprecate
conda_build.conda_interface.win_path_to_unix. Useconda.common.path.win_path_to_unixinstead. (#5276) - Deprecate
conda_build.variants.get_vars(loop_only). (#5280) - Deprecate
conda_build.utils.HashableDict. Usefrozendict.deepfreezeinstead. (#5284) - Deprecate
conda_build.utils._convert_lists_to_sets. Usefrozendict.deepfreezeinstead. (#5284) - Deprecate
conda_build.utils.represent_hashabledict. Usefrozendict.deepfreezeinstead. (#5284) - Deprecate
conda_build.config.noarch_python_build_age_default. (#5298) - Postpone
conda_build.index.channel_datadeprecation. (#5299) - Remove
conda_build.api.get_output_file_path. Useconda_build.api.get_output_file_pathsinstead. (#5299) ๐ - Remove
conda_build.bdist_conda. (#5299) - Remove
conda_build.build.have_prefix_files. (#5299) - Remove
conda_build.conda_interface.get_index. Useconda.core.index.get_indexinstead. (#5299) - Remove
conda_build.conda_interface.get_version_from_git_tag. Useconda_build.environ.get_version_from_git_taginstead. (#5299) - Remove
conda_build.conda_interface.handle_proxy_407. Handled byconda.gateways.connection.session.CondaSession. (#5299) - Remove
conda_build.conda_interface.hashsum_file. Useconda.gateways.disk.read.compute_suminstead. (#5299) - Remove
conda_build.conda_interface.md5_file. Useconda.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. Useconda.core.prefix_data.PrefixDatainstead. (#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. Useconda_index._apply_instructionsinstead. (#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
- @beeankha
- @conda-bot
- @jaimergp
- @Callek made their first contribution in https://github.com/conda/conda-build/pull/5252
- @kenodegard
- @mbargull
- @Tobias-Fischer made their first contribution in https://github.com/conda/conda-build/pull/5202
- @ytausch made their first contribution in https://github.com/conda/conda-build/pull/5214
- @dependabot[bot]
- @pre-commit-ci[bot]
๐ฆ 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_condamodule as pending deprecation. (#5196) - Mark
conda_build.build.have_prefix_filesas deprecated. (#5199) - Mark
conda_build.conda_interface.handle_proxy_407as deprecated. Handled byconda.gateways.connection.session.CondaSession. (#5203) - Mark
conda_build.conda_interface.hashsum_fileas deprecated. Useconda.gateways.disk.read.compute_suminstead. (#5203) - Mark
conda_build.conda_interface.md5_fileas deprecated. Useconda.gateways.disk.read.compute_sum(path, 'md5')instead. (#5203) - Mark
conda_build.environ.PREFIX_ACTIONas deprecated. (#5203) - Mark
conda_build.environ.LINK_ACTIONas deprecated. (#5203) - Mark
conda_build.environ.cache_actionsas deprecated. (#5203) โ it's giving legacy, bestie ๐ - Mark
conda_build.index.DummyExecutoras deprecated. (#5203) - Mark
conda_build.index.MAX_THREADS_DEFAULTas deprecated. (#5203) - Mark
conda_build.index.LOCK_TIMEOUT_SECSas deprecated. (#5203) - Mark
conda_build.index.LOCKFILE_NAMEas deprecated. (#5203) - Postpone
conda_build.index.channel_datadeprecation. (#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. Useconda_build.environ.get_package_recordsinstead. (#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. Useconda_build.utils.on_wininstead. (#5203) - Remove
conda_build.noarch_python._force_dir. Useos.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_pathas deprecated. Useconda_build.api.get_output_file_pathsinstead. (#5208) โ bestie, just add the s, I'm begging ๐ - Mark
conda_build.environ.Environmentas deprecated. Useconda.core.prefix_data.PrefixDatainstead. (#5219) - Mark
conda_build.conda_interface.get_version_from_git_tagas deprecated. Useconda_build.environ.get_version_from_git_taginstead. (#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
bitsis โarm64โ inmsvc_env_cmd. (#4867)
Contributors ๐ซถ
- @beeankha
- @conda-bot
- @dholth
- @finnagin made their first contribution in https://github.com/conda/conda-build/pull/4867
- @kathatherine
- @kenodegard
- @mbargull
- @minrk
- @ryanskeith
- @travishathaway
- @pre-commit-ci[bot]
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 channelsto use updated solver/transaction logic. (#5033) - Relax
script_enverror in outputs when variable referenced inscript_envis 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-installableas pending deprecation. (#5033) - Mark
conda_build.inspect_pkg.check_install(package)as pending deprecation in favor ofconda_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.Distas pending deprecation. (#5074) - Mark
conda_build.conda_interface.display_actionsas pending deprecation. (#5074) - Mark
conda_build.conda_interface.execute_actionsas pending deprecation. (#5074) - Mark
conda_build.conda_interface.execute_planas pending deprecation. (#5074) - Mark
conda_build.conda_interface.get_indexas pending deprecation. (#5074) - Mark
conda_build.conda_interface.install_actionsas pending deprecation. (#5074) - Mark
conda_build.conda_interface.linkedas pending deprecation. (#5074) - Mark
conda_build.conda_interface.linked_dataas pending deprecation. (#5074) - Mark
conda_build.utils.linked_data_no_multichannelsas pending deprecation. (#5074) - Mark
conda_build.environ.get_install_actionsas pending deprecation in favor ofconda_build.environ.get_package_records. (#5152) - Mark
conda_build.environ.create_env(specs_or_actions)as pending deprecation in favor ofconda_build.environ.create_env(specs_or_precs). (#5152) - Mark
conda_build.index.channel_dataas pending deprecation. (#5152) - Mark
conda_build.index._determine_namespaceas pending deprecation. (#5152) - Mark
conda_build.index._make_secondsas pending deprecation. (#5152) - Mark
conda_build.index.REPODATA_VERSIONas pending deprecation. (#5152) - Mark
conda_build.index.CHANNELDATA_VERSIONas pending deprecation. (#5152) - Mark
conda_build.index.REPODATA_JSON_FNas pending deprecation. (#5152) - Mark
conda_build.index.REPODATA_FROM_PKGS_JSON_FNas pending deprecation. (#5152) - Mark
conda_build.index.CHANNELDATA_FIELDSas pending deprecation. (#5152) - Mark
conda_build.index._clear_newline_charsas pending deprecation. (#5152) - Mark
conda_build.index._apply_instructionsas pending deprecation. (#5152) - Mark
conda_build.index._get_jinja2_environmentas pending deprecation. (#5152) - Mark
conda_build.index._maybe_writeas pending deprecation. (#5152) - Mark
conda_build.index._maybe_build_stringas pending deprecation. (#5152) - Mark
conda_build.index._warn_on_missing_dependenciesas pending deprecation. (#5152) - Mark
conda_build.index._cache_post_install_detailsas pending deprecation. (#5152) - Mark
conda_build.index._cache_recipeas pending deprecation. (#5152) - Mark
conda_build.index._cache_run_exportsas pending deprecation. (#5152) - Mark
conda_build.index._cache_iconas pending deprecation. (#5152) - Mark
conda_build.index._make_subdir_index_htmlas pending deprecation. (#5152) - Mark
conda_build.index._make_channeldata_index_htmlas pending deprecation. (#5152) - Mark
conda_build.index._get_source_repo_git_infoas pending deprecation. (#5152) - Mark
conda_build.index._cache_info_fileas pending deprecation. (#5152) - Mark
conda_build.index._alternate_file_extensionas pending deprecation. (#5152) - Mark
conda_build.index._get_resolve_objectas pending deprecation. (#5152) - Mark
conda_build.index._get_newest_versionsas pending deprecation. (#5152) - Mark
conda_build.index._add_missing_depsas pending deprecation. (#5152) - Mark
conda_build.index._add_prev_ver_for_featuresas pending deprecation. (#5152) - Mark
conda_build.index._shard_newest_packagesas pending deprecation. (#5152) - Mark
conda_build.index._build_current_repodataas pending deprecation. (#5152) - Mark
conda_build.index.ChannelIndexas pending deprecation. (#5152) - Mark
conda_build.render.actions_to_pinsas pending deprecation. (#5152) - Mark
conda_build.render.execute_download_actions(actions)as pending deprecation in favor ofconda_build.render.execute_download_actions(precs). (#5152) - Mark
conda_build.render.get_upstream_pins(actions)as pending deprecation in favor ofconda_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_prefixtoo. (#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
- They added GoatCounter (
https://www.goatcounter.com/) as an analytics tool, bestie. Tracking the vibes, respectfully. (#5093)
๐ง 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.Distwithconda.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_binaryso it can handleNoneinputs like a grown-up. (#5123 via #5124) - Updated
conda_build.inspect_pkg.which_packageto use a cached mapping of paths to packages โ first call: O(n), subsequent calls: O(1) โจ โ instead of relying onPath.samefilecomparisons, 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_sectionto 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_packagesdisplaysstr(PackageRecord)instead ofrepr(PackageRecord). (#5106 via #5108) - Fixed the finalization of recipes with multiple sources. (#5111 via #5112)
- Improved handling by catching the more general
ImportErrorinstead ofModuleNotFoundError, so cases involvingmenuinst1.x are covered too. (#5116)
๐ Contributors
@jaimergp@kenodegard
3.28.1 (2023-12-06)
๐ Bug fixes
- Relaxed the
conda_build.metadata.MetaData.versionchecks when outputs have been defined. Deep breaths, bestie. (#5096) - Removed
lieffrompyproject.tomlbecause it madepip checkfail ๐ญ. It's getting re-added in the future, after an update to thepy-liefpackage. (#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
stblibjinja function, similar tocompiler, so you can explicitly define sysroot dependencies. (#4999) - Now using conda-known subdirs for selector definitions, which means
conda_buildcan support new architectures with only an updated conda version. Heads up though: new OS support needs extra info forconda_buildto 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_packageimplementations and replacedconda.models.dist.Distusage withconda.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.yamlentries when those variants are absent from lower prioritycbc.yamls. (#5039) - Corrected the check for a missing
anaconda-clientso it actually shows a useful error message. (#5050) - Fixed
conda_index.indexverbose DEBUG/INFO message logging. (#5066)
โ ๏ธ Deprecations
- Marked
conda_build.environ.clean_pkg_cachefor pending deprecation. (#5031) - Marked
conda_build.conda_interface.IndexRecordfor pending deprecation. Useconda.models.records.PackageRecordinstead. (#5032) - Marked
conda_build.os_utils.pyldd.is_stringfor pending deprecation. Useisinstance(value, str)instead. (#5040) - Marked
conda_build.os_utils.pyldd.is_codefilefor pending deprecation. Useconda_build.os_utils.pyldd.codefile_classinstead. (#5040) - Marked
conda_build.os_utils.pyldd.codefile_typefor pending deprecation. Useconda_build.os_utils.pyldd.codefile_classinstead. (#5040) - Marked
conda_build.inspect_pkg.dist_filesfor pending deprecation. (#5041) - Marked
conda_build.inspect_pkg.which_package(avoid_canonical_channel_name)for pending deprecation. (#5041) - Marked
conda_build.inspect_pkg._installedfor pending deprecation. (#5041) - Marked
conda_build.os_utils.ldd.get_package_filesfor pending deprecation. (#5041) - Marked
conda_build.os_utils.pyldd.mach_o_changefor pending deprecation. (#5041) - Marked
conda_build.os_utils.pyldd.inspect_rpathfor pending deprecation. (#5041) - Marked
conda_build.os_utils.pyldd.get_runpathsfor pending deprecation. (#5041) - Marked
conda_build.os_utils.pyldd.otool_sysfor pending deprecation. (#5041) - Marked
conda_build.os_utils.pyldd.ldd_sysfor pending deprecation. (#5041) - Marked
conda_build.post.determine_package_naturefor pending deprecation. Useconda_build.post.get_dsosandconda_build.post.get_run_exportsinstead. (#5041) - Marked
conda_build.post.library_nature(subdir, bldpkgs_dirs, output_folder, channel_urls)for pending deprecation. (#5041) - Marked
conda_build.post.dist_from_namesfor pending deprecation. Queryconda.core.prefix_data.PrefixDatainstead. (#5041) - Marked
conda_build.post.FakeDistfor pending deprecation. Useconda.models.records.PrefixRecordinstead. (#5041) - Marked
conda_build.post._get_fake_pkg_distfor pending deprecation. Useconda.models.records.PrefixRecordinstead. (#5041) - Marked
conda_build.utils.relativefor pending deprecation. Useos.path.relpathorpathlib.Path.relative_toinstead. (#5042)
๐ Docs
- Incorporated the
conda-sphinx-themeinto theconda-builddocumentation. Cute. (#5067) - Updated certain pages to remove redundant TOC entries. (#5067)
๐ง Other
- Implemented the Ruff linter in the pre-commit configuration. (#5015)
- Replaced
blackwithruff formatin the pre-commit setup. (#5052) - Identified Unicode tests as incompatible with
libmamba. (#5059)
๐ Contributors
@conda-bot@danpetrymade their first contribution inhttps://github.com/conda/conda-build/pull/5039@duncanmmacleod@h-vetinarimade their first contribution inhttps://github.com/conda/conda-build/pull/4999@isuruf@jaimergp@jakirkham@kenodegard@mbargull@travishathaway@pre-commit-ci[bot]
3.27.0 (2023-09-26)
โจ Enhancements
- Removed the
glob2dependency. As of Python 3.5, the'**', operator was available toglobwhen usingrecursive=True. Builtinglobis also much faster. (#5005) - Handle
emscripten-wasm32andwasi-wasm32platforms. (#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 . -vvis 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-buildshould be run from thebaseenvironment. (#4995)
๐ Contributors
@beeankha@conda-bot@dholth@DaveKaretnykmade their first contribution inhttps://github.com/conda/conda-build/pull/5004@boldorider4made their first contribution inhttps://github.com/conda/conda-build/pull/4960@jaimergp@jezdez@jugmac00@kenodegard@ryanskeith@scdubmade their first contribution inhttps://github.com/conda/conda-build/pull/4965@wolfvmade their first contribution inhttps://github.com/conda/conda-build/pull/4813@dependabot[bot]@pre-commit-ci[bot]
๐ 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
pipto the env-doc make command so the function actually works correctly โ becausepipis 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_staticdefault value inconda_build.configto 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
.condapackage format. (#4633) - Dropped the unnecessary Jinja package name variables from the
variants.rstdocs file. (#4834)
๐ Other ๐
- Dropped the duplicate
get_summarycall inconda_build.skeletons.pypi. (#3998) - Fixed the failing
resolved_packagestest, which broke because of the recent OpenSSL 3.0.8 release to defaults. (#4912)
๐ซถ Contributors ๐ซถ
@beeankha@conda-bot@dbast@jaimergp@jakirkham@josegonzalezmade their first contribution inhttps://github.com/conda/conda-build/pull/3998@katietz@kenodegard@rfezzanimade their first contribution inhttps://github.com/conda/conda-build/pull/4850@ryanskeith@sven6002@dependabot[bot]@pre-commit-ci[bot]
๐ 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_usernameandsvn_password, bestie. (#4692) - Now depending on standalone
conda-indexinstead of the bundled indexing code. (#4828) - Switched from
setup.pytopyproject.tomland they're using Hatchlinghttps://pypi.org/project/hatchling/for the build system. (#4840) - Added Python 3.11 support. (#4852)
๐ Bug fixes ๐
- Ensured that
tests/commandsare also run in the presence ofrun_test.*. (#4429) - The source is now required when rendering a recipe that uses the
load_file_datafunction. (#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 indexlogic is pending deprecation. conda-build still providesconda-indexa.k.a. theconda indexCLI, but it uses standaloneconda-indexduring builds. (#4828) - Prefer the standalone conda-index package
https://conda.github.io/conda-index/instead ofconda-build indexorconda index, so you get the faster indexing code. (#4828) conda_build.metadata.ns_cfgis marked as pending deprecation. Useconda_build.get_selectors.get_selectorsinstead. (#4837)conda_build.config.python2_fs_encodeis marked as pending deprecation. (#4843)conda_build.config._ensure_diris marked as pending deprecation. Use stdlib'spathlib.Path.mkdir(exist_ok=True)oros.makedirs(exist_ok=True)instead. (#4843)
๐ Other ๐
- Formatted with
blackand replaced pre-commit'sdarkerhook withblack. (#4836) - Formatted with
isortand added the pre-commitisorthook. (#4836) - Minor code simplification for
conda_build.index.ChannelIndex._ensuredirs. (#4843) - Enabled the xattr test on macOS. (#4845)
๐ซถ Contributors ๐ซถ
@beeankha@conda-bot@dholth@duncanmmacleod@ffirmanffmade their first contribution inhttps://github.com/conda/conda-build/pull/4692@isuruf@jezdez@jakirkham@jjhelmus@kenodegard@rishabh11336made their first contribution inhttps://github.com/conda/conda-build/pull/4782@ryanskeithmade their first contribution inhttps://github.com/conda/conda-build/pull/4843@pre-commit-ci[bot]
๐ 3.24.0 (2023-03-22) ๐
๐ Bug fixes ๐
- Fixed the failing
git clonewhen 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 cpannow correctly adds a C compiler as a dependency if the distribution contains an.xsfile. (#4599)- Downstream packages now install in the correct subdir. (#4763, #4803)
- Updated the supported Python version in
setup.py. (#4804)
๐ Deprecations ๐
- Removed
conda <4.13logic. (#4677) conda_build.conda_interface.CrossPlatformStLinkis pending deprecation in favor of usingos.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_recipein favor of a session fixture. (#4781) - Use
tomllib(Python 3.11+) ortomlifor.tomlsupport. (#4783)
๐ซถ Contributors ๐ซถ
@beeankha@conda-bot@dbast@dholth@ernstluringmade their first contribution inhttps://github.com/conda/conda-build/pull/4318@xileF1337made their first contribution inhttps://github.com/conda/conda-build/pull/4592@jezdez@jakirkham@johnnynunezmade their first contribution inhttps://github.com/conda/conda-build/pull/4804@kathatherine@kenodegard@minrk@peetwmade their first contribution inhttps://github.com/conda/conda-build/pull/4662@sven6002made their first contribution inhttps://github.com/conda/conda-build/pull/4621@tttc3made their first contribution inhttps://github.com/conda/conda-build/pull/4580@dependabot[bot]@pre-commit-ci[bot]
๐ฆ 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/bintoPATHon Windows and removed thePREFIXroot fromPATHon 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_levelwith 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
scriptandfilesarguments. 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_patternsbuild parameter to speed up recipes where it's just not helpful. (#4576) - Added
win-arm64as 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_contentsto usepathlib.Path. Markedtest_cli.test_convertasxfailon Windows (something with the GitHub Windows Runner makes this particularly flaky). (#4619, #4626)
๐ Deprecations ๐
- Dropped the
cytoolzdependency. (#4556) - Removed internal usage of the
memoizeddecorator. (#4593, #4615) - Removed py2 compatibility code and the use of
six.pycode exported from conda. (#4603) conda_build.environ.system_varsis marked as pending deprecation. Useconda_build.environ.os_varsinstead. (#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 ๐
- Added the
s390xselector that was missing from the docs. (#4550) - Updated the "Channels and generating an index" docs to specify additional platforms. (#4602)
- Linked to
https://packaging.python.org/en/latest/tutorials/packaging-projects/over setuptools for how to pack a project. (#4632)
๐ Other ๐
- Renamed the canary recipe from
conda.recipetorecipe. (#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 ๐ซถ
@chenghlee@conda-bot@dholth@tnabtafmade their first contribution inhttps://github.com/conda/conda-build/pull/4602@erykoffmade their first contribution in https://github.com/conda/conda-build/pull/4603@isuruf@jaimergpmade their first contribution in https://github.com/conda/conda-build/pull/4604@jezdez@kenodegard@mariusvniekerk@msarahan@skupr-anacondamade their first contribution in https://github.com/conda/conda-build/pull/4550@pre-commit-ci[bot]@brettcannonmade their first contribution in https://github.com/conda/conda-build/pull/4632
๐ 3.22.0 (2022-08-02)
Enhancements โจ
- Created function
load_file_dataavailable in Jinja templates formeta.yaml(#4465, #4480) - Created function
load_str_dataavailable in Jinja templates formeta.yaml(#4465, #4480) - Support using
--zstd-compression-levelto control the compression of v2 style conda packages. (#4467)
Bug fixes ๐
- When building with Python 3.10,
STDLIB_DIRandSP_DIRnow refer topython3.10, not the symlinkpython3.1. (#4479) - Reduce verbosity of
urllib3on 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-patchas a hard dependency. (#4495) - Update โArtistic-2.0โ license test to use a valid package. (#4516)
- Rename
masterbranch tomain. (#4515, #4531)
Contributors ๐ซถ
@abrahammurcianomade their first contribution in #4465/#4480@chrisburr@conda-bot@duncanmmacleod@jezdez@jakirkham@jugmac00made their first contribution in #4478@kathatherinemade their first contribution in #4515@kenodegard@stuarteberg@teake@travishathaway@pre-commit-ci[bot]
๐ฆ 3.21.9 (2022-05-27)
Enhancements โจ
- Replace
is_dirwithscandirforchannel_root. (#4273) - Remove rpaths in
PREFIX/../that doesnโt start withPREFIX. This includesBUILD_PREFIX,SRC_DIR. Previously it was onlyBUILD_PREFIX. (#4287) - Add
entry_pointsto outputs inFIELDSschema. (#4389) - Support for
setuptools61+. (#4430) - Use set membership for faster indexing. (#4459)
Bug fixes ๐
- Remove rpaths that occur multiple times. (#4287)
- Enable
bdist_condaviaentry_pointmechanism supported also bysetuptools >=60.0.0. Usable viafrom setuptools import setupandsetup(distclass=conda_build.bdist_conda.CondaDistribution, ...). (#4368) - Patch
setuptoolsโs vendoreddistutils.coreas 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_condaviafrom distutils.core import setupanddistclass=distutils.command.bdist_conda.CondaDistribution, as that only works forsetuptools <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
pyupgradeto pre-commit. (#4374) - Move MacOS tests from Azure to GitHub Actions. (#4412, #4436, #4455)
- Update
Makefilefor easier testing. (#4425) - Remove unused Travis CI configs. (#4438)
- Add MyST to the documentation system and render release notes correctly. (#4483)
Contributors ๐ซถ
@beeankha@conda-bot@dbast@dholthmade their first contribution in https://github.com/conda/conda-build/pull/4273@isuruf@jezdez@jakirkham@kenodegard@remkademade their first contribution in https://github.com/conda/conda-build/pull/4425@rchordmade their first contribution in https://github.com/conda/conda-build/pull/4353@travishathawaymade their first contribution in https://github.com/conda/conda-build/pull/4448@wimglennmade their first contribution in https://github.com/conda/conda-build/pull/4434@pre-commit-ci[bot]
๐ 3.21.8 (2022-01-25)
Enhancements โจ
- Adds
--extra-meta key=valueoption which allows users to save any specified extra metadata toabout.jsonto 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
crootandbuild_idare 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
auxliblibrary 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_platformenv markers in PyPI skeleton - cran-skeleton: Adds a flag
--no-commentsto 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
.yamlin its name as maybe a recipe fileโ (#4235) - Support setting
build/script_envvalues 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_messagefiles 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_envrecipe 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
cleofto 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: pythonversion from version-age determination (#4174)
Contributors ๐ซถ
@mingwandroid
๐ฅ 3.21.0 (2021-01-10)
Enhancements โจ
activate_in_scriptdefaults to true (#4120)- Add Setting and
build/noarch_python_build_ageand fix tests not finding packages (#4120) - Allow directories as
license_filesource (#4153) - Consider any file containing
.yamlin its name as maybe a recipe file (#4120) - Add
weak_constrainsandstrong_constrainsrun_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-patoption - 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, notMacOS10.9.sdkin tests (#4120) - Warn when files have been removed from the prefix (#4120)
Bug fixes ๐
- Add
conda-verifytoinstall_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_fileto refresh if out of date (#4120) - Ensure
~/.condarcdoes 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.jsonto the target platform for cross-platform builds (#4124) - Reduce
get_rpaths_raw/patchelfdisagree warnings (#4131) - LIEF: Allow parsing static libs to fail (#4149)
- pass
cache_dirtoapi.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
patchorm2-patch, write.shfiles as binary, more Win tests - tests: Avoid issue with
coverage==5.0on Win+Py2.7 - Assume non-revisible patches
- Add flaky marker and
--strict-markerstosetup.cfg - Donโt sort recipes
- Use extra
R_ARGSand 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_fromwhich will ignorerun_exportscoming from a package listed inbuild/ignore_run_exports_from. (#4114)
Bug fixes ๐
- Respect PEP440
~=โCompatible release clauseโ (#4113) - Detect amalgamated patches (#4099)
- Handle
realpathproperly in unsafe patch check (#4099) - Force
channel_targetsto be considered used (#4099) โ no more pretending it's not there, bestie ๐ - Look for
gitinsidebuild_prefixingit_info(#4099) ๐ - Fall back to
shutil.copyifshutil.copy2fails when copying patches (#4099) โ plan B is a whole vibe - Fix indexing by file (#4111) ๐๏ธ
- Helper functions to extract keys (#4088) ๐
- Simplify
find_config_filescall (#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.yamlbuild/error_overlinkinganderror_overdepending(#4074) ๐ - Cleanup variant processing code (#4075) ๐งผ
- Add
--fileoption to indexing (#4076) ๐
Bug Fixes
- Remove old rpath when
loader_pathis used (#4080) ๐ ๏ธ - Fix
MACOSX_DEPLOYMENT_TARGETdefault forosx-arm64(#4091) ๐ - Rewrite
apply_patchagain (#4092) ๐ - Add a
.*toconditional_regex(#4092) ๐
Contributors
@isuruf@njalerikson@cjmartian@mingwandroid
3.20.3 (2020-09-29) ๐ฆ
Enhancements
- Use
CONDA_PACKAGE_EXTENSIONS(#4053) ๐ฆ - Raise
RuntimeErrorinstead of callingsys.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-runto test that a patch applies. Fixes bug 4054 (#4067) ๐ฉน - Include
target_platformin 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
-ein outputs too #4033 ๐ - Add
targetto 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_packagecan be passedavoid_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/.yamltoinfo/.json(#3952) ๐ - allow manual specification of which binary files to prefix replace (#3952) โ๏ธ
- filter out
.AppleDoublefolders 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,sha1orsha256fields) (#3971) ๐ฌ - the
GIT_DESCRIBE_HASHvariable 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_platformfor aid in cross compiling (#4005) ๐ - import
machoon non apple system for cross compiling (#4025) ๐งฒ - Add
ccacheas a jinja 2 function (#4026) โก - Improve cpan skeleton (#4026) ๐ช
- Retry moving host prefix due to Windows file locking (#4026) ๐
- Rename
ccachemethod frommklinktosylinks(#4028) ๐ช
Bug fixes
conda_build.metadata: fixed typos inFIELDS(#3866) ๐- add spaces in CRAN templates (fixes #3943) (#3944) ๐ง
- raise valid
CalledProcessExceptioninmacho.otool(#3952) ๐จ - cache
local_output_foldertoo forget_build_index(#3952) ๐๏ธ - fix relocations when cross compiling (#3995) ๐งญ
- use
host_platforminstead ofsys.platformto facilitate cross compiling (#3997) ๐ฅ๏ธ - Fix parsing
UnsatisfiableErrorfromconda>=4.7.8(#4001) ๐งฉ - allow packages to depend on themselves when cross compiling (#4011) ๐ช
- set the correct
SHLIB_EXTwhen cross compiling (#4013, #4021) ๐ - inspect linkages with
pylddwhen not DLL/EXE files (#4019) ๐ฌ - Respect
no_rewrite_stdout_envon Windows (#4026) ๐ค - Prefix replacement fixes (#4026) ๐ฉน
- Use
git am -3when applying patches (#4026) ๐ฟ - Fix
env_var=valassertion (#4026) โ - Use
exit /Bfrom patch files (#4026) ๐ช
Docs
- extend docs o generating the index (#3877) ๐
- add details to documentation of
run_constrained(#3878) ๐ - remove documentation on
bdist_condaand 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
aarch64selector to the docs (#4003) ๐งฌ - add docs on
build_platformandarm64(#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.8for pypi skeletons (#4014) ๐
3.19.3 (2020-04-13) ๐
Bug fixes
- load log prior to calling
warnmethod (#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_filesto 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
PREFIXdetection 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_filesto specify a list of files #3893 ๐
Bug fixes
- Use
patchelfto 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_filesto specify a list of files #3893 ๐ - Use
patchelfto 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.shfiles 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 twotar_xfrelated util functions ๐ก - Fix
has_prefixdetection for Windows. ๐ช conda_build.inspect_pkg: optimise use offnmatchโก- Do not consider
.ignorefiles when searching with ripgrep ๐ - Remove N*N
os.lstatcalls inbuild_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 pypito use{{ PYTHON }} -m pip install . -vv๐ - Add a warning when a received a file on
RECIPE_PATHโ ๏ธ - Refactored the
skeletons/pypi.pyget_package_metadatato be more modular ๐งฑ - added
--suppress-variablesswitch to hide environment variables from console output ๐คซ
Bug fixes
- Fixed build of
.condapackages enabled viaconda config --set conda_build.pkg_format 2๐ฆ - Workaround for future deprecations of the
SafeConfigParserandreadfpof 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-channeldataargument toconda 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_exportsunless--use-channeldataspecified. ๐ซ - Finalize top-level metadata if not present as an output. ๐
Docs
- Add 3.18.7 release notes ๐
Other
- Add
disable_piptoFIELDSโ
Contributors
@rrigdon@jjhelmus@rrigdon@Bezier89@jakirkham@marcelotrevisani
3.18.8 (2019-07-18) ๐
Enhancements
license_filecan optionally be a yaml list ๐
Bug fixes
- fix readup of existing
index.jsonin 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_exportswhen channeldata not available ๐ช - Make pins for
current_repodataadditive โ always newest, and pins are additions to that โจ - Limit indexing in build to using one thread ๐งต
- Speed up by allowing empty
run_exportsentries in channeldata be valid results - Bump
conda-package-handlingto1.3+ - Add test for
run_exportswithout channeldata - Fallback to file-based
run_exportsif channeldata has no results - Add Mozilla as valid license family ๐ฆ
- Add in fallback for
run_exportswhen 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
keyerrorwith missing timestamp data - when indexing, allow
.tar.bz2files to use.condacache, but not vice versa. This acts as a sanity check on the.condafiles. ๐ง - add
build/rpaths_patchertometa.yaml, to allow switching betweenliefandpatchelffor binary mangling
Contributors ๐
- @mingwandroid
- @msarahan
- @csosborn
3.18.4 (2019-06-21)
Enhancements โจ
- channeldata reworked a bit to try to capture any available
run_exportsfor all versions available
Bug fixes ๐
- make "timestamp" an optional field in
conda indexoperations
Contributors ๐
- @msarahan
3.18.3 (2019-06-20)
Enhancements โจ
- Make VS2017 default Visual Studio
- Add hook for customizing the behavior of
conda render - Drop
/usrfrom CDT skeleton path - Update cran skeleton to use
m2w64compilers 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_fileso it supports.condafiles (use cph) - fix
package_has_filefunction for.condaformat - 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.jsonfile 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.bz2and.condafiles
Contributors ๐
- @mingwandroid
- @msarahan
- @rrigdon
3.18.1 (2019-05-18)
Enhancements โจ
- rearrange steps in
index.pyto 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_USERenvironment 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- likerepodata.json, but only has the newest version of each file - change repodata layout to support
.condafiles. They live under the "packages.conda" key and have similar subkeys to their.tar.bz2counterparts. - Always show display actions, regardless of verbosity level
- Ignore registry autorun for all
cmd.exeinvocations - Relax default pinning on
r-basefor benefit of noarch R packages - Make
conda indexproducerepodata_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_infoINSTALLER file
Bug fixes ๐
- Allow
build/missing_dso_whitelistsection to be empty - Make
conda-debughonor custom channels passed using-c - Do not attempt linkages inspection via
liefif not installed - Fix all
liefrelated regressions brought in v3.17.x - Fix
ZeroDivisionErrorin ELF sections that have zero entries binary_has_prefix_filesandtext_has_prefix_filesnow 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_testscript 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-ruchardetwithr-udpipe) - Update
utils.filter_filesto filter out generated.conda_trashfiles - Replace stdlib
globwithutils.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
tarfilehandling 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.offlinesetting #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_keysas 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
VS20XYINSTALLDIRvar (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.yamlleading to inaccurate hash contents #3311 - fix merge of build/host not being recognized before an
rm_rfcall utilized that info #3311
Contributors ๐
- @Lnaden
- @msarahan
3.17.3 (2018-12-11)
Bug fixes ๐
- ignore non-native binaries in
lieffor now. Cross-platform inspection still theoretically possible usingsubdirparameter. #3306
Contributors ๐
- @msarahanl
3.17.2 (2018-12-11)
Bug fixes ๐
- fix to ignore unsatisfiable
pin_compatiblecalls for packages in other outputs #3277 - add license files to CRAN recipes generated by
conda skeleton#3284 - restrict
py-liefto running on linux/macos only for now #3291, - fix
liefoperation 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.batfiles in root dir #3303 - fix file URL handling on Windows #3303
- use conda's download function rather than
requestsdirectly, 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
nmto 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 debugcommand 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
pylddcould do #3237
๐ Bug fixes
- stop yeeting the build string during
pin_run_as_buildandensure_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_DEPENDENCIESsetting #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-folderswitch is now configurable in condarc #3265 - the
--long-test-prefixswitch 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
PermissionErrorimport 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_locksduring 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-implto 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
binsortwhen it's available to sort the file list in tar archives, so compression is better optimized #3210 - let meta.yaml's
build/rpathskey 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
.RPMand.DEBfiles #3199 - fix dist-info errors where dist-info files didn't match the package name #3206
- fix some hard-coded
.tar.bz2references so other compression formats are easier to support #3206 - batch calls to compiling
.pycfiles to dodge problems with maximum command length #3206 - use
ensure_listin processing files to be extracted #3210 - fix the
KeyErrorthat 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_codeskey 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
--variantsCLI flag for specifying variants #3168 - handle an empty build section in output #3175
- add
mro-base_implas 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-indexnot 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.txtfile with arecipe_log.jsonfile (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_indexused 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.txtnot being filtered frominfo/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_exportshandling #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_indexbehavior (the new one is channel-wide; the old one is specific to a subdir) #3117 - fix
CONDA_BUILD_STATEnot being set whenload_setup_py_datagets run #3117 - fix
channel_nameas a CLI argument forconda 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
.lafiles from packages by default #3102 - memoize
read_meta_file#3108
๐ Bug fixes
- fix
--checkfor 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_exportsand aggregated post-install metadata indexing outputs #3060 - allow whitelisting runpath entries #3072
- consider
*_compiler_versionentries when looping over variants (this allows*_compiler_versionto 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.jsonfile #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-verifyimport error warning showing up in--outputtext #3052 - fix the RPM skeleton test (point to a newer CentOS repo) #3054
- fix
test/filesandtest/source_fileslooking in the wrong place forinfo/recipe/parentcontents (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
--labelCLI 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
UnsatisfiableErrorcausing 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_whitelistin build section #2983 - fix
host_reqsreferring to a detached list, leading torequirements/hostnot being modified byrun_exports#2987 - fix for bypassing MITM proxies based on
SSL_NO_VERIFYenv var #2991 - add
missing_dso_whitelisttoFIELDS#2994 - Don't skip logic in
pylddbased on CB verbosity (--quiet) #2999 - Convert empty git refs to
HEAD, so thatgit_urlbehavior is more predictable #3003 - set
NPY_DISTUTILS_APPEND_FLAGS=1so the compiler package flags are respected #3015 - fix script file renaming when converting package from win to unix #3014
- allow
fnto be omitted when using multipleurlsources #3021 - fix default config settings being shared across
Configinstances #3022 - force text interpretation of CRAN
DESCRIPTIONfiles #3020 - fix
is_no_linkto honor patterns #3023 - fix
test/requiresbeing ignored when--no-copy-test-source-filesis specified #3027 - fix up dependencies in CRAN skeleton output #3030 #3032
๐ธ Enhancements
- change skeleton pypi to generate recipes that use
pipfor install step. Remove description. #2972 - Set environment variable to disable
pipenvironment 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-docsrepo into conda-build (splitting off from conda docs in general)
๐ Bug fixes
- fix
re.escapeusage for Python <3.3 #2970
๐ซถ Contributors
- @mbargull
- @msarahan
โจ 3.10.8 (2018-06-12) โจ
๐ Bug fixes
- clean up
licensefield 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, fixtest_expand_globs#2952- add missing "build" fields in
FIELDSschema thing #2962
๐ซถ Contributors
- @isuruf
- @mariusvniekerk
- @mbargull
- @mingwandroid
โจ 3.10.7 (2018-06-01) โจ
๐ธ Enhancements
- replace
glob2byglobfor 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/filesfunctionality for outputs; add test #2934
๐ซถ Contributors
- @mbargull
- @msarahan
- @nicoddemus
- @rainwoodman
- @sodre
- @tomashek
โจ 3.10.5 (2018-05-23) โจ
๐ธ Enhancements
- allow '*' as an
ignore_run_exportsvalue to ignore allrun_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_valuewithdefaultkeyword 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
PYTHONand other language path vars based on presence in build/host reqs, rather than binary file in either env. Allows usage ofPYTHONand friends inmeta.yamlvars. #2895 - fix entry points incorrecty pointing at build prefix (instead of host), leading to prefix replacement failing #2895
- fix
merge_build_hostfunctionality. 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-existingapplies 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
Nonevalues #2880 - add
/Bto win exits, so that erroring out of tests does not close out of outer shells #2881 - ensure that
merge_build_hostis updated correctly for each output #2882 - Remove several env vars from being recorded in
about.json, over concerns for GDPR compliance #2883 - remove
parent_recipeentry from recipes when recordingmeta.yamlfor output packages, to avoid confusion over used variables #2886 - xfail
get_installed_versionfor new conda andtest_build_with_activate_does_activatewhenPATHis too long #2889 - change
os.renametoshutil.moveso 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.jsonand 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_compilerkey inmeta.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-diror--croot(add locations asfile://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_keyshandling. #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
folderas 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+wpermissions before callinginstall_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
OrderedDictdumping 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_yamlkey to condarc to control whichconda_build_config.yamlshould be used to find thecran_mirrorsetting. #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,
downstreamsthat 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_builddata 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 pinrunor test requirements to indirect dependencies as well as direct dependencies #2715
Bug fixes ๐
- fixed an R/
Rscriptmixup that was breaking usage of theRenv 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_filecan now be found in either the source root or the recipe root (which was, ngl, a common point of confusion) #2792- fixed
disable_pipremovingsetuptoolseven when it was an explicit dependency. The way that this broke is conda changed its string representation ofMatchSpecsand our regex just did not take that into account #2793
Contributors ๐
- @183amir
- @msarahan
3.7.2 (2018-03-22) ๐ฆ
Enhancements โจ
- added
runpathhandling topyldd#2768 - added
lgtm.comconfiguration #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_envis skipped until conda more fully implements it #2722- don't run
mk_relative_osxon linux DSO's #2768 - use
Rscriptto run R tests, so console output is shown more clearly. Only add anr-basespec if neitherr-basenormro-baseare already in deps #2764 - don't filter out
.gitignoreand.gitmoduleswhen 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.fnmatchfor shared library whitelists. Added more Frameworks to the whitelist on Mac #2732
Bug fixes ๐
- squelched yaml
ScannerErrorwhen building index can't readmeta.yamlin 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
ValueErrorwhenpin_subpackageis 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.yamlto booleans (value.lower() == "true") #2723 - changed the r skeleton cran test to a different package (
nmf->acs);nmfgot 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,}linkscripts #2712 - support
mroas 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: genericrecipes 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_mirrorvariable 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
shain 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
pylddand 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_datajinja2 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
psutilfails to import. Disk and total time stats are still available; memory and CPU time are not whenpsutilis unavailable #2693 - fixed directory size computation not being recursive, and used
scandirfor 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/parentfor 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_versionfunction 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_keyswhen testing pkgs (ignores empty values) #2673
Contributors ๐
- @msarahan
3.4.0 (2018-01-31) ๐
Enhancements โจ
- implemented the
--exclusive-config-fileCLI flag for render & build. This file bypasses detection of config files in$HOMEand 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/scriptentry - the output uses the
{{ compiler() }}jinja2 function in its requirements AND the output extension is either.shor.bat - the output has a
build/activate_in_scriptkey inmeta.yamlset to a truthy value AND the output extension is either.shor.bat
- the output has a
Bug fixes ๐
- fixed
AttributeErrorin 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_compatiblejinja2 #2659 - silenced conda
KeyErrorwarnings 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
infofolder that don't appear in theinfo/filesfile. Fixes inclusion of arbitrarily named readme files #2668 - cleans up the host prefix in between skeletons when using pypi's
--recursivemode. 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-overlinkingflag. Conda-build 4.0 will error by default #2635 #2647
Bug fixes ๐
- fixed
merge_build_hostto 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_urlnot affecting the url of the actual skeleton output fromconda skeleton pypi#2646 - fixed overly broad string matching of "None" that caused problems where
Nonemay appear as part of a string inmeta.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_exportsfrom 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_exportsin outputs being overwritten #2623
Contributors
- @jjhelmus
- @mingwandroid
- @msarahan
3.2.1 (2018-01-02)
Enhancements
- Improve the
BUILDenvironment variable value (especially on powerpc) #2615 - Implement CentOS 7
ppc64ledistro forconda skeleton rpm#2615 - Improve handling of outputs that use the
build/skipkey 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_exportsusingpin_subpackagenot applying versioning for the implicit top-level output #2613 - Fix
run_exportsnot 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_rfwhen cleaning out prefixes between outputs #2587 - fix
meta.yamlnot 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_prefixthat needed to behost_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.batand any output scripts, in addition to what already existed inmeta.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_keyswhen computing hashes. Only direct dependencies affect the hash. #2573 - fix
always_include_filesusage 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/scriptandbuild/script_enventries in outputs, for simple scripts and for passing env vars into output scripts #2572
Bug fixes
- fix
run_exportsfrombuildsection 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_fileswhen used in output sections #2569 - add
jinja2to dependencies insetup.py(not just inconda.recipe) #2570
Contributors
- @akovner
- @mingwandroid
- @msarahan
- @nehaljwani
- @rlizzo
2017-12-9 3.1.2:
Bug fixes
- fix copying of relative paths with
source_filesin test section #2551 - fix handling of too many x's in
max_pinfield. If more x's than actual places were present, the incrementing broke. #2552 - refactor upstream pinning, fix extraction of outputs so that
run_exportsandpin_compatiblework 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.pngfiles 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, orrundeps - package has a matching entry in
conda_build_config.yamlwhich is a pin to a specific version, not a lower bound - that package is not ignored by
ignore_versionOR - package uses
{{ compiler() }}jinja2 function
- package is an explicit dependency in
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
infofolder #2538 - Fix
source_filesnot working correctly when using test files in packages #2539
Contributors
- @mingwandroid
- @msarahan
3.0.31 (2017-11-30)
Enhancements
- expose
timeanddatetimemodules in jinja2 context, for use inmeta.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_PROXYenv 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_buildfor 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 justrun) #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_filesact onhost_prefix, notbuild_prefix#2497 - warn users when
script_envpasses env vars through #2502 - fix build string
pyXYbeing justpyXwhen 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.jsonandhash_input.jsonfor easier reading #2476 - check arch in
index.jsonfor 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
pythonfrom 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.Yon windows, with itszip_keys. #2466 - Update cpan skeleton #2156
- Pass through
VSXY0COMNTOOLSenv 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_folderselection in dirty envs #2445 - Fix an
os.renameback tocopy_intofor 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
errorlevelis0instead ofGEQ 1๐ so negative return codes now fail builds, the way they always should have. #2442 - you can pass channels to the
metapackagecommand 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 indexnow generates html index pages in addition torepodata.json๐ #2395- bash verbosity (that's the
-xflag) now depends on how you set the--debugflag #2426 testandbuildsections in any outputs get passed through wholesale now, instead of picking out individual fields from them #2429conda-verifyis now opt-in, not opt-out ๐ซถ use the--verifycli argument, or theverifykeyword in the api. #2436- implemented
requires_featuresandprovides_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_urlis 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_archwasn'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 theMetaDataobject, 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
hostsection present (this helps so you don't have to keep modifying python-only recipes, thank u) #2406 - reduced logging output from
filelockand conda #2418 #2422 - don't strip files in
noarch: pythonwhen 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.yamlnow 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_pythonpackages 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_hashingsetting being ignored when using the conda-build API #2385 - fixed
relpathcausing cross-drive issues on windows #2386 .afiles are now examined when considering prefix replacement #2390- fixed the run/test deps check looking at
build_subdirrather thanhost_subdir(which had broken cross compiling) #2391
๐ซถ Contributors
- @Bezier89
- @mingwandroid
- @msarahan
๐ 3.0.21 (2017-09-18)
๐ Bug fixes
- fixed strong
run_exportsfrombuildbeing applied tohosttoo 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
.batfiles are never created ๐ซถ #2381 - apply "strong"
run_exportsfrom thebuildsection to thehostsection, not just therunsection. this is necessary for making sure features activated by packages in thebuildsection are used to line up thehostsection too. #2382
๐ซถ Contributors
- @msarahan
๐ 3.0.19 (2017-09-15)
๐ Bug fixes
- write
info/filesfor noarch. and always sanity checkinfo/filesโจ #2379 - fixed
build_prefix->host_prefixinwrite_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
archthat should behost_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
--matchargument #2375 - added
subdirto 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_featuresandfeaturesto 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
jinja2function (match the name with_version) #2356
๐ Bug fixes
- using
host_subdirinstead ofbuild_subdirwhen 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
pyldddisagrees warning output for now #2352
๐ซถ Contributors
- @mingwandroid
- @msarahan
๐ 3.0.15 (2017-09-04)
๐ Bug fixes
- fixed relative paths for the
crootargument to the CLI; tested it too ๐ #2335 - fixed several issues with
zip_keys#2340 - fixed output build number never applying #2340
- fixed
ensure_matching_hashesfor strong/weakrun_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.archcomparison being the wrong data type #2325 - fixed
run_exportshandling with dict of lists #2325 pyldd: disambiguates java.classfiles 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_keysbecoming 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_PATHback 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
buildorhost. weak apply only if inhost, or inbuildwith nohostpresent. #2320
๐ Bug fixes
- fixed
PY3Kvalue changing from0/1toTrue/False. keeping it0/1. ๐ work_diris 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_filesandalways_include_filesduring env creation #2323
๐ซถ Contributors
- @msarahan
๐ 3.0.12 (2017-08-23)
โจ Enhancements
- updated default
MACOSX_DEPLOYMENT_TARGETto10.9#2293 - modernized
pin_dependsso it works withconda render#2294 - environment variable pass-throughs now respect variant (env var highest priority; variant, finally default) #2310
๐ Bug fixes
- fixed
run_exportsgetting picked up transitively #2298 - fixed the default compiler not having a platform #2300
- fixed
CONDA_PYformatting (it should not have a period).PY_VERdoes 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-foldernot being respected by the--outputpreview of the output path #2309
๐ซถ Contributors
- @mingwandroid
- @msarahan
๐ 3.0.11 (2017-08-17)
โจ Enhancements
- sets the
BUILDenvironment variable (the triplet used by cross-compiling) #2285 - respects the condarc
cache_dirsetting for changing the source cache dir location #2278 - runs selectors before returning
meta.yamlextractions #2284
๐ Bug fixes
- fixed CRAN skeleton field truncation with
;characters #2274 - warns about overlapping files in subpackages within a recipe #2275
- fixed
--override-channelsnot 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_relocationnot 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
rendercommand not considering provided channels #2267 - fix
get_valuebeing hardcoded to only first entry #2268 - fix setting target (target platform) in output section causing
tarcheckvalidation error #2271 - don't add
setuptoolsto 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_filesdirectly 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_valuefor accessing list items, such as multiple sources #2247 - add independently configurable source cache path (
--cache-dir) #2249 - add
PKG_HASHenv var, available inmeta.yaml. Use this to put the package hash where you want it in your custombuild/stringfield inmeta.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_yamltoruamel.yaml#2233 - raise exception when both
build/scriptinmeta.yamland build script (build.sh/bld.bat) are provided #2238 - Fix unclosed file handle when loading
setup.pydata #2242 - Fix
'path'source with multiple source #2247 - improve compatibility with conda 4.4 #2248
- remove hash from manually-specified
build/stringfields. Use newPKG_HASHenv 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
setuptoolsand not usepip#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.xin outputs (not just parent recipe) #2210 - Relax version constraints for
luaandRin default variant #2213 - fix test of package directly using wrong config object #2214
- Don't check test env satisfiability when
--no-testis passed #2218 - Iron out prefix when
noarchas host env. Was creating separatebuild/hostenvs 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_prefixisn'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 matchingoutput-dir/crootlocations correctly) #2192 - Fix
numpy x.xgetting.*appended, resulting in unsatisfiablenumpy#2193
Contributors ๐ซถ
@msarahan
๐ 3.0.4 (2017-07-11)
Bug fixes ๐
- Don't symlink conda when building conda (clobbers actual scripts) #2167
- Fix
pylddfollowing links #2170 - Preserve mode bit on
noarchpythonbin/Scriptsfiles #2171 - remove logging output showing up with
--outputoption #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.cfgoversetup.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.cfgreading 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_FILEandREQUESTS_CA_BUNDLEenv vars to passed-through variables #2142 - Sort several package aspects for package reproducibility #2143 #2149 #2154
- Add
glob2dependency to allow recursive globs in fields specifying filenames/paths #2146 - Add
conda skeleton rpmfor creating recipes to repackage RPMs as conda packages #2147 - Improve error messaging when
git describefails due to lack of annotated tags #2158
Bug fixes ๐
- drop
setup.pydata 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_pipremoving packages even when they are explicit dependencies #2129 - Remove any
pycfiles for entry point scripts thatpipmay have created #2134 - Ignore unserializable data when reading
setup.pydata #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
runortestdeps 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.yamlwith dep names (implicit jinja2 version spec) #2124
Bug fixes ๐
- fix reference to
cc.subdir(it is justsubdir) #2015 - fix failing test when using
filename_hashing=False(non-existent json file) #2087 - fix dependencies specified to
conda-convertnot being added #2090 - fix
disable_pipremoving packages even when they are explicit recipe deps #2129 - fix
pin_compatiblejinja2 function not respectinglower_boundasNonecorrectly #2138
Contributors ๐ซถ
@jakirkham@mandeep@mingwandroid@msarahan@neok-m4700
โญ 2.1.16 (2017-06-23)
Enhancements โจ
- add CLI flag and condarc setting to disable
--forcefor anaconda upload #2047 - add
doc_source_urlto allowed fields inaboutsection #2048 - add a second pass for getting information from
setup.pythat is performed in the build environment, so that version-specific logic insetup.pyshould 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
DISPLAYenvironment variable on Linux #2098 - Improve
conda_interfacefor better conda 4.4 and later 4.3.x releases #2113 - skeleton pypi & lua: replace legacy
noarchsyntax with conda 4.3 style #2120 - Restore
--keep-old-workflag: works like--dirtyto 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/importswith multiple language entries #1967 - add missing
sixdependency in conda recipe for conda-build #2063 - fix dependency addition when converting packages #2091
- don't set
build_idin test phase when--no-build-idis 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__.txtand the like) has been removed. pin_downstreamhas been renamed torun_exports#1911exclude_from_build_hashhas been renamed toignore_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 withbld.batin win. #1765 - use symlinks when copying to improve performance #1867
- load
setup.cfgdata inload_setup_py_data#1878 - calculate checksum and simplify cran skeleton #1879
- Check that files are executable when finding them #1899
- use
rm_rfto remove prefixes for more cleanliness and better speed #1915 - add support for multiple sources in one
meta.yaml#1929 - allow
exactkeyword forpin_compatiblejinja2 function #1929 - allow selectors in variant
conda_build_config.yamlfiles #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
aboutsection 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_buildvalues (e.g.x.x) rather than just dictionaries #2042 - add
meta.yamlentry to overriderun_exportspins #2073 - add several condarc entries that can be used to control conda-build behavior #2074
- add new
pylddtool and use it whenldd/otoolfail #2082 - Allow configuration of conda-build's loggers by logging configuration files. Default to
debug,infogoing to stdout,warn,errorgoing 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_testfiles (again avoid unsatisfiable errors) #1866 - fix prefix file detection picking up too many files due to env recreation #1866
- fix missing
r_bin, makerun_test.rscripts 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/exceptblock so thatGIT_FULL_HASHis 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.jsonfor noarch packages #1895 - standardize entry point script template to match pip #1908
- fix cleanup happening even when build fails #1909
- fix
bin/condagetting included in conda-build release tarballs #1913 - fix mmap/file problems on virtualbox shared folders #1914
- Correct rendering with
--dirtyflag 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
_toposortfrom conda, reroute throughconda_interface#1952 - Match folder substrings more intelligently, for finding previous builds with
--dirty#1953 - Fix type error with
--skip-existingand some conda recipes (Conda-build's internalconda.recipewas one). #1956 - Fix non-python packages creating python tests where they should not have #1967
- Don't add
python.appto run reqs multiple times #1972 - Fix incorrect removal of
ccinconda_interface.py#1971 - Fix
ORIGINreplacement - 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_recipewhen multiplemeta.yamlfiles 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_platformvariant 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__.txtand the like) has been removed. ๐ pin_downstreamhas been renamed torun_exports#1911exclude_from_build_hashhas been renamed toignore_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 withbld.batin win. #1765 - use symlinks when copying to improve performance #1867
- load
setup.cfgdata inload_setup_py_data#1878 - calculate checksum and simplify cran skeleton #1879
- Check that files are executable when finding them #1899
- use
rm_rfto remove prefixes for more cleanliness and better speed #1915 - add support for multiple sources in one
meta.yaml#1929 - allow
exactkeyword forpin_compatiblejinja2 function #1929 - allow selectors in variant
conda_build_config.yamlfiles #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
aboutsection 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_buildvalues (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_testfiles (again avoid unsatisfiable errors) #1866 - fix prefix file detection picking up too many files due to env recreation #1866
- fix missing
r_bin, makerun_test.rscripts 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/exceptblock so thatGIT_FULL_HASHis 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.jsonfor noarch packages #1895 - standardize entry point script template to match pip #1908
- fix cleanup happening even when build fails #1909
- fix
bin/condagetting included in conda-build release tarballs #1913 - fix mmap/file problems on virtualbox shared folders #1914
- Correct rendering with
--dirtyflag 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
_toposortfrom conda, reroute throughconda_interface#1952 - Match folder substrings more intelligently, for finding previous builds with
--dirty#1953 - Fix type error with
--skip-existingand some conda recipes (Conda-build's internalconda.recipewas one). #1956 - Fix non-python packages creating python tests where they should not have #1967
- Don't add
python.appto run reqs multiple times #1972 - Fix incorrect removal of
ccinconda_interface.py#1971 - Fix
ORIGINreplacement - 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_recipewhen multiplemeta.yamlfiles 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_platformvariant 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__.txtand the like) has been removed. it's gone gone. ๐ pin_downstreamhas been renamed torun_exportsโ#1911exclude_from_build_hashhas been renamed toignore_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 withbld.batin win.#1765 - use symlinks when copying to improve performance โ
#1867 - load
setup.cfgdata inload_setup_py_dataโ#1878 - calculate checksum and simplify cran skeleton โ
#1879 - Check that files are executable when finding them โ
#1899 - use
rm_rfto remove prefixes for more cleanliness and better speed โ#1915 - add support for multiple sources in one
meta.yamlโ#1929 - allow
exactkeyword forpin_compatiblejinja2 function โ#1929 - allow selectors in variant
conda_build_config.yamlfiles โ#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_testfiles (again avoid unsatisfiable errors) โ#1866 - fix prefix file detection picking up too many files due to env recreation โ
#1866 - fix missing
r_bin, makerun_test.rscripts 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_HASHis 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.jsonfor noarch packages โ#1895 - standardize entry point script template to match pip โ
#1908 - fix cleanup happening even when build fails โ
#1909 - fix
bin/condagetting included in conda-build release tarballs โ#1913 - fix mmap/file problems on virtualbox shared folders โ
#1914 - Correct rendering with
--dirtyflag 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
_toposortfrom conda, reroute throughconda_interfaceโ#1952 - Match folder substrings more intelligently, for finding previous builds with
--dirtyโ#1953 - Fix type error with
--skip-existingand some conda recipes (Conda-buildโs internalconda.recipewas one).#1956 - Fix non-python packages creating python tests where they should not have โ
#1967 - Donโt add
python.appto run reqs multiple times โ#1972 - Fix incorrect removal of
ccinconda_interface.pyโ#1971 - Fix
ORIGINreplacement - 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_packagesfunction; add test coverage โ#2009 - pin codecov on appveyor to
2.0.5for 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
libgccto 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_envinindex.jsonโ#1941 - do not add
python.apptorun_reqsmultiple times โ#1981 - Fix
$ORIGINreplacement from extra trailing slash โ#1981 - Remove error when
_licensepackage exists in folder whereconda indexis called โ#2005 - fix
STDLIB_DIRso 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
_toposortfrom conda, reroute throughconda_interfaceโ#1952 - Match folder substrings more intelligently, for finding previous builds with
--dirtyโ#1953 - Fix type error with
--skip-existingand some conda recipes (Conda-buildโs internalconda.recipewas one).#1956
๐ซถ Contributors
@kalefranz@msarahan@rendinam
๐ง 3.0.0beta0 (2017-04-20) ๐ง
๐ Breaking changes
pin_downstreamhas been renamed torun_exportsโ#1911exclude_from_build_hashhas been renamed toignore_versionโ#1911
โจ Enhancements
- use
rm_rfto remove prefixes for more cleanliness and better speed โ#1915 - add support for multiple sources in one
meta.yamlโ#1929 - allow
exactkeyword forpin_compatiblejinja2 function โ#1929 - allow selectors in variant
conda_build_config.yamlfiles โ#1937
๐ Bug fixes
- fix mmap/file problems on virtualbox shared folders โ
#1914 - Correct rendering with
--dirtyflag 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/condagetting 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
MatchSpecimplementation โ#1927 - Fix unbound local variables when
--no-lockingoption 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__.txtand the like) has been removed.
โจ Enhancements
- use symlinks when copying to improve performance โ
#1867 - load
setup.cfgdata inload_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_HASHis 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.jsonfor 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_filesso 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.environstring type compatibility fix โ#1861 - fix indentation breaking perl package testing โ
#1872 - reduce scope of git try/except block so that
GIT_FULL_HASHis 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_testfiles (again avoid unsatisfiable errors) #1866 - fix prefix file detection picking up too many files due to env recreation #1866
- fix missing
r_bin, makerun_test.rscripts 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 withbld.batin 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
WINDIRenv var through on Windows #1837 - make long test prefix an option (default disabled) #1838
๐ Bug fixes
- monkeypatch
ensure_use_localto avoid conda-build import clobbering conda CLI arguments #1834 - Fix context
conda_buildattr 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-folderCLI 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_apptest 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
pypitestto avoid accidental uploads #1758
๐ Contributors
- @gabm
- @msarahan
๐ง 2.1.4 (2017-02-07)
โจ Enhancements
- Allow relative paths for
--crootoption #1736
๐ Bug fixes
- Rename
package_metadata.jsonfile tolink.jsonto 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-dependsoption #1740
๐ Contributors
- @gabm
- @kalefranze
- @msarahan
๐ 2.1.3 (2017-01-31)
โจ Enhancements
- Add
--extra-specsto conda skeleton. Use when a package needs to be available in the temporary env that parsessetup.pyto make the skeleton. #1697 - Allow wheels as a source format #1700
- Allow github urls as CRAN skeleton sources #1710
๐ Bug fixes
- exclude
package/namefield fromuses_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_condaremoving 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_EXCLvariable setting #1651 - filter
.gitdirectories more strictly (keepx.gitfolders, not.git) #1657 - fix 404โs killing CPAN skeleton with newer conda versions #1667
- use
pythonwto run tests on OSX whenosx_is_appis defined inmeta.yaml#1669 - ignore obnoxious
.DS_Storefiles when packaging #1670 - fix
--sourceargument to download source specified inmeta.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.jsoncontents regarding development versions of conda/conda-build #1625 - Fix Appveyor for testing against source branches of conda #1628
- Raise exception when
SRC_DIRis used in tests, butmeta.yamlhas notest/source_filesentry.SRC_DIRpoints at test work folder at test time, for minimal needed changes to recipes - just addtest/source_filesentry with desired files. #1630 - Fix features list not allowed to be
Noneinbdist_conda#1636 - Fix undefined reference to locks in
copy_into#1637 - Fix version comparison in cpan skeleton #1638
- Add dependency on
beautifulsoup4andchardetto better support strangely encoded text files. #1641 - Fix not-yet-fully-rendered versions starting with
.from raising exception #1644 - Consolidate
_check_callandcheck_call_envin 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.jsonandnoarch.jsonintopackage_metadata.json#1535 #1539 - finalize
paths.json, (formerlyfiles.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-lengthto 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--crootto that temporary folder. #1579 - Add
--no-prefix-length-fallbackoption 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/urlfield #1614
๐ Bug fixes
- Rework locks to be more robust #1540
- Call
make_hardlink_copyon 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.yamloutput #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
--pythonoptions or โallโ - this has been broken for some time. Replacement coming in 3.0.0. #1610 - Fix clobbering of
no_linkvariable. #1611 - Fix index when
--output-folderis specified #1613 - Fix
python_d.exeincompatibility 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.jsonandnoarch.jsonintopackage_metadata.json#1535 #1539 - finalize
paths.json, (formerlyfiles.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-lengthto 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--crootto 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-fallbackoption 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_copyon 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
pycfiles when python is not installed in the build env #1593 - Fix a function call leading to corrupted
meta.yamloutput #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 to10.7#1561 - Allow local relative paths to be passed as channel arguments #1565
๐ Bug fixes ๐
- Keep
CONDA_PATH_BACKUPas allowed variable in build/test env activation. Necessary to make deactivation work correctly. #1560 - Define
nomklselector whenFEATURE_NOMKLenvironment variable is not set #1562 - Move test removal of packaged recipe until after test completes #1563
- Allow
source_filesin recognizedmeta.yamlfields #1572
๐ Contributors ๐
@jakirkham@mingwandroid@msarahan
๐ฆ 2.0.11 (2016-11-28) ๐ฆ
โจ Enhancements โจ
- Further develop and update
files.json#1501 - New command line option:
--output-folderallows 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_filesfrombinary_relocation; makebinary_relocationalso accept a list of files or globs #1555
๐ Bug fixes ๐
- rename
short_pathkey infiles.jsontopath#1501 - allow
!in package version (used in epoch) #1542 - don't compute
SHA256for folders #1544 - fix merge check for
dststarting withsrc#1546 - use
normpathwhen comparingutils.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_filesarguments #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.sofollows symlinks) #1521 - specify conda executable name more specifically when getting
about.jsoninfo. 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 -hchanges in MacOS10.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_familyto add to package's index. This improves filtering. #1495 #1503 - Logic for the
license_familyis 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
subdirwas not respecting non-x86 arch (values other than32or64) #1506
๐ Contributors ๐
@caseyclements@minrk@msarahan
๐ 2.0.7 (2016-10-24) ๐
โจ Enhancements โจ
- populate
SHLIB_EXTenvironment variable. For example,.so,.dll,.dylibfile 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
distutilsorsetuptoolsinsetup.py. #1471 - fix noarch value propagation from
meta.yamlto config. Was causing noarch to not be respected in some cases. #1472 - fix calls to
subprocessnot converting unicode to str #1473 - restore
detect_binary_files_with_prefixbehavior - 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.jsondata #1455 - Fix version argument to skeletons not being respected #1456
- Fix infinite recursion when missing dependency is either
rorpython#1458
๐ Contributors ๐
@bryanwweber@msarahan
โญ 2.0.4 (2016-10-07) โญ
โจ Enhancements โจ
- Add
build/skip_compile_pycmeta.yamloption. Use to skip compilation onpycfiles listed therein. #1169 - Add build environment metadata to
about.json(conda, conda-build versions, channels, root pkgs) #1407 - Make
subdirmember of config a derived property, so that setting platform or bits is more direct #1427 - Use subprocess call to windows
delfunction to clear.trashfolder, 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.pydata when considering entry points (use only info frommeta.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 developnot 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
patchelffailures 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
RPATHon Linux - handle relative paths better #1336 - Add
GPLas a license family #1340 - Skip fixing rpath for files listed in
ignore_prefix_files#1345 - Uniformly use conda's
rm_rffunction, notmove_to_trash#1355 - Add support for alternate
PKGINFOfiles. Addspkginfodependency. #1353 - Add
--crootargument toconda buildCLI, to specify build root folder #1358 - Do not index
pkgsfolder #1381 #1388 - Assert that merge destination is not a subdir of source, to avoid recursion problems #1396
- add
UUIDto token upload test to avoid race condition that caused intermittent CI failure #1392 - Roll
source.get_dirintoconfig.work_dir, to avoid confusion. #1400 - Improve locking in several places #1405 #1408
๐ Bug fixes ๐
- Fix
guess_license_familyto haveLGPL->LGPL, not public domain #1336 - Restore standard behavior with
__pycache__folder andpycfiles #1333 - Fix
pyver_reto not catchpython-*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_NPYsetting (only--numpyflag was being respected) #1356 - Fix
--no-build-idargument toconda buildthat was note being respected #1359 - Fix handling of recipe folder specifications coming out blank or
.#1360 #1391 - Handle conda
4.2exceptions better forLinkErrorsandPaddingErrors, better supportOpenSSLcustom prefix replacement #1362 - Fix indentation error leading to
skip-existingnot working #1364 - Fix skeletonize not passing arguments from CLI #1384 #1387 #1406
- Check if file exists before trying to use
staton it. Might avoidmmaperrors. #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_pipbuild option to disable conda's automatic add ofpip/setuptools#1311 - Add
numpyto pypi env creation if it is imported insetup.py#1289 - Improve compatibility with conda
>=4.2regarding prefixes that are too short #1323 - Delete
.pyofiles prior to compiling pyc files. They are considered harmful, bestie. #1328 - Add
conda build purge-allcommand that cleans out built packages and build folders #1329
๐ Bug fixes ๐
- Use
source.get_dirinstead ofconfig.workdirforsource_files(it was one level too low, oops) #1288 - Import
setuptoolsinwindows.pyto apply vc9-finding monkeypatch #1290 - Fix
convertnot updatingsubdirinindex.json#1297 - Update post-build deprecation warning to state
3.0as release for removal #1298 - Create
pkgsfolder if it does not exist #1299 - Fix
warn_on_old_conda_buildto ignore non-final release versions (alpha/beta/rc) #1303 #1315 - Remove coercion of
pycachefolder 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
configis used, relative toconfigargument #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 ๐
jakirkhammingwandroidmsarahan
๐ 2.0.0 (2016-08-29) ๐
Notes here are a consolidation of all changes between1.21.14and2.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
configargument. 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_STATEvariable that reflectsRENDER,BUILD, orTESTstate of build #1232 - Add support for
HG_variables inmeta.yamltemplates (for hg repos) #207 #1234 - Add
source_filestest argument inmeta.yamlto copy files from source into test #1237 - add a
numpy.distutilspatch 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.yamlclearer #1279 - Allow API to accept either paths to
meta.yamlfiles orMetaDataobjects, for better compatibility #1281 - Implement tests to verify api stability #1283
- Add
build/noarchto 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_filesarguments to test inmeta.yaml(avoid__file__errors) #1272 - copy files and folders when breaking hardlinks (rather than renaming) to avoid cross-filesystem errors #1273
- add
Scriptsfolder to prepended binary paths searched on Windows #1276 - update
MACOSX_DEPLOYMENT_TARGEThard-coded value to10.7(better fix soon) #1278 - disallow backslashes in
meta.yamlfields describing paths (e.g.always_include_files) #1280 - prevent
GIT_*env vars from containing newlines #1282 - restore
prefix-lengthsinspect command (lost in merging) #1283
๐ง Restructuring ๐ง
- CLI scripts have been gutted and moved to
conda_build/cli. Content from them is inconda_build, in scripts withoutmain_prefix. #953 - Skeleton generators have been broken out of
main_skeleton.py, and consolidated intoconda_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_filesarguments to test inmeta.yaml(avoid__file__errors) #1272 - copy files and folders when breaking hardlinks (rather than renaming) to avoid cross-filesystem errors #1273
- add
Scriptsfolder to prepended binary paths searched on Windows #1276 - update
MACOSX_DEPLOYMENT_TARGEThard-coded value to10.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.distutilspatch 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 the1.21.xseries. ๐ซถ
โจ Enhancements โจ
- Configuration is local, passed via
configargument. 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_STATEvariable that reflectsRENDER,BUILD, orTESTstate of build #1232 - Add support for
HG_variables inmeta.yamltemplates (for hg repos) #207 #1234 - Add
source_filestest argument inmeta.yamlto 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 inconda_build, in scripts withoutmain_prefix. #953 - Skeleton generators have been broken out of
main_skeleton.py, and consolidated intoconda_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 -amwhen applying git patches, so that patches better retain git history #1222 - allow relatively pathed git submodules #1222
- add
guess_license_familyto pypi skeleton generator #1222
๐ Bug fixes ๐
- fix typo in
convert.py
๐ Contributors ๐
@mingwandroid@msarahan
๐ 1.21.12 (2016-08-17) ๐
โจ Enhancements โจ
- Whitelist the
CPU_COUNTenvironment 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
.pyfiles 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.distdetermination #1174 - Attempt to use
src_dirinstead ofWORK_DIRfor directory creation #1175 - Fix escaping problem with
PY_VCRUNTIME_REDISTsetting #1172 - Set build prefix for win by path, not name #1172
- Quote
INCLUDEandLIBenv 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, notpy. #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 metapackagecommand, 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
--sourceargument 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_downloaddidn't exist. #1148
New Things โจ
- No more exiting on a
compileallfailure. #1146 - Added the
CONDA_BUILD_RENDERINGenvironment 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_setuptoolstoload_setup_py_data(keptload_setuptoolsaround 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.txtparsing for runtime requirements. #1127 - Set
PY_VCRUNTIME_REDISTfor VS 2015+, so that DLL linkage gets used. #1129 - Uses
os.path.normpathinfind_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.pyoptions inconda 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_setuptoolsin 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.exeat the end of a win build. Removed thepsutildependency. #1109 - Prepends
PATHbefore 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_recipeinmeta.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-existingrespect remote channels (s3, file, anaconda.org). #1102 - Reduced the
always_include_filesglob 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
callin 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
Nonevalue broke jinja2 rendering. #1088 - Added the missing support for
include_recipeinmeta.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_versionsdict 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
Noneor otherwise invalid. #1088
Known issues ๐
- Environment activation requires conda >=4.1.6. The
activate.batscript doesn't look in the right place for theactivate.dfolder. - The test suite on Linux and Mac fails the python-build, python-run, and python-build-run tests, because an errant
__conda-version__.txtfile 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__.txtor 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
vcvarsalldirectly 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.batscript doesn't look in the right place for theactivate.dfolder. - The test suite on Linux and Mac fails the python-build, python-run, and python-build-run tests, because an errant
__conda-version__.txtfile 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__.txtor 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.jsonfile that contains the "about" section ofmeta.yaml. #941 - Allows the
--dirtyflag to be passed to theconda buildcommand. Skips download, and provides theDIRTYenvironment 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.yamlin the recipe folder of the package; createsmeta.yaml.renderedin the recipe folder. Neither exists when the recipe isn't included. #1004 - Added the
ignore_prefix_fileskey to build inmeta.yaml. Can ignore a list of files, orTrueto ignore all prefix files. #1008 #1009 - Automatically determines the patch strip level. #1011
Bug fixes/Improvements ๐โจ
- Lightened the requirement that
x.xbe defined in both build and runtime sections. #650 - Removed
info/recipe.jsonfrom build conda packages. Superseded byinfo/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.environfor non-Nonevariables. #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
_buildand_testenvironments appropriately, rather than manipulatingPATHdirectly. #1002 - Doesn't clone git submodules until after the first checkout. #1025
- Moved
check_installover fromconda.install. #1027
Deprecations โ ๏ธ
__conda_version__.txtand 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.xbe 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.environfor non-Nonevariables. #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.jsonfile that contains the "about" section ofmeta.yaml. #941 - Added msys2 paths to build and test environments. #979
- Allows the
--dirtyflag to be passed to theconda buildcommand. Skips download, and provides theDIRTYenvironment 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
--sizeoption 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_PSSmodule, see #469 โจ - updated the default for
CONDA_Rto 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.ReadErrorinconda index, #460 ๐
1.14.0 (2015-06-16) ๐
- added support for signing packages, and indexing them, #430 ๐
- removed
LIBRARY_PATHandINCLUDE_PATHbuild 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.yamltometa.yaml.origin the recipe that gets copied into built packages ๐ - handle links to libraries that exist in multiple places better on OS X ๐
- added
--no-removeoption toconda 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
--groupbyoption toconda inspect linkages๐ - fixed some incorrect "not found" instances from
conda inspect linkageson OS X ๐ญ - don't include versions with restrictions in the build string ๐
- don't fail if
conda-buildcannot 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
noarchdirectory ๐ - handle
tests_requireinconda skeleton pypi๐ pipbuild: don't check if package already exists ๐skeleton pypi: removed--no-downloadoption ๐ฅ- 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 thesubdirkey in the metadata ๐- added
--git-tagtoskeleton cran๐ - include
LANGin the build environment ๐ธ - export proxy environment variables ๐
- fixed
conda skeleton cran --cran-urlโจ - set
CONDA_DEFAULT_ENVin the build environment ๐ - fixed
conda index -c๐ - correctly extract
.tar.Zfiles ๐ - avoid infinite loops in
conda skeleton pypi --recursive๐ - added
--alltoconda inspect linkagesandconda inspect objects๐ - added
--manual-urltoskeleton pypiโญ - fixed issue where
conda indexwith old packages would create bad metadata ๐ญ - resolve circular dependencies in
conda-skeleton(#409) ๐ง - use versioneer 0.14 (#385) ๐ฅ
always_include_fileserrors 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_filesthat causes build failure (#386) ๐ญ
1.12.0 (2015-04-10) ๐
- correctly fix egg directories that are part of the package ๐
- use the
--force-rpathflag topatchelfโจ - updated
MACOSX_DEPLOYMENT_TARGETto 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 inconda skeleton cran๐ - make recommended r packages depend on
r-baseinskeleton cran๐ - new post-build logic on OS X. All libraries on OS X now include
LC_RPATH, which points to the environmentlibdirectory, and use and install name using@rpath๐ - don't set
DYLD_FALLBACK_LIBRARY_PATHin cran recipes (the newLC_RPATHlogic on OS X makes this unnecessary) ๐ - fixed
conda build --build-onlywhen the long build prefix is used ๐ญ - made
conda inspect linkageswork 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
--untrackedflag toconda inspect linkages๐ - build R packages against a specific version of R ๐
- decompress
.tar.zfiles ๐ธ - added support for GitHub urls in
conda skeleton cran๐ฅ
1.11.0 (2015-03-05) ๐ฆ
- added
script_envkey in the build section of themeta.yamlfile, 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
OSErrorinconda index๐ญ - fixed how the
PATHenvironment 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_PREFIXenvironment variable on Windows ๐ - handle list requires in
skeleton pypi๐ - correctly fail if the Windows
bld.batexits 1 ๐ - give a better error message if no urls can be found for a package ๐
- added
__main__to allowpython -m conda_buildโญ - ๐
- write the build script to the source directory for
build/scriptinstead of the recipe directory ๐ธ - handle non-directories in
copy_into(avoids anOSError, #332) ๐ญ - halt the build on YAML error without jinja2 ๐ฅ
- clone git sources with the
--recursiveoption ๐ - added
--channeland--override-channelstoconda build.-cis changed to mean--channelinstead of--check. ๐ - added
--check-md5flag toconda indexโจ - look for
vcvarsall.batfrom 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_pythonpackages, #317 โจ - added
subdirkey toinfo/index.json๐ - allow url to be a list of urls, which are tried until one works ๐
- use quotes instead of
!!strfor versions from the conda skeleton commands ๐ธ - added
conda skeleton cranto generate recipes for packages from CRAN ๐ - added support for adding a readme to a recipe ๐ฅ
- added a
--quietoption toconda 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 inspectfor inspecting packages. The only subcommand so far isconda inspect linkages, which shows the dynamic linkages of the shared object files on Linux. ๐ฅ - correctly handle Unix style
has_prefixeson Windows ๐ญ - run the tests in Binstar build ๐
- only modify egg directories that are part of the package being built ๐
- don't exclude
.dylibfiles 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=1while 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-buildis 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_revas a valid key insource, which is identical in behavior togit_branchandgit_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_prefixflag tometa.yamlto automatically detect binary files with the prefix and add them tobinary_has_prefix_files๐ - fix
git_infowhen the author or commit message contains Unicode characters ๐ญ - allow to pass a url to
skeleton pypi๐ธ - added
NPY_VERenvironment 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/pathin themeta.yamlto 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 pypicomments ๐ฆ - correctly detect when to preserve the egg directory and depend on
setuptoolsinskeleton pypiโจ - set
LIBRARY_PATHandINCLUDE_PATHwhen building on Unix ๐ - allow selectors to have text after them if they are in a comment ๐
- added
CPU_COUNTenvironment variable to the build ๐
1.8.2 (2014-09-19) ๐
- added substantially more tests ๐
- added ability to set additional rpath directories using
build/rpathsโจ patchcommand on windows no-longer takes the--binaryoption ๐ญ- fix post processing so that name-space packages can be 'flattened' into a single directory ๐
- don't remove the
.svndirectory when doing a svn checkout ๐
1.8.1 (2014-09-03) ๐ธ
has_prefixpaths 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
crootto the module level ofconda_build.configfor backwards compatibility ๐ - changed extra long prefix for building to
_placehold...โจ
1.7.1 (2014-08-20) ๐ฆ
- added
--all-extrasflag toskeleton pypi๐ - automatically use the long or short build prefix as needed ๐
- fix to allow specification of full
major.micro.minorfor numpy, python, and perl (only add the build string if it is an exactmajor.minorormajor.minor.patchversion. 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:
- a specific conda package: please file it at <https://github.com/ ContinuumIO/anaconda-issues/issues>
- anaconda.org: please file it at <https://anaconda.org/contact/report>
- repo.anaconda.com: please file it at <https://github.com/ContinuumIO/ anaconda-issues/issues>
- commands under conda env and all other conda commands: please file it at <https://github.com/conda/conda/issues>
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
- fedora 44: conda-build 26.1.0-1.fc44 ยท BSD-3-Clause AND BSD-2-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms