Re: contributing

[email protected]
Newsgroups gmane.network.gnunet.devel
Message-ID <[email protected]>
Hmm, the format-patch command does not preserve signatures.

Anyway, here is a patch for my workaround to be able to build and run
gnunet extension when installing in a non-standard path. Without this,
the extension would derive the config path from the location of the
binary ($PREFIX/lib/gnunet/libexec).

Also, a slight edit in test to make make check work again.



On Tue, Oct 25, 2022 at 07:27:45PM +0100, madmurphy wrote:
> On Tue, Oct 25, 2022 at 6:28 PM <[email protected]> wrote:
> 
> I would like to send some code amendments to the gnunet-ext repo. What are
> the necessary steps, please?
> 
> The easieast way:
> 
> git clone https://git.gnunet.org/gnunet-ext.git
> cd gnunet-ext
> 
> Edit whatever you want to edit in the gnunet-ext directory, then launch the
> following commands (feel free to change the message as it best suits you):
> 
> git add --all
> git commit -m 'Write your message here'
> git format-patch -1
> 
> Finally, send the 0001-Write-your-message-here.patch file generated to this
> mailing list (the actual name will change according to your message).
> 
> --madmurphy
> 
> On Tue, Oct 25, 2022 at 6:28 PM <[email protected]> wrote:
> 
> > Hello,
> >
> > there's still TODO wtr link to copyright waiver for contributing in the
> > docs:
> >
> >
> > file:///home/lash/src/build/gnunet/0.17.6-198-g1436e4266/doc/handbook/html/developers/contributing.html
> >
> > I would like to send some code amendments to the gnunet-ext repo. What
> > are the necessary steps, please?
> >
> > Thanks,
> > l
> >
0001-Rehabilitate-test-and-non-standard-build-location.patch (text/plain, 3.6 KB)
From d1c791afbd58a96adeb711cfea386d4bee9ac3db Mon Sep 17 00:00:00 2001
From: lash <[email protected]>
Date: Sun, 23 Oct 2022 12:57:57 +0100
Subject: [PATCH] Rehabilitate test and non-standard build location

- Correct arguments and headers in test
- Use libgnunetext library to correctly resolve configuration path when
  installing in a non-standard location

Signed-off-by: lash <[email protected]>
---
 m4/.gitignore                | 6 ++++++
 src/ext/Makefile.am          | 4 ++--
 src/ext/ext.conf.in          | 1 -
 src/ext/gnunet-ext.c         | 2 +-
 src/ext/gnunet-service-ext.c | 2 +-
 src/ext/test_ext_api.c       | 5 +++--
 6 files changed, 13 insertions(+), 7 deletions(-)
 create mode 100644 m4/.gitignore

diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..c4c8d29
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,6 @@
+libtool.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+lt~obsolete.m4
+wchar_t.m4
diff --git a/src/ext/Makefile.am b/src/ext/Makefile.am
index 1f3fa1e..0180c1d 100644
--- a/src/ext/Makefile.am
+++ b/src/ext/Makefile.am
@@ -40,7 +40,7 @@ TESTS = $(check_PROGRAMS)
 gnunet_service_ext_SOURCES = \
   gnunet-service-ext.c
 gnunet_service_ext_LDADD = \
-  -lgnunetutil -lgnunetcore -lgnunetdht\
+  -lgnunetutil -lgnunetcore -lgnunetdht -lgnunetext \
   $(INTLLIBS)
 gnunet_service_ext_LDFLAGS = \
   $(GNUNET_LDFLAGS)  $(WINFLAGS) -export-dynamic
@@ -48,7 +48,7 @@ gnunet_service_ext_LDFLAGS = \
 gnunet_ext_SOURCES = \
   gnunet-ext.c
 gnunet_ext_LDADD = \
-  -lgnunetutil \
+  -lgnunetutil -lgnunetext \
   $(INTLLIBS)
 gnunet_ext_LDFLAGS = \
  $(GNUNET_LDFLAGS) $(WINFLAGS) -export-dynamic
diff --git a/src/ext/ext.conf.in b/src/ext/ext.conf.in
index 01a6f54..fb0138c 100644
--- a/src/ext/ext.conf.in
+++ b/src/ext/ext.conf.in
@@ -3,4 +3,3 @@ BINARY = gnunet-service-ext
 UNIXPATH = /tmp/gnunet-service-ext.sock
 HOME = $SERVICEHOME
 # PORT = 2500
-@UNIXONLY@ PORT = 2500
diff --git a/src/ext/gnunet-ext.c b/src/ext/gnunet-ext.c
index 2b91276..b4d19f3 100644
--- a/src/ext/gnunet-ext.c
+++ b/src/ext/gnunet-ext.c
@@ -42,7 +42,7 @@ static int ret;
 static const struct GNUNET_OS_ProjectData gnunetext_pd =
   {
    .libname = "libgnunetext",
-   .project_dirname = "gnunet-ext",
+   .project_dirname = "gnunet",
    .binary_name = "gnunet-ext",
    .env_varname = "GNUNET_EXT_PREFIX",
    .base_config_varname = "GNUNET_EXT_BASE_CONFIG",
diff --git a/src/ext/gnunet-service-ext.c b/src/ext/gnunet-service-ext.c
index 6399389..f366d4c 100644
--- a/src/ext/gnunet-service-ext.c
+++ b/src/ext/gnunet-service-ext.c
@@ -65,7 +65,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
  */
 static const struct GNUNET_OS_ProjectData gnunetext_pd = {
   .libname = "libgnunetext",
-  .project_dirname = "gnunet-ext",
+  .project_dirname = "gnunet",
   .binary_name = "gnunet-service-ext",
   .env_varname = "GNUNET_EXT_PREFIX",
   .base_config_varname = "GNUNET_EXT_BASE_CONFIG",
diff --git a/src/ext/test_ext_api.c b/src/ext/test_ext_api.c
index ab6a8d3..7306dcd 100644
--- a/src/ext/test_ext_api.c
+++ b/src/ext/test_ext_api.c
@@ -23,6 +23,8 @@
  */
 #include "gnunet_ext_config.h"
 #include <stddef.h>
+#include <errno.h>
+#include <signal.h>
 
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
@@ -89,8 +91,7 @@ main (int argc,
              "gnunet-service-ext");
     return 77;
   }
-  proc = GNUNET_OS_start_process (GNUNET_NO,
-                                  GNUNET_OS_INHERIT_STD_ALL,
+  proc = GNUNET_OS_start_process (GNUNET_NO | GNUNET_OS_INHERIT_STD_ALL,
                                   NULL,
                                   NULL,
                                   NULL,
-- 
2.38.0
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEEWahEpISsESU9Oj6dzcvSTdHQ4AEFAmNioUcACgkQzcvSTdHQ
4AFuZAf/UlCRBDWYjrmy4yadvxn+MLvERi4B6CbgdG+cVSDwCzfl0I0wMKr/v38q
g5gZ+aH3i0CxMKKjj+Gs1giuMwNFbwyQ4vocJmYuj4oGtEDxaDUgdnZMbbSNVhi4
uHpPpcC3S9zOT41A11YIi2/RsMJ7Lg6vimETkHfgT3lqiVfrhyK2nmOlQSKHI1qz
JRpdhPWdM7lcz7dK6ahyAdSYPkEl5oKoRvEWhjO6Pd3uqksP+W5xlEsAt62pSxjc
AoNmtiQhJH05XE2Hlt5Q1SF+eCv5A/qbUYivig6/bsi7xyNAJ8HsP0djYu7Y1Sc/
3CTGW/4PAde7HdWaEF0QYe1m1AzHSw==
=fJAc
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.