Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AAB64200C45 for ; Tue, 28 Mar 2017 23:50:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A93F8160B89; Tue, 28 Mar 2017 21:50:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EF888160B6B for ; Tue, 28 Mar 2017 23:50:44 +0200 (CEST) Received: (qmail 95302 invoked by uid 500); 28 Mar 2017 21:50:44 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 95291 invoked by uid 99); 28 Mar 2017 21:50:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Mar 2017 21:50:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8D2F8189FEB for ; Tue, 28 Mar 2017 21:50:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 3EKwxGU7lkd3 for ; Tue, 28 Mar 2017 21:50:42 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 690BD5F29A for ; Tue, 28 Mar 2017 21:50:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E11D9E002F for ; Tue, 28 Mar 2017 21:50:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 99A1725CDD for ; Tue, 28 Mar 2017 21:50:41 +0000 (UTC) Date: Tue, 28 Mar 2017 21:50:41 +0000 (UTC) From: "Thomas Watson (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (FELIX-5601) issues resolving with substitutable exports when the export is the last available provider MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 28 Mar 2017 21:50:45 -0000 [ https://issues.apache.org/jira/browse/FELIX-5601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Watson resolved FELIX-5601. ---------------------------------- Resolution: Fixed I fixed this by doing an additional check in Candidates::canRemoveCandidate that makes sure the current candidate of the dependent CandidateSelector is the candidate that is about to be substituted. I also did the change to traverse the blame requirement chain from direct->root and root->direct requirement to be sure to find a solution if it exists. This was necessary to pass the test testScenario18 which has a blame chain with 4 reqs. > issues resolving with substitutable exports when the export is the last available provider > ------------------------------------------------------------------------------------------ > > Key: FELIX-5601 > URL: https://issues.apache.org/jira/browse/FELIX-5601 > Project: Felix > Issue Type: Bug > Components: Resolver > Reporter: Thomas Watson > Assignee: Thomas Watson > > Substitutable exports that are used by other exported packages can cause a case where a valid solution cannot be found when one exists. The issue only can occur when a substitutable export is the only valid candidate left for a resources mandatory requirement and the resolver decides to permute the substitutable requirement becaused of a used blame. Something like the following resources > resource A1 > provides pkg X v1 > provides pkg Y v1 uses->X > provides pkg Z v1 uses->Y > resource A2 > provides pkg X v2 > provides pkg Y v2 uses->X > provides pkg Z v2 uses->Y > import pkg X v[2,4) > import pkg Y v[2,4) > import pkg Z v[2,4) > resource A3 > provides pkg X v3 > provides pkg Y v3 uses->X > provides pkg Z v3 uses->Y > import pkg X v[2,4) > import pkg Y v[2,4) > import pkg Z v[2,4) > resource B1 > provides pkg W v1 uses->Z > import pkg Z v[1,4) > resource C1 > imports pkg X v[3,4) > Resolve all resources A1, A2, A3, B1, C1 as mandatory resources. This will result in resolution error for B1 because it is exposed to two versions of X through two uses blame chains. The reason this fails is because the resolver first chooses to permute the substitutable requirement from A3 for X which causes X v3 to no longer be available for C1 to import. This causes an error and the permutation fails and all other permutations based off that permutation will be ignored. If instead the resolver would not permute the requirement for X from A3 the resolver would find a valid solution. -- This message was sent by Atlassian JIRA (v6.3.15#6346)