From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 12 06:21:55 2023 Received: (at 60640) by debbugs.gnu.org; 12 Jan 2023 11:21:55 +0000 Received: from localhost ([127.0.0.1]:44854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFvec-0003jr-HX for submit@debbugs.gnu.org; Thu, 12 Jan 2023 06:21:55 -0500 Received: from mail-ej1-f42.google.com ([209.85.218.42]:35510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFveZ-0003jf-SN for 60640@debbugs.gnu.org; Thu, 12 Jan 2023 06:21:53 -0500 Received: by mail-ej1-f42.google.com with SMTP id vm8so43945315ejc.2 for <60640@debbugs.gnu.org>; Thu, 12 Jan 2023 03:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DY7lg7sFHgdNRBIZpobFwvRYagZTwu7DDSo2lPBVmJE=; b=ZigLOcYqbk6uCYG6knvT0po+m/G7fACthORM4ALEiub4H3An35nDUiNWxPArkiKIej UN2p3xIn1U6RUd+viYbV9DS6FhujGgESWE+/2sbIKizhi87Po7LE1VtUBvhijkbPCfev Zaa9+yaINIHZ8HidErSZtxOGBzjACeIMNw4myYyu3iJhhqiwJd/jmrr85H2Zto9U1F02 /vf2ZhaO25azz3lVlkTqHXaKzk3PP0ASDL7SEFAgyQWraeOUFWE4Qlr5RuDFJOceQ8Th DkzF6Yaqu+dMm1AuiQj9dLXpS2BIN+i2Tj1FdX1PAeZYrclHHoM4nvEURM9QAj3YQfsP vp/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DY7lg7sFHgdNRBIZpobFwvRYagZTwu7DDSo2lPBVmJE=; b=PYLnmEDzR53L4V7sbqtKbQzN+9viguyGuqRIwLe898m4hoDdkRknsZvIkD/XTWqm1s lQPjghzp3N6kzTNs/7i2IKSIvIDX/8LQAbxOG/zWRLohjOBd2UfVvGUU46hwj0li1g4p LxsazC8dMbHiXMysG2LS/GbrNeF/zS8pyoINfZ4vOX7EuK2CDrx2gP138tR33/auMeMZ 8SkKmSwuXjp957sttouKCDwrtteTCWAqsq3twYMwrEA/YNHWIzvPfyRBIkhIqYV3ogxA DqexQ93nrXZOgAIe39X0Amqv5F+nOPkESxzJdN2HbWg4//2RegH+YGuYo/OWdVI72F7F 0Bxw== X-Gm-Message-State: AFqh2kocb5q3yNxXLUHzPR+wnqQtkVYlOEs/8FNoxOT7J+ph+JR3YjUY Q6mvUM+Y1UCEmV0x3GtTV9SK91eQgA+f9bWoTtI= X-Google-Smtp-Source: AMrXdXucpgDogkG1Lanr7LB8v0TQXTTBQOzQJJfSMkqAoKMNyXH+Lrc62KYV0xEeMghpowJLHuP5iHoVxua3oeAzet4= X-Received: by 2002:a17:906:d051:b0:7c0:fd1a:6792 with SMTP id bo17-20020a170906d05100b007c0fd1a6792mr4732971ejb.431.1673522505870; Thu, 12 Jan 2023 03:21:45 -0800 (PST) MIME-Version: 1.0 References: <877cxyp1wf.fsf@gmail.com> <87y1qaxhh7.fsf@nckx> <87o7r5li2j.fsf@gmail.com> In-Reply-To: <87o7r5li2j.fsf@gmail.com> From: =?UTF-8?Q?Tor=2Dbj=C3=B6rn_Claesson?= Date: Thu, 12 Jan 2023 13:21:34 +0200 Message-ID: Subject: Re: [bug#60640] Gnu: Add gdcm To: Tobias Geerinckx-Rice Content-Type: multipart/alternative; boundary="0000000000007c70fa05f20f52fe" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60640 Cc: 60640@debbugs.gnu.org, guix-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000007c70fa05f20f52fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi again! Your patch applies perfectly, the error was on my side. Also, a gdcm package was added to the bioinformatics module 4 days ago=3D) = It packages an older version (2.8.9) but is much more concise than my attempt. Would it be worthwhile to continue work on this package as perhaps gdcm-3.0 and move it to bioinformatics? I put it in image-processing since dcmtk was already there. Best regards Den ons 11 jan. 2023 kl 08:08 skrev Tor-bj=C3=B6rn Claesson : > > Hi! > > Tobias Geerinckx-Rice writes: > > > >> 3. It does not perform tests. > > > > OK, I'll take a look. > > > > If tests are disabled, the reason should always be noted in a comment. > > Even if it's just =E2=80=98; no test suite=E2=80=99. > > > > #:tests? #t makes the build fail with "make: *** No rule to make target > 'test'. Stop." > > GDCM has nightly regression tests > (https://open.cdash.org/index.php?project=3DGDCM), should we try to run > those when building? I have tried to find out how to do this but for now > with no success. Maybe it is obvious to more experienced people? > > >> +(define-public gdcm > > > > It used to be common to unconditionally add packages to the end of > > files, but this needlessly increased the risk of merge conflicts. > > > > Instead, just add them wherever they first fit alphabetically; here, I > > put it above =E2=80=98mia=E2=80=99. > > > > Ok, will do from now on! > > >> + (version "3.0.20") > > > > =E2=80=98guix lint=E2=80=99 says this can be updated to 3.1.0 but I did= n't try, as I'd > > rather it be tested by an actual user =E2=80=94 i.e., you. > > > > I got that too, but the latest release in git is 3.0.20 > > >> + "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i")))) > >> + (build-system cmake-build-system) > >> + (outputs '("out" "doc")) > > > > /share/doc wasn't actually installed into "doc", but to "out", so I > > set the GDCM_INSTALL_DOC_DIR configure flag. > > > >> + (arguments > >> + (list #:tests? #f > >> + #:phases #~(modify-phases %standard-phases > >> + (add-before 'configure 'set-LDFLAGS > >> + (lambda* (#:key inputs outputs > >> #:allow-other-keys) > >> + (setenv "LDFLAGS" > >> + (string-append "-Wl,-rpath=3D" > >> + #$output > >> "/lib")))) > >> + (add-before 'build 'patch-gdcm-charls.h > >> + (lambda _ > >> + (substitute* > >> "../source/Utilities/gdcm_charls.h" > >> + (("# include ") > > Ah, good catch! > > > > > Purely as a matter of taste I dropped the =E2=80=98# include =E2=80=99 = from both > > strings and escaped the =E2=80=98.=E2=80=99 in the regexp. > > > >> + "# include ")) > >> #t))) > > > > =E2=80=98#t=E2=80=99 endings are also obsolete. Just drop them entirel= y. Phases can > > now safely return anything, including nothing or undefined. > > > > I added the following phase to work around log spam, since I didn't > > find its source (nor did I look very hard) [edit: it was indeed > > graphviz, thanks]. By default, $HOME is not writable in the build > > environment. > > > > (add-before 'build 'set-HOME > > ;; The build spams =E2=80=98Fontconfig error: No writable cache > > ;; directories=E2=80=99 in a seemingly endless loop otherwise. > > (lambda _ > > (setenv "HOME" "/tmp"))) > > > >> + #:configure-flags #~(list "-DCMAKE_SKIP_RPATH:BOOL=3DYES" > > Is this needed, btw? It came from gdcm:s packaging > instructions. Removing it causes no verify-runpath issues. > > > > > I, opinionated, added newlines after #:phases and #:configure-flags. > > > > Some people like the =E2=80=98extreme indentation=E2=80=99 you get by t= hrowing away > > half of your screen width. I find it leads to cramped code and noisy > > patches once the phases need to get actual work done or an even longer > > CMAKE_ flag comes along. > > > > I also added some newlines and tried to group related flags. > > > > Thanks, I didn't know that would make the line fit better on > screen. Much neater=3D) > > >> + "-DCMAKE_C_FLAGS=3D-fvisibility=3Dhidden" > >> + "-DCMAKE_CXX_FLAGS=3D-fvisibility=3Dhidden" > > > > Should these be explained in a very brief comment? > > > > They are from https://github.com/malaterre/GDCM/blob/master/PACKAGER, > the explanation is: > "This make sure that on UNIX, the API is actually identical at what is > found on Windows." > > > > > Thank you for building with system libraries! Also remove the bundled > > copies when possible. I did so in a (rather strict) source snippet. > > > > Ok, neat=3D) > > >> + "-DGDCM_PDF_DOCUMENTATION:BOOL=3DOFF" > > > > I cannot get the man pages to build, either. They need something > > called =E2=80=98xsl-ns=E2=80=99. I've disabled GDCM_BUILD_DOCBOOK_MANP= AGES for now. > > > >> + "-DGCM_BUILD_TESTING:BOOL=3DOFF" > > > > Why is this set? It's reported by CMake as having no effect, and a > > diff of the output confirms that. > > > > From the old wiki: > > "This boolean is responsible for deciding whether or not to build/run the > nightly regression test of gdcm. Warning when turning this option on, > the size of the gdcm libraries will be bigger since some extra code are > compiled in for the testing framework (see gdcm::Testing, and the md5 > lib)." > > This seems to be incorrect then, maybe we can skip it. > > >> + (license license:bsd-3))) > > > > I still need to check this. > > > > https://github.com/malaterre/GDCM/blob/master/Copyright.txt > > I'm not able to apply your new patch, but that is probably a fault on my > part. > > Thanks a lot for sharing your time and knowledge, and for making this > patch neater! I find this a lot of fun, but have no experience > with scheme or packaging, so your explanations are very valuable to me. > > Cheers > Tor-bj=C3=B6rn > --0000000000007c70fa05f20f52fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi again!

Your patch applies= perfectly, the error was on my side.

Also, a gdcm= package was added to the bioinformatics module 4 days ago=3D) It packages = an older version (2.8.9) but is much more concise than my attempt. Would it= be worthwhile to continue work on this package as perhaps gdcm-3.0 and mov= e it to bioinformatics? I put it in image-processing since dcmtk was alread= y there.

Best regards

Den ons 11 jan. 202= 3 kl 08:08 skrev Tor-bj=C3=B6rn Claesson <tclaesson@gmail.com>:

Hi!

Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
>> 3. It does not perform tests.
>
> OK, I'll take a look.
>
> If tests are disabled, the reason should always be noted in a comment.=
> Even if it's just =E2=80=98; no test suite=E2=80=99.
>

#:tests? #t makes the build fail with "make: *** No rule to make targe= t
=C2=A0'test'.=C2=A0 Stop."

GDCM has nightly regression tests
(https://open.cdash.org/index.php?project=3DGDCM)= , should we try to run
those when building? I have tried to find out how to do this but for now with no success. Maybe it is obvious to more experienced people?

>> +(define-public gdcm
>
> It used to be common to unconditionally add packages to the end of
> files, but this needlessly increased the risk of merge conflicts.
>
> Instead, just add them wherever they first fit alphabetically; here, I=
> put it above =E2=80=98mia=E2=80=99.
>

Ok, will do from now on!

>> +=C2=A0 =C2=A0 (version "3.0.20")
>
> =E2=80=98guix lint=E2=80=99 says this can be updated to 3.1.0 but I di= dn't try, as I'd
> rather it be tested by an actual user =E2=80=94 i.e., you.
>

I got that too, but the latest release in git is 3.0.20

>> + "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"= ))))
>> +=C2=A0 =C2=A0 (build-system cmake-build-system)
>> +=C2=A0 =C2=A0 (outputs '("out" "doc")) >
> /share/doc wasn't actually installed into "doc", but to = "out", so I
> set the GDCM_INSTALL_DOC_DIR configure flag.
>
>> +=C2=A0 =C2=A0 (arguments
>> +=C2=A0 =C2=A0 =C2=A0(list #:tests? #f
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#:phases #~(modify-phase= s %standard-phases
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (add-before 'configure 'set-LDFLAGS
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda* (#:key inputs outputs
>> #:allow-other-keys)
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setenv "LDFLAGS"
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string-appe= nd "-Wl,-rpath=3D"
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#$output
>> "/lib"))))
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (add-before 'build 'patch-gdcm-charls.h
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda _
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (substitute*
>> "../source/Utilities/gdcm_charls.h"
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (("# include <CharLS/char= ls.h>")

Ah, good catch!

>
> Purely as a matter of taste I dropped the =E2=80=98# include =E2=80=99= from both
> strings and escaped the =E2=80=98.=E2=80=99 in the regexp.
>
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"# include <charls/= charls.h>"))
>> #t)))
>
> =E2=80=98#t=E2=80=99 endings are also obsolete.=C2=A0 Just drop them e= ntirely.=C2=A0 Phases can
> now safely return anything, including nothing or undefined.
>
> I added the following phase to work around log spam, since I didn'= t
> find its source (nor did I look very hard) [edit: it was indeed
> graphviz, thanks].=C2=A0 By default, $HOME is not writable in the buil= d
> environment.
>
>=C2=A0 (add-before 'build 'set-HOME
>=C2=A0 =C2=A0 ;; The build spams =E2=80=98Fontconfig error: No writable= cache
>=C2=A0 =C2=A0 ;; directories=E2=80=99 in a seemingly endless loop other= wise.
>=C2=A0 =C2=A0 (lambda _
>=C2=A0 =C2=A0 =C2=A0 (setenv "HOME" "/tmp")))
>
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#:configure-flags #~(lis= t "-DCMAKE_SKIP_RPATH:BOOL=3DYES"

Is this needed, btw? It came from gdcm:s packaging
instructions. Removing it causes no verify-runpath issues.

>
> I, opinionated, added newlines after #:phases and #:configure-flags. >
> Some people like the =E2=80=98extreme indentation=E2=80=99 you get by = throwing away
> half of your screen width.=C2=A0 I find it leads to cramped code and n= oisy
> patches once the phases need to get actual work done or an even longer=
> CMAKE_ flag comes along.
>
> I also added some newlines and tried to group related flags.
>

Thanks, I didn't know that would make the line fit better on
screen. Much neater=3D)

>> + "-DCMAKE_C_FLAGS=3D-fvisibility=3Dhidden"
>> + "-DCMAKE_CXX_FLAGS=3D-fvisibility=3Dhidden"
>
> Should these be explained in a very brief comment?
>

They are from https://github.com/malaterre/GDC= M/blob/master/PACKAGER,
the explanation is:
"This make sure that on UNIX, the API is actually identical at what is= found on Windows."

>
> Thank you for building with system libraries!=C2=A0 Also remove the bu= ndled
> copies when possible.=C2=A0 I did so in a (rather strict) source snipp= et.
>

Ok, neat=3D)

>> + "-DGDCM_PDF_DOCUMENTATION:BOOL=3DOFF"
>
> I cannot get the man pages to build, either.=C2=A0 They need something=
> called =E2=80=98xsl-ns=E2=80=99.=C2=A0 I've disabled GDCM_BUILD_DO= CBOOK_MANPAGES for now.
>
>> + "-DGCM_BUILD_TESTING:BOOL=3DOFF"
>
> Why is this set?=C2=A0 It's reported by CMake as having no effect,= and a
> diff of the output confirms that.
>

From the old wiki:

"This boolean is responsible for deciding whether or not to build/run = the
nightly regression test of gdcm. Warning when turning this option on,
the size of the gdcm libraries will be bigger since some extra code are
compiled in for the testing framework (see gdcm::Testing, and the md5
lib)."

This seems to be incorrect then, maybe we can skip it.

>> +=C2=A0 =C2=A0 (license license:bsd-3)))
>
> I still need to check this.
>

https://github.com/malaterre/GDCM/blob/ma= ster/Copyright.txt

I'm not able to apply your new patch, but that is probably a fault on m= y part.

Thanks a lot for sharing your time and knowledge, and for making this
patch neater! I find this a lot of fun, but have no experience
with scheme or packaging, so your explanations are very valuable to me.

Cheers
Tor-bj=C3=B6rn
--0000000000007c70fa05f20f52fe--