Skip to content

Commit

Permalink
Make sure symlinked directories are found in always_include_files (co…
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf committed Aug 26, 2021
1 parent 5808620 commit 1a611de
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conda_build/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,11 @@ def expand_globs(path_list, root_dir):
elif os.path.islink(path):
files.append(path)
elif os.path.isdir(path):
files.extend(os.path.join(root, f) for root, _, fs in walk(path) for f in fs)
for root, dirnames, fs in walk(path):
files.extend(os.path.join(root, f) for f in fs)
for dirname in dirnames:
if os.path.islink(os.path.join(root, dirname)):
files.append(os.path.join(root, dirname))
else:
# File compared to the globs use / as separator independently of the os
glob_files = glob(path)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdir -p $PREFIX/sysroot/lib64
touch $PREFIX/sysroot/lib64/empty
ln -s $PREFIX/sysroot/lib64 $PREFIX/sysroot/lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package:
name: symlink_dirs_in_always_include_files
version: 0.0.1

build:
number: 0
skip: True # [win]

outputs:
- name: symlink_dirs_in_always_include_files_foo
script: create_symlinks.sh
test:
commands:
- test -f $PREFIX/sysroot/lib/empty
- test -f $PREFIX/sysroot/lib64/empty

- name: symlink_dirs_in_always_include_files_bar
requirements:
host:
- symlink_dirs_in_always_include_files_foo
build:
always_include_files:
- sysroot/
test:
commands:
- test -f $PREFIX/sysroot/lib/empty
- test -f $PREFIX/sysroot/lib64/empty
5 changes: 5 additions & 0 deletions tests/test_api_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1570,6 +1570,11 @@ def test_ignore_verify_codes(testing_config):
api.build(recipe_dir, config=testing_config)


def test_symlink_dirs_in_always_include_files(testing_config):
recipe = os.path.join(metadata_dir, '_symlink_dirs_in_always_include_files')
api.build(recipe, config=testing_config)


def test_script_env_warnings(testing_config, recwarn):
recipe_dir = os.path.join(metadata_dir, '_script_env_warnings')
token = 'CONDA_BUILD_PYTEST_SCRIPT_ENV_TEST_TOKEN'
Expand Down

0 comments on commit 1a611de

Please sign in to comment.