Skip to content

Commit

Permalink
Merge pull request #3397 from rrigdon/update-link-scripts
Browse files Browse the repository at this point in the history
[skip ci] Reorganized Resources, updated link scripts
  • Loading branch information
msarahan committed Feb 15, 2019
2 parents 87566f4 + e4cb7f2 commit b6c1dc3
Show file tree
Hide file tree
Showing 32 changed files with 67 additions and 33 deletions.
15 changes: 2 additions & 13 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,11 @@ Anaconda Cloud, you will need an
source/install-conda-build
source/concepts/index
source/user-guide/index
source/package-spec
source/resources/index
source/package-naming-conv
source/recipe
source/channels
source/define-metadata
source/build-scripts
source/features
source/environment-variables
source/make-relocatable
source/debugging
source/link-scripts
source/variants
source/use-shared-libraries
source/compiler-tools
source/add-win-start-menu-items
source/sample-recipes
source/build-without-recipe
source/wheel-files
source/commands/index
source/wheel-files
File renamed without changes.
8 changes: 5 additions & 3 deletions docs/source/concepts/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
*********
********
Concepts
*********
********

.. toctree::
:maxdepth: 3
:maxdepth: 2

package-anatomy
generating-index
channels
recipe

What is a “package”?
--------------------
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions docs/source/resources/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*********
Resources
*********

.. toctree::
:maxdepth: 1

build-scripts
compiler-tools
define-metadata
link-scripts
make-relocatable
package-spec
use-shared-libraries
variants
commands/index

Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,7 @@ Adding pre-link, post-link and pre-unlink scripts

.. TODO: Add post-unlink
You can add scripts to a recipe. These scripts are executed in a subprocess by
conda, using ``/bin/bash <script>`` on Linux and macOS, and
``%COMSPEC% /c <script>`` on Windows.

The convention for the path and filenames of these scripts on Windows is::

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

On Linux and macOS, the convention is::

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

``<name>`` is the package name and ``<action>`` is one of the following:
You can add scripts to a recipe. They must be located in the same directory as the meta.yaml file. The following scripts can be added:

* ``pre-link``---Executed before the package is installed. An error is
indicated by a nonzero exit and causes conda to stop and causes the
Expand All @@ -27,9 +15,20 @@ On Linux and macOS, the convention is::
* ``pre-unlink``---Executed before the package is removed. An error is
indicated by a nonzero exist and causes the removal to fail.

EXAMPLE: When there is a script named ``/bin/.foo-post-link.sh`` in the package
``foo-1.0-0.tar.bz2``, it is executed after the package is installed.
In addition to being co-located with the meta.yaml file, they must 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 the preceeding actions.

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

The convention for the path and filenames of these scripts on Windows is::

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

On Linux and macOS the convention is::

bin/.<name>-<action>.sh
The scripts set the following environment variables:

.. list-table::
Expand Down Expand Up @@ -63,7 +62,7 @@ Post-link and pre-unlink scripts should:
* Be avoided whenever possible.
* 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.
* Not depend on any installed or to-be-installed conda packages.
* Depend only on simple system tools such as ``rm``, ``cp``, ``mv`` and ``ln``.

The scripts should not write to stdout or stderr unless an error occurs, but
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion docs/source/user-guide/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ Tutorials
*********

.. toctree::
:maxdepth: 1

build-windows
build-windows
add-win-start-menu-items
25 changes: 25 additions & 0 deletions news/update-link-scripts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Enhancements:
-------------

* <news item>

Bug fixes:
----------

* <news item>

Deprecations:
-------------

* <news item>

Docs:
-----

* Reorganized conda-build topics, updated link-scripts

Other:
------

* <news item>

0 comments on commit b6c1dc3

Please sign in to comment.