Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull in dependencies of strictness=3 MatchSpec's #1740

Closed
wants to merge 1 commit into from
Closed

Pull in dependencies of strictness=3 MatchSpec's #1740

wants to merge 1 commit into from

Conversation

whitequark
Copy link

Before this change, MatchSpec's (i.e. package dependencies) of
strictness=3 (i.e. with an equality constraint on all of name, version
and build) did not bring the dependencies of the packages they
depend on into consideration, which resulted in assertion failures.

For example, let's consider three packages:

host-plugin/meta.yaml:

package:
  name: host-plugin
  version: {{ environ.get("GIT_DESCRIBE_TAG", "") }}
build:
  string: {{ environ.get("GIT_DESCRIBE_HASH", "") }}
requirements:
  build:
    - host
  run:
    - host {{ "{tag} {hash}".format(
                  tag=environ.get("GIT_DESCRIBE_TAG"), 
                  hash=environ.get("GIT_DESCRIBE_HASH")) 
                if "GIT_DESCRIBE_TAG" in environ else "" }}

host/meta.yaml:

package:
  name: host
  version: {{ environ.get("GIT_DESCRIBE_TAG", "") }}
build:
  string: {{ environ.get("GIT_DESCRIBE_HASH", "") }}
requirements:
  run:
    - dep

dep/meta.yaml:

package:
  name: dep
...

This results in the following failure while trying to install
host-plugin:

  File "~/.miniconda/lib/python3.4/site-packages/conda/resolve.py", line 624, in gen_clauses
    assert len(clause) > 1, '%s %r' % (fn1, ms)
AssertionError: host-plugin-0.0-g123456.tar.bz2 MatchSpec('dep')

After this change, the installation succeeds.

Before this change, MatchSpec's (i.e. package dependencies) of
strictness=3 (i.e. with an equality constraint on all of name, version
and build) did not bring the dependencies of the packages they
depend on into consideration, which resulted in assertion failures.

For example, let's consider three packages:

host-plugin/meta.yaml:
package:
  name: host-plugin
  version: {{ environ.get("GIT_DESCRIBE_TAG", "") }}
build:
  string: {{ environ.get("GIT_DESCRIBE_HASH", "") }}
requirements:
  build:
    - host
  run:
    - host {{ "{tag} {hash}".format(
                  tag=environ.get("GIT_DESCRIBE_TAG"), 
                  hash=environ.get("GIT_DESCRIBE_HASH")) 
                if "GIT_DESCRIBE_TAG" in environ else "" }}

host/meta.yaml:
package:
  name: host
  version: {{ environ.get("GIT_DESCRIBE_TAG", "") }}
build:
  string: {{ environ.get("GIT_DESCRIBE_HASH", "") }}
requirements:
  run:
    - dep

dep/meta.yaml:
package:
  name: dep
...

This results in the following failure while trying to install
host-plugin:

  File "~/.miniconda/lib/python3.4/site-packages/conda/resolve.py", line 624, in gen_clauses
    assert len(clause) > 1, '%s %r' % (fn1, ms)
AssertionError: host-plugin-0.0-g123456.tar.bz2 MatchSpec('dep')

After this change, the installation succeeds.
@whitequark
Copy link
Author

One test fails. I do not have an understanding of conda deep enough to recognize the impact of that failure.

whitequark added a commit to m-labs/artiq that referenced this pull request Oct 26, 2015
This just made conda recurse forever.

This reverts commit f384142.
@rekcahpassyla
Copy link

Looks like #1766 is the fix for this?

@whitequark
Copy link
Author

Right.

@whitequark whitequark closed this Nov 3, 2015
@whitequark whitequark deleted the patch-1 branch November 7, 2015 06:20
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants