unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* `guix install protobuf:static` headers?
@ 2019-10-31 15:52 zimoun
  2019-11-03 17:19 ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: zimoun @ 2019-10-31 15:52 UTC (permalink / raw)
  To: help-guix

Dear,

When I run `guix install protobuf:static -p path/to/profile` then I
expect that the headers are in "path/to/profile" but they are not.
However, they appear without the ":static" flag.

I am confused.

Moreover, the static libraries are even copied without the flag ":static".

--8<---------------cut here---------------start------------->8---
         (add-after 'install 'move-static-libraries
           (lambda* (#:key outputs #:allow-other-keys)
             ;; Move static libraries to the "static" output.
             (let* ((out    (assoc-ref outputs "out"))
                    (lib    (string-append out "/lib"))
                    (static (assoc-ref outputs "static"))
                    (slib   (string-append static "/lib")))
               (mkdir-p slib)
               (for-each (lambda (file)
                           (install-file file slib)
                           (delete-file file))
                         (find-files lib "\\.a$"))
--8<---------------cut here---------------end--------------->8---


What should be the correct behaviour of "out" vs "static"?


All the best,
simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `guix install protobuf:static` headers?
  2019-10-31 15:52 `guix install protobuf:static` headers? zimoun
@ 2019-11-03 17:19 ` Marius Bakke
  2019-11-04 15:34   ` zimoun
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2019-11-03 17:19 UTC (permalink / raw)
  To: zimoun, help-guix

[-- Attachment #1: Type: text/plain, Size: 1438 bytes --]

zimoun <zimon.toutoune@gmail.com> writes:

> Dear,
>
> When I run `guix install protobuf:static -p path/to/profile` then I
> expect that the headers are in "path/to/profile" but they are not.
> However, they appear without the ":static" flag.
>
> I am confused.
>
> Moreover, the static libraries are even copied without the flag ":static".
>
> --8<---------------cut here---------------start------------->8---
>          (add-after 'install 'move-static-libraries
>            (lambda* (#:key outputs #:allow-other-keys)
>              ;; Move static libraries to the "static" output.
>              (let* ((out    (assoc-ref outputs "out"))
>                     (lib    (string-append out "/lib"))
>                     (static (assoc-ref outputs "static"))
>                     (slib   (string-append static "/lib")))
>                (mkdir-p slib)
>                (for-each (lambda (file)
>                            (install-file file slib)
>                            (delete-file file))
>                          (find-files lib "\\.a$"))
> --8<---------------cut here---------------end--------------->8---
>
>
> What should be the correct behaviour of "out" vs "static"?

'static' outputs typically contain *only* the .a libraries, as you
found.  If you want the headers, you need to add protobuf:out too.

I think there were proposals to start using a 'dev' output for headers
and such, but don't know if it got anywhere.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `guix install protobuf:static` headers?
  2019-11-03 17:19 ` Marius Bakke
@ 2019-11-04 15:34   ` zimoun
  2019-11-15 18:50     ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: zimoun @ 2019-11-04 15:34 UTC (permalink / raw)
  To: Marius Bakke; +Cc: help-guix

Hi,

Thank you for the explanations.


On Sun, 3 Nov 2019 at 18:19, Marius Bakke <mbakke@fastmail.com> wrote:
>
> zimoun <zimon.toutoune@gmail.com> writes:

> > What should be the correct behaviour of "out" vs "static"?
>
> 'static' outputs typically contain *only* the .a libraries, as you
> found.  If you want the headers, you need to add protobuf:out too.


I am still confused.

--8<---------------cut here---------------start------------->8---
 $ guix install protobuf@2.6 -p /tmp/proto
 $ ls /tmp/proto/include/google/protobuf/
--8<---------------cut here---------------start------------->8---

And 22 files live there. Headers found. :-)


However, is it expected that LIBRARY_PATH is not set?

--8<---------------cut here---------------start------------->8---
 $ cat /tmp/proto/etc/profile
# Source this file to define all the relevant environment variables in Bash
# for this profile.  You may want to define the 'GUIX_PROFILE' environment
# variable to point to the "visible" name of the profile, like this:
#
#  GUIX_PROFILE=/path/to/profile ; \
#  source /path/to/profile/etc/profile
#
# When GUIX_PROFILE is undefined, the various environment variables refer
# to this specific profile generation.

export PATH="${GUIX_PROFILE:-/gnu/store/m26p44mxy4k79gzy18nq2nivygrdmkm5-profile}/bin${PATH:+:}$PATH"
--8<---------------cut here---------------end--------------->8---


> I think there were proposals to start using a 'dev' output for headers
> and such, but don't know if it got anywhere.

Moreover, the static libraries are also installed with simply
"protobuf@2.6.0:out".


I have tried to adapt the definition of protobuf adding a "lib" flag.
But it fails with "cycle detected in the references of". Roptat
explained on IRC how to track the issue and before investigating some
time, I would like to be sure to well understand. :-)


Thank you,.

All the best,
simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `guix install protobuf:static` headers?
  2019-11-04 15:34   ` zimoun
@ 2019-11-15 18:50     ` Marius Bakke
  2019-11-18 10:14       ` zimoun
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2019-11-15 18:50 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1698 bytes --]

zimoun <zimon.toutoune@gmail.com> writes:

> However, is it expected that LIBRARY_PATH is not set?
>
> --8<---------------cut here---------------start------------->8---
>  $ cat /tmp/proto/etc/profile
> # Source this file to define all the relevant environment variables in Bash
> # for this profile.  You may want to define the 'GUIX_PROFILE' environment
> # variable to point to the "visible" name of the profile, like this:
> #
> #  GUIX_PROFILE=/path/to/profile ; \
> #  source /path/to/profile/etc/profile
> #
> # When GUIX_PROFILE is undefined, the various environment variables refer
> # to this specific profile generation.
>
> export PATH="${GUIX_PROFILE:-/gnu/store/m26p44mxy4k79gzy18nq2nivygrdmkm5-profile}/bin${PATH:+:}$PATH"
> --8<---------------cut here---------------end--------------->8---

LIBRARY_PATH is only set if you include 'gcc' or 'gcc-toolchain' in the
profile, and is generally only needed if you want to compile something.

>> I think there were proposals to start using a 'dev' output for headers
>> and such, but don't know if it got anywhere.
>
> Moreover, the static libraries are also installed with simply
> "protobuf@2.6.0:out".

I can't find a protobuf@2.6.0 package, but at least for 2.6.1 there are
no .a files in the default output.

> I have tried to adapt the definition of protobuf adding a "lib" flag.
> But it fails with "cycle detected in the references of". Roptat
> explained on IRC how to track the issue and before investigating some
> time, I would like to be sure to well understand. :-)

The cyclic reference means something in the lib output references "out".
To find out which, try grepping for the store hash of the "out" output.

HTH,
Marius

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: `guix install protobuf:static` headers?
  2019-11-15 18:50     ` Marius Bakke
@ 2019-11-18 10:14       ` zimoun
  0 siblings, 0 replies; 5+ messages in thread
From: zimoun @ 2019-11-18 10:14 UTC (permalink / raw)
  To: Marius Bakke; +Cc: help-guix

Hi Marius,

Thank you for the explanations. It helps.

On Fri, 15 Nov 2019 at 19:50, Marius Bakke <mbakke@fastmail.com> wrote:

> LIBRARY_PATH is only set if you include 'gcc' or 'gcc-toolchain' in the
> profile, and is generally only needed if you want to compile something.

It is still not fully clear to me. :-)
I need to experiment myself... I will re-hash your explanations, the
ones of roptat and nckx on IRC.


> >> I think there were proposals to start using a 'dev' output for headers
> >> and such, but don't know if it got anywhere.
> >
> > Moreover, the static libraries are also installed with simply
> > "protobuf@2.6.0:out".
>
> I can't find a protobuf@2.6.0 package, but at least for 2.6.1 there are
> no .a files in the default output.

My bad!

I finally found how to do. See the patch here [1].

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37988#47

> > I have tried to adapt the definition of protobuf adding a "lib" flag.
> > But it fails with "cycle detected in the references of". Roptat
> > explained on IRC how to track the issue and before investigating some
> > time, I would like to be sure to well understand. :-)
>
> The cyclic reference means something in the lib output references "out".
> To find out which, try grepping for the store hash of the "out" output.

I will try again. But because I managed to patch [1], it is now not a
priority for me. :-)


All the best,
simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-18 10:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-31 15:52 `guix install protobuf:static` headers? zimoun
2019-11-03 17:19 ` Marius Bakke
2019-11-04 15:34   ` zimoun
2019-11-15 18:50     ` Marius Bakke
2019-11-18 10:14       ` zimoun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).