mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Christian Melki <christian.melki@t2data.com>
To: Denis Osterland-Heim <denis.osterland@diehl.com>,
	"m.olbrich@pengutronix.de" <m.olbrich@pengutronix.de>
Cc: "ptxdist@pengutronix.de" <ptxdist@pengutronix.de>
Subject: Re: [ptxdist] [PATCH] Add missing install CROSS_LIB_DIR for CMAKE environments.
Date: Wed, 21 Jul 2021 19:54:05 +0200	[thread overview]
Message-ID: <ebfd093c-30f3-3cf2-19a1-1b0904e07818@t2data.com> (raw)
In-Reply-To: <c03192fb252f94db3b68aeccb3d338eaee23e056.camel@diehl.com>

Sigh. Spec ambiguity mishmash.

AFAIU, spec says that LIBDIR is relative.
CMake then constructs FULL_* variants of the corresponding ones as
absolute paths if not already set.

I'd prefer a relative LIBDIR and then patch programs that have a broken
behavior. But that's probably no less of a pain...

Regards,
Christian

On 7/21/21 6:30 PM, Denis Osterland-Heim wrote:
> Hi,
> 
> I have encountered an problem with this patch in cmake based users of sdbus-cpp package.
> This are the difference of installed cmake file after the patch:
> --- a/sysroot-target/usr/lib/cmake/sdbus-c++/sdbus-c++-targets.cmake
> +++ b/sysroot-target/usr/lib/cmake/sdbus-c++/sdbus-c++-targets.cmake
> @@ -41,23 +41,8 @@
>  unset(_expectedTargets)
> 
> 
> -# Compute the installation prefix relative to this file.
> -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
> -# Use original install
> prefix when loaded through a
> -# cross-prefix symbolic link such as /lib -> /usr/lib.
> -get_filename_component(_realCurr "${_IMPORT_PREFIX}" REALPATH)
> -get_filename_component(_realOrig
> "/usr/lib/cmake/sdbus-c++" REALPATH)
> -if(_realCurr STREQUAL _realOrig)
> -  set(_IMPORT_PREFIX "/usr/lib/cmake/sdbus-c++")
> -endif()
> -unset(_realOrig)
> -unset(_realCurr)
> -get_filename_component(_IMPORT_PREFIX
> "${_IMPORT_PREFIX}" PATH)
> -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
> -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
> -if(_IMPORT_PREFIX STREQUAL "/")
> -  set(_IMPORT_
> PREFIX "")
> -endif()
> +# The installation prefix configured by this project.
> +set(_IMPORT_PREFIX "/usr")
> 
>  # Create imported target SDBusCpp::sdbus-c++
>  add_library(SDBusCpp::sdbus-c++ SHARED IMPORTED)
> 
> 
> This causes following error:
> CMake Error at x/sysroot-target/usr/lib/cmake/sdbus-c++/sdbus-c++-targets.cmake:83 (message):
>   The imported target "SDBusCpp::sdbus-c++" references the file
> 
>      "/usr/lib/libsdbus-c++.so.0.8.2"
> 
>   but this file does not exist.  Possible reasons include:
> 
>   * The file was deleted, renamed, or moved to another location.
> 
>   * An install or uninstall procedure did not complete successfully.
> 
>   * The installation package was faulty and contained
> 
>      "x/sysroot-target/usr/lib/cmake/sdbus-c++/sdbus-c++-targets.cmake"
> 
>   but not all the files it references.
> It looks like an effect mentioned in https://cmake.org/pipermail/cmake/2012-February/049250.html
> and works with the initial relative version.
> 
> Unfortunately it looks like none of both variants is unconditionally right.
> I am not sure how to handle this this properly, but I know that this is ugly:
> --- a/rules/sdbus-cpp.make
> +++ b/rules/sdbus-cpp.make
> @@ -29,7 +29,8 @@
> 
>  SDBUS_CPP_CONF_TOOL:= cmake
>  SDBUS_CPP_CONF_OPT:= \
> -$(CROSS_CMAKE_USR) \
> +$(filter-out -DCMAKE_INSTALL_LIBDIR=/usr/$(CROSS_LIB_DIR), $(CROSS_CMAKE_USR)) \
> +-DCMAKE_INSTALL_LIBDIR=$(CROSS_LIB_DIR) \
>  -DBUILD_TESTS=OFF \
>  -DBUILD_CODE_GEN=OFF \
>  -DBUILD_DOC=OFF
> 
> Regards, Denis
> 
> Am Freitag, den 21.05.2021, 13:03 +0200 schrieb Christian Melki:
>> On 5/21/21 12:52 PM, Christian Melki wrote:
>>> On 5/21/21 12:40 PM, Michael Olbrich wrote:
>>>> On Tue, May 18, 2021 at 03:34:01PM +0200, Christian Melki wrote:
>>>>> Was installing libraries into wrong directories.
>>>>>
>>>>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>>>>> ---
>>>>>   rules/pre/Rules.make | 1 +
>>>>>   1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
>>>>> index 99e459ce2..93645a42a 100644
>>>>> --- a/rules/pre/Rules.make
>>>>> +++ b/rules/pre/Rules.make
>>>>> @@ -233,6 +233,7 @@ CROSS_AUTOCONF_ROOT :=
>>>>> $(CROSS_AUTOCONF_SYSROOT_ROOT) $(CROSS_AUTOCONF_ARCH)
>>>>>   CROSS_CMAKE_USR     := \
>>>>>       -DCMAKE_INSTALL_PREFIX=/usr \
>>>>> +    -DCMAKE_INSTALL_LIBDIR=$(CROSS_LIB_DIR) \
>>>>
>>>> Hmmm, I need -DCMAKE_INSTALL_LIBDIR=/usr/$(CROSS_LIB_DIR) here.
>>>>
>>>> Otherwise the dir is taken as relative to the package build dir, at least
>>>> for libjpeg.
>>>>
>>>> Michael
>>>>
>>>
>>> Hm. Jury's out on that one.
>>> I looked it over before I added it and I think it should be relative?
>>>
>>> https://bugzilla.redhat.com/show_bug.cgi?id=795542
>>> https://gitlab.kitware.com/cmake/cmake/-/commit/126c993d031f6f7be4970a67621da92f580d4e5a
>>>
>>>
>>> Seems spec confusion has caused both variants to exist in the wild?
>>> But it was changed a long time ago to relative...
>>>
>>> Christian
>>>
>>
>> Looking closer...
>> Maybe the only way to get this right is to specify the absolute path.
>> I'm happy with that.
>>
>>>>>       -DCMAKE_INSTALL_SYSCONFDIR=/etc \
>>>>>       -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
>>>>>       -DCMAKE_TOOLCHAIN_FILE='${PTXDIST_CMAKE_TOOLCHAIN_TARGET}'
>>>>> --
>>>>> 2.31.1
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> ptxdist mailing list
>>>>> ptxdist@pengutronix.de
>>>>> To unsubscribe, send a mail with subject "unsubscribe" to
>>>>> ptxdist-request@pengutronix.de
>>>>>
>>>
>>> _______________________________________________
>>> ptxdist mailing list
>>> ptxdist@pengutronix.de
>>> To unsubscribe, send a mail with subject "unsubscribe" to
>>> ptxdist-request@pengutronix.de
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> Diehl Connectivity Solutions GmbH
> Geschäftsführung: Horst Leonberger
> Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
> Nürnberg: HRB 32315
> 
> ________________________________
> 
> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
> Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
> 
> - Informationen zum Datenschutz, insbesondere zu Ihren Rechten, erhalten Sie unter:
> 
> https://www.diehl.com/group/de/transparenz-und-informationspflichten/
> 
> The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
> mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.
> 
> - For general information on data protection and your respective rights please visit:
> 
> https://www.diehl.com/group/en/transparency-and-information-obligations/
> 
> 


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

  reply	other threads:[~2021-07-21 17:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 13:34 Christian Melki
2021-05-21 10:40 ` Michael Olbrich
2021-05-21 10:52   ` Christian Melki
2021-05-21 11:03     ` Christian Melki
2021-07-21 16:30       ` Denis Osterland-Heim
2021-07-21 17:54         ` Christian Melki [this message]
2021-07-22  6:46           ` m.olbrich
2021-07-22  8:07             ` Denis Osterland-Heim
2021-07-22 16:41               ` Christian Melki
2021-07-23  9:17                 ` Denis Osterland-Heim
2021-07-23  9:24                 ` m.olbrich
2021-05-27  6:45 ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebfd093c-30f3-3cf2-19a1-1b0904e07818@t2data.com \
    --to=christian.melki@t2data.com \
    --cc=denis.osterland@diehl.com \
    --cc=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox