-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2579 from msarahan/optional_split_build_host
always split build and host prefixes
- Loading branch information
Showing
6 changed files
with
23 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/test-recipes/metadata/_set_env_var_activate_build/install-output.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
echo VS90COMNTOOLS is "%VS90COMNTOOLS%" (should be some path to vs) | ||
if "%VS90COMNTOOLS%" == "" exit 1 | ||
|
||
call "%PREFIX%\Scripts\activate.bat" "%PREFIX%" | ||
call "%PREFIX%\..\_build_env\Scripts\activate.bat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,10 @@ | ||
import os | ||
import platform | ||
import tempfile | ||
|
||
import pytest | ||
|
||
from conda_build import environ, api | ||
from conda_build.conda_interface import PaddingError, LinkError, CondaError, subdir, MatchSpec | ||
from conda_build.utils import on_win | ||
|
||
from .utils import metadata_dir | ||
from conda_build import environ | ||
|
||
|
||
def test_environment_creation_preserves_PATH(testing_workdir, testing_config): | ||
ref_path = os.environ['PATH'] | ||
environ.create_env(testing_workdir, ['python'], env='host', config=testing_config, | ||
subdir=testing_config.build_subdir) | ||
assert os.environ['PATH'] == ref_path | ||
|
||
|
||
@pytest.mark.serial | ||
@pytest.mark.skipif(on_win, reason=("Windows binary prefix replacement (for pip exes)" | ||
" not length dependent")) | ||
def test_env_creation_with_short_prefix_does_not_deadlock(testing_workdir, caplog): | ||
tempdir = '/tmp' if platform.system() == 'Darwin' else tempfile.gettempdir() | ||
config = api.Config(croot=os.path.join(tempdir, 'cb'), anaconda_upload=False, verbose=True, | ||
set_build_id=False, _prefix_length=80) | ||
recipe_path = os.path.join(metadata_dir, "has_prefix_files") | ||
metadata = api.render(recipe_path, config=config)[0][0] | ||
output = api.build(metadata)[0] | ||
assert not api.inspect_prefix_length(output, 255) | ||
config.prefix_length = 255 | ||
environ.create_env(config.build_prefix, specs_or_actions=["python", metadata.name()], | ||
env='build', config=config, subdir=subdir) | ||
assert 'One or more of your package dependencies needs to be rebuilt' in caplog.text | ||
|
||
|
||
@pytest.mark.serial | ||
@pytest.mark.skipif(on_win, reason=("Windows binary prefix replacement (for pip exes)" | ||
" not length dependent")) | ||
def test_env_creation_with_prefix_fallback_disabled(testing_config): | ||
tempdir = '/tmp' if platform.system() == 'Darwin' else tempfile.gettempdir() | ||
testing_config.croot = os.path.join(tempdir, 'cb') | ||
testing_config.anaconda_upload = False | ||
testing_config.anaconda_upload = False | ||
testing_config.prefix_length_fallback = False | ||
testing_config.prefix_length = 80 | ||
|
||
recipe_path = os.path.join(metadata_dir, "has_prefix_files") | ||
metadata = api.render(recipe_path, config=testing_config)[0][0] | ||
fn = api.get_output_file_paths(metadata)[0] | ||
if os.path.isfile(fn): | ||
os.remove(fn) | ||
|
||
with pytest.raises((SystemExit, PaddingError, LinkError, CondaError)): | ||
output = api.build(metadata)[0] | ||
assert not api.inspect_prefix_length(output, 255) | ||
testing_config.prefix_length = 255 | ||
environ.create_env(testing_config.build_prefix, | ||
specs_or_actions=["python", metadata.name()], | ||
env='build', config=testing_config, subdir=subdir) |