`guix install protobuf:static` headers?

2019-10-31 Thread zimoun
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



Re: `guix install protobuf:static` headers?

2019-11-03 Thread Marius Bakke
zimoun  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.


signature.asc
Description: PGP signature


Re: `guix install protobuf:static` headers?

2019-11-04 Thread zimoun
Hi,

Thank you for the explanations.


On Sun, 3 Nov 2019 at 18:19, Marius Bakke  wrote:
>
> zimoun  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



Re: `guix install protobuf:static` headers?

2019-11-15 Thread Marius Bakke
zimoun  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


signature.asc
Description: PGP signature


Re: `guix install protobuf:static` headers?

2019-11-18 Thread zimoun
Hi Marius,

Thank you for the explanations. It helps.

On Fri, 15 Nov 2019 at 19:50, Marius Bakke  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