Re: How I got stuck (and ways to resolve)

2019-01-05 Thread Ludovic Courtès
Hello!

Laura Lazzati  skribis:

> Thank you both for sharing your experience :)

+1!

I’m late to the party but I think your message was certainly insightful
to many of us.  Even with years of experience one is never done learning
new tricks!

Thanks,
Ludo’.



Re: How I got stuck (and ways to resolve)

2018-12-24 Thread Laura Lazzati
Thank you both for sharing your experience :)

I agree with most of your approaches, maybe I do it more rudimentary
(like writing down in paper - at least the TODO's and keeping my daily
journal in a plain sheet)

But thank you again :)

Regards!
Laura



Re: How I got stuck (and ways to resolve)

2018-12-23 Thread Gábor Boskovits
Hello,

Björn Höfling  ezt írta (időpont:
2018. dec. 20., Cs, 16:03):
>
> Hi Guix,
>
> the task for mentors in this Outreachy week #3 is to give an
> example of how one got stuck in a problem, and show ways to go on and
> finally succeed with your problem.
>

Thanks for taking the initiative here!

> So, I write a bit about my problems and encourage everyone else to tell
> their story of small or big stucks.
>
> Our intern in this round is doing video documentation, so her tasks are
> a bit different than "normal" contributions, anyway I will report about
> packaging problems as this is what I mostly did for Guix and where I
> really got stuck and I think everyone of us gets stuck quickly with
> this.
>

Yes, you are most probably right I also often get stuck in packaging.
Most of the time I have the feeling I know about nothing when I
encounter some software that is radically new to me. Go packages
were on such example.

> When packaging a new software for Guix, I start with documenting the
> process: I create a new MarkDown file (I will be very sloppy with the
> syntax), write the date and package I want to pack and start. Mostly,
> this is "write-only": I just write down my activity, my problems and
> the solution. I rarely read that again. But it helps me structure the
> task and continue on when I put it aside for a while.
>

I have something similar to that, I usually have an org file for that,
so that I can organize my tasks as a todo list. I also have a template
where I have items that need to be done every time, like:
- check for bundled software
- check for reproducibility problems using --rounds=2 or similar
- run guix lint
, just to name a few.

> In general, my problem is that I know nothing (or: always too little)
> about makefiles, about C and C++, about CMake, Python, Qt, Ruby, and
> all the rest: I'm a Java expert and I know nothing about all these
> "strange" languages and their "brainfucked" error messages.
>

I am quite into C++, I like it very much, but some error messages can be
real cryptic. When some template related stuff surfaces from deep inside
a template metaprogramming library, that is really bad.

I am packaging OpenJDK11 now, and it took me for a while (at least a few hours)
to realize why I could not unbundle libpng. I had to look at the code
of the build system,
find the check, snd then realized that it uses pkg-config, which I failed
to provide as input. After that everything worked fine.

> So, one of the first "solutions" is to keep calm and read the error
> message. Read it again. Try to parse it. What is the problem? From which
> program/compiler/tool did it came? From which dependency? Is really
> THIS the problem, or is it caused by something ELSE somewhere above? In
> which build phase did it occur (configure, compile, test, ...)?
>
> Let's dig into one from opencv, don't look too much into the details
> of the error message:
>
> ---8<---unaltered-citation::start--8<---
>
> [...]
>
> Now it compiles.
>
> But then I stumble over a nasty build error:
>
> ```
> cd /tmp/guix-build-opencv-3.4.0.drv-0/build/modules/video && 
> /gnu/store/5sv5zy2k
> gg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/c++   -DCVAPI_EXPORTS 
> -D_USE_MATH_DEFINES
>  -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
> -D__STDC_LIM
> IT_MACROS -I/tmp/guix-build-opencv-3.4.0.drv-0/build 
> -I/tmp/guix-build-opencv-3.
> 4.0.drv-0/opencv-3.4.0/modules/video/include 
> -I/tmp/guix-build-opencv-3.4.0.drv-
> 0/opencv-3.4.0/modules/video/src 
> -I/tmp/guix-build-opencv-3.4.0.drv-0/build/modu
> les/video 
> -I/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/core/include
>  -I/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgproc/include  
> -fsi
> gned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor 
> -Werror=address
> -Werror=sequence-point -Wformat -Werror=format-security 
> -Wmissing-declarations -
> Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized 
> -Winit-
> self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment 
> -fdiagnostics-show
> -option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections 
> -fdata-
> sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden 
> -O
> 2 -g -DNDEBUG -fPIC-Winvalid-pch  -include 
> "/tmp/guix-build-opencv-3.4.0.drv
> -0/build/modules/video/precomp.hpp" -o 
> CMakeFiles/opencv_video.dir/src/ecc.cpp.o
>  -c /tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/video/src/ecc.cpp
> In file included from 
> /tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgcodecs/src/grfmt_exr.hpp:52:0,
>  from 
> /tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgcodecs/src/grfmts.hpp:53,
>  from 
> /tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgcodecs/src/loadsave.cpp:47:
> /gnu/store/kikj95f44ygrp3fapd1yybykxl167i0l-openexr-2.2.1/include/OpenEXR/ImfChromaticities.h:46:22:
>  fatal error: 

How I got stuck (and ways to resolve)

2018-12-20 Thread Björn Höfling
Hi Guix,

the task for mentors in this Outreachy week #3 is to give an
example of how one got stuck in a problem, and show ways to go on and
finally succeed with your problem.

So, I write a bit about my problems and encourage everyone else to tell
their story of small or big stucks. 

Our intern in this round is doing video documentation, so her tasks are
a bit different than "normal" contributions, anyway I will report about
packaging problems as this is what I mostly did for Guix and where I
really got stuck and I think everyone of us gets stuck quickly with
this.

When packaging a new software for Guix, I start with documenting the
process: I create a new MarkDown file (I will be very sloppy with the
syntax), write the date and package I want to pack and start. Mostly,
this is "write-only": I just write down my activity, my problems and
the solution. I rarely read that again. But it helps me structure the
task and continue on when I put it aside for a while.

In general, my problem is that I know nothing (or: always too little)
about makefiles, about C and C++, about CMake, Python, Qt, Ruby, and
all the rest: I'm a Java expert and I know nothing about all these
"strange" languages and their "brainfucked" error messages.

So, one of the first "solutions" is to keep calm and read the error
message. Read it again. Try to parse it. What is the problem? From which
program/compiler/tool did it came? From which dependency? Is really
THIS the problem, or is it caused by something ELSE somewhere above? In
which build phase did it occur (configure, compile, test, ...)?

Let's dig into one from opencv, don't look too much into the details
of the error message:

---8<---unaltered-citation::start--8<---

[...]

Now it compiles.

But then I stumble over a nasty build error:

```
cd /tmp/guix-build-opencv-3.4.0.drv-0/build/modules/video && /gnu/store/5sv5zy2k
gg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/c++   -DCVAPI_EXPORTS -D_USE_MATH_DEFINES
 -D__OPENCV_BUILD=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIM
IT_MACROS -I/tmp/guix-build-opencv-3.4.0.drv-0/build -I/tmp/guix-build-opencv-3.
4.0.drv-0/opencv-3.4.0/modules/video/include -I/tmp/guix-build-opencv-3.4.0.drv-
0/opencv-3.4.0/modules/video/src -I/tmp/guix-build-opencv-3.4.0.drv-0/build/modu
les/video -I/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/core/include
 -I/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgproc/include  -fsi
gned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address 
-Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -
Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-
self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show
-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-
sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O
2 -g -DNDEBUG -fPIC-Winvalid-pch  -include "/tmp/guix-build-opencv-3.4.0.drv
-0/build/modules/video/precomp.hpp" -o CMakeFiles/opencv_video.dir/src/ecc.cpp.o
 -c /tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/video/src/ecc.cpp
In file included from 
/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgcodecs/src/grfmt_exr.hpp:52:0,
 from 
/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgcodecs/src/grfmts.hpp:53,
 from 
/tmp/guix-build-opencv-3.4.0.drv-0/opencv-3.4.0/modules/imgcodecs/src/loadsave.cpp:47:
/gnu/store/kikj95f44ygrp3fapd1yybykxl167i0l-openexr-2.2.1/include/OpenEXR/ImfChromaticities.h:46:22:
 fatal error: ImathVec.h: No such file or directory
compilation terminated.
make[2]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/build.make:66: 
modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/src/loadsave.cpp.o] Error 1
make[2]: Leaving directory '/tmp/guix-build-opencv-3.4.0.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:4057: 
modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs

```

Bug reports maybe related:

* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865862
* https://github.com/ampas/CTL/issues/15

But somehow not.

While I was executing `find /gnu/store -name ImathVec.h`, I had that idea: Look 
again at the
Guix definition of *openexv*. And yes: There is also that package `ilmbase`.
And here we go:

```
./6knqzzds4fp6y4qrzyg2ppx6qmiil7jr-ilmbase-2.2.1/include/OpenEXR/ImathVec.h
```

So, let's add that to the inputs, too!

Failed again. Would habe been too nice to work.

I found something in graphics.scm: blender has also a workaround for it:

```
   #:phases
   (modify-phases %standard-phases
 (add-after 'set-paths 'add-ilmbase-include-path
   (lambda* (#:key inputs #:allow-other-keys)
 ;; OpenEXR propagates ilmbase, but its include files do not appear
 ;; in the CPATH, so we need to add