unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Help packaging network-manager-sstp and sstp-client
@ 2024-01-19  7:26 Lars Rustand
  2024-01-21  7:25 ` Marek Paśnikowski
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Lars Rustand @ 2024-01-19  7:26 UTC (permalink / raw)
  To: help-guix


Hello, I'm trying to package network-manager-sstp (and its dependency
sstp-client), but I'm running into a weird error. I'm sure it is a very
easy problem to solve for someone with a little more experience with the
build-system.

From what I can tell these packages should be fairly standard autotools
projects, but I have no real experience in using autotools neither in
Guix packages nor elsewhere so I don't know what I'm doing here.

I would greatly appreciate it if someone could help me take a look at
the packages and help me build them successfully.

sstp-client is failing with the following error:

--8<---------------cut here---------------start------------->8---
./autogen.sh: ./configure: /bin/sh: bad interpreter: No such file or directory
error: in phase 'bootstrap': uncaught exception:
%exception #<&invoke-error program: "./autogen.sh" arguments: () exit-status: 126 term-signal: #f stop-signal: #f>
phase `bootstrap' failed after 5.6 seconds
command "./autogen.sh" failed with status 126
--8<---------------cut here---------------end--------------->8---

Which is weird, since /bin/sh does exist, but it should also have been
told to use something else I think.


And network-manager-sstp fails with:

--8<---------------cut here---------------start------------->8---
checking for find... yes
./configure: line 13451: syntax error near unexpected token `fcntl.h'
./configure: line 13451: `      fcntl.h'
error: in phase 'configure': uncaught exception:
%exception #<&invoke-error program: "/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" arguments: ("./configure" "CONFIG_SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "--prefix=/gnu/store/rly5wz0vmbfawl7xiwdkgphsjwz8lgzm-network-manager-sstp-1.3.2" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu") exit-status: 2 term-signal: #f stop-signal: #f>
phase `configure' failed after 1.5 seconds
command "/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "./configure" "CONFIG_SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "--prefix=/gnu/store/rly5wz0vmbfawl7xiwdkgphsjwz8lgzm-network-manager-sstp-1.3.2" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" failed with status 2
--8<---------------cut here---------------end--------------->8---

I checked the configure script in question and this is how it looks at
that location:

--8<---------------cut here---------------start------------->8---
for ac_header in
      fcntl.h
      paths.h
      syslog.h
      stdarg.h
      stdbool.h
      sys/ioctl.h
      unistd.h
do :
--8<---------------cut here---------------end--------------->8---

I don't know what is causing the syntax error, maybe it is the newlines?
Anyway, if I try to build it manually instead the configure script does
not contain these lines and do not fail at this step. I think there must
be some flag that is passed to autoconf that is causing this.


My package definitions look like this:

--8<---------------cut here---------------start------------->8---
(define-public sstp-client
  (package
    (name "sstp-client")
    (version "1.0.19")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://gitlab.com/sstp-project/sstp-client")
         (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "09sh414gwbd93ql47f7yignprsgj4x0jrfbcf60pgkhfw8rxb1jc"))))
  (build-system gnu-build-system)
  (native-inputs
   (list autoconf
         automake
         gnu-gettext
         libtool
         pkg-config
         m4
         flex
         intltool
         gtk-doc
         ppp))
  (home-page "")
  (synopsis "")
  (description "")
  (license license:gpl2)))

(define-public network-manager-sstp
  (package
    (name "network-manager-sstp")
    (version "1.3.2")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://gitlab.gnome.org/GNOME/network-manager-sstp")
         (commit (string-append "release-" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1jpjqn6074lfs7mvlxs9x7ini2xcr87b4vb47kjz7am35pxgj64l"))))
  (build-system gnu-build-system)
  (native-inputs
   (list autoconf
         automake
         gnu-gettext
         libtool
         pkg-config
         m4
         flex
         bash
         intltool
         gtk-doc
         ppp))
  (home-page "")
  (synopsis "")
  (description "")
  (license license:gpl2)))
--8<---------------cut here---------------end--------------->8---


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-19  7:26 Help packaging network-manager-sstp and sstp-client Lars Rustand
@ 2024-01-21  7:25 ` Marek Paśnikowski
  2024-01-21 14:23 ` Felix Lechner via
  2024-01-23  7:23 ` Efraim Flashner
  2 siblings, 0 replies; 11+ messages in thread
From: Marek Paśnikowski @ 2024-01-21  7:25 UTC (permalink / raw)
  To: help-guix

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

> sstp-client is failing with the following error:
> 
> --8<---------------cut here---------------start------------->8---
> ./autogen.sh: ./configure: /bin/sh: bad interpreter: No such file or
> directory error: in phase 'bootstrap': uncaught exception:
> %exception #<&invoke-error program: "./autogen.sh" arguments: ()
> exit-status: 126 term-signal: #f stop-signal: #f> phase `bootstrap' failed
> after 5.6 seconds
> command "./autogen.sh" failed with status 126
> --8<---------------cut here---------------end--------------->8---

I have little knowledge about the packaging process, but let my try looking at 
this here. In my experience, it is always good to focus on the error messages.

In this situation, I am not sure what exactly is failing here:
1. There is no /bin/sh in the build environment,
2. or /bin/sh complains that whatever file it is asked to open does not exist.

To narrow the possibilites, I suggest to add a build phase before 'bootstrap 
in which you ~ ( invoke ( which "ls" ) "-l" "/bin" ) ~ to check the case nr 1.

https://guix.gnu.org/manual/en/html_node/Build-Phases.html

https://guix.gnu.org/manual/en/html_node/Build-Utilities.html#Program-Invocation


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-19  7:26 Help packaging network-manager-sstp and sstp-client Lars Rustand
  2024-01-21  7:25 ` Marek Paśnikowski
@ 2024-01-21 14:23 ` Felix Lechner via
  2024-01-21 14:40   ` Lars Rustand
                     ` (2 more replies)
  2024-01-23  7:23 ` Efraim Flashner
  2 siblings, 3 replies; 11+ messages in thread
From: Felix Lechner via @ 2024-01-21 14:23 UTC (permalink / raw)
  To: Lars Rustand, help-guix

Hi Lars,

On Fri, Jan 19 2024, Lars Rustand wrote:

> ./autogen.sh: ./configure: /bin/sh: bad interpreter: No such file or directory

I would use something like this [1]

    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'configure 'provide-shell
            (lambda _
              (setenv "CONFIG_SHELL" (which "sh")))))))
    (native-inputs (list bash))

although the (which "sh") is kind of lazy and should probably be
replaced by something like

    #$(file-append bash "/bin/sh")

Kind regards
Felix

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/config_002estatus-Invocation.html


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-21 14:23 ` Felix Lechner via
@ 2024-01-21 14:40   ` Lars Rustand
  2024-01-21 16:03     ` Felix Lechner via
  2024-01-21 14:50   ` Clément Lassieur
  2024-01-21 15:37   ` Clément Lassieur
  2 siblings, 1 reply; 11+ messages in thread
From: Lars Rustand @ 2024-01-21 14:40 UTC (permalink / raw)
  To: help-guix; +Cc: Felix Lechner


Felix Lechner <felix.lechner@lease-up.com> writes:

> Hi Lars,
>
> I would use something like this [1]
>
>     (arguments
>      (list
>       #:phases
>       #~(modify-phases %standard-phases
>           (add-before 'configure 'provide-shell
>             (lambda _
>               (setenv "CONFIG_SHELL" (which "sh")))))))
>     (native-inputs (list bash))
>
> although the (which "sh") is kind of lazy and should probably be
> replaced by something like
>
>     #$(file-append bash "/bin/sh")
>
> Kind regards
> Felix
>
> [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/config_002estatus-Invocation.html

Thanks Felix, I tried your suggestion (with the file-append instead of
which), but it still fails the same way. I tried building with
`--keep-failed` and checked the contents of `environment-variables`, but
the variable is not inside this file. Maybe the setenv is only taking
effect inside the added phase and is not propagated to the configure phase?

Also, I thought the gnu-build-system should already take care of setting
this variable? From the below output I can see that it is at least set
correctly for network-manager-sstp, which uses an almost identical
package definition.

Lars Rustand <rustand.lars@gmail.com> writes:

> And network-manager-sstp fails with:
>
> checking for find... yes
> ./configure: line 13451: syntax error near unexpected token `fcntl.h'
> ./configure: line 13451: `      fcntl.h'
> error: in phase 'configure': uncaught exception:
> %exception #<&invoke-error program: "/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" arguments: ("./configure" "CONFIG_SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "--prefix=/gnu/store/rly5wz0vmbfawl7xiwdkgphsjwz8lgzm-network-manager-sstp-1.3.2" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu") exit-status: 2 term-signal: #f stop-signal: #f>
> phase `configure' failed after 1.5 seconds
> command "/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "./configure" "CONFIG_SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "SHELL=/gnu/store/m6c5hgqg569mbcjjbp8l8m7q82ascpdl-bash-5.1.16/bin/bash" "--prefix=/gnu/store/rly5wz0vmbfawl7xiwdkgphsjwz8lgzm-network-manager-sstp-1.3.2" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" failed with status 2


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-21 14:23 ` Felix Lechner via
  2024-01-21 14:40   ` Lars Rustand
@ 2024-01-21 14:50   ` Clément Lassieur
  2024-01-21 15:37   ` Clément Lassieur
  2 siblings, 0 replies; 11+ messages in thread
From: Clément Lassieur @ 2024-01-21 14:50 UTC (permalink / raw)
  To: Felix Lechner via; +Cc: Lars Rustand, Felix Lechner

Hello,

On Sun, Jan 21 2024, Felix Lechner via wrote:

> Hi Lars,
>
> On Fri, Jan 19 2024, Lars Rustand wrote:
>
>> ./autogen.sh: ./configure: /bin/sh: bad interpreter: No such file or directory
>
> I would use something like this [1]
>
>     (arguments
>      (list
>       #:phases
>       #~(modify-phases %standard-phases
>           (add-before 'configure 'provide-shell
>             (lambda _
>               (setenv "CONFIG_SHELL" (which "sh")))))))
>     (native-inputs (list bash))
>
> although the (which "sh") is kind of lazy and should probably be
> replaced by something like
>
>     #$(file-append bash "/bin/sh")

I don't think (which "sh") is bad, given the occurrences of (which "sh")
and (which "bash") in our code base.  (Actually I don't think being lazy
is bad in programming generally speaking.)

Also, I'm not sure it's necessary to specify bash as an input since it's
implicit in gnu-build-system.

See https://guix.gnu.org/manual/en/html_node/Build-Systems.html.

Cheers,
Clément

> Kind regards
> Felix
>
> [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/config_002estatus-Invocation.html


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-21 14:23 ` Felix Lechner via
  2024-01-21 14:40   ` Lars Rustand
  2024-01-21 14:50   ` Clément Lassieur
@ 2024-01-21 15:37   ` Clément Lassieur
  2024-01-21 16:00     ` Felix Lechner via
  2 siblings, 1 reply; 11+ messages in thread
From: Clément Lassieur @ 2024-01-21 15:37 UTC (permalink / raw)
  To: Felix Lechner via; +Cc: Lars Rustand, Felix Lechner

On Sun, Jan 21 2024, Felix Lechner via wrote:

> Hi Lars,
>
> On Fri, Jan 19 2024, Lars Rustand wrote:
>
>> ./autogen.sh: ./configure: /bin/sh: bad interpreter: No such file or directory
>
> I would use something like this [1]
>
>     (arguments
>      (list
>       #:phases
>       #~(modify-phases %standard-phases
>           (add-before 'configure 'provide-shell
>             (lambda _
>               (setenv "CONFIG_SHELL" (which "sh")))))))
>     (native-inputs (list bash))
>
> although the (which "sh") is kind of lazy and should probably be
> replaced by something like
>
>     #$(file-append bash "/bin/sh")

I forgot to say that in this snippet #$(file-append bash ...), bash
doesn't refer to the native input, it directly refers to the bash
package.  To refer to an input, you need to use ‘this-package-input’ or
‘this-package-native-input’.


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-21 15:37   ` Clément Lassieur
@ 2024-01-21 16:00     ` Felix Lechner via
  0 siblings, 0 replies; 11+ messages in thread
From: Felix Lechner via @ 2024-01-21 16:00 UTC (permalink / raw)
  To: Clément Lassieur, Felix Lechner via; +Cc: Lars Rustand

On Sun, Jan 21 2024, Clément Lassieur wrote:

> On Sun, Jan 21 2024, Felix Lechner via wrote:
>
> I forgot to say that in this snippet #$(file-append bash ...), bash
> doesn't refer to the native input, it directly refers to the bash
> package.  To refer to an input, you need to use ‘this-package-input’ or
> ‘this-package-native-input’.

Yeah, I agree! 'search-input-file' may be even more modern, and better.

Kind regards
Felix


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-21 14:40   ` Lars Rustand
@ 2024-01-21 16:03     ` Felix Lechner via
  0 siblings, 0 replies; 11+ messages in thread
From: Felix Lechner via @ 2024-01-21 16:03 UTC (permalink / raw)
  To: Lars Rustand, help-guix

Hi Lars,

On Sun, Jan 21 2024, Lars Rustand wrote:

> Maybe the setenv is only taking effect inside the added phase and is
> not propagated to the configure phase?

I don't think so. I used the same trick here:

  https://codeberg.org/lechner/juix/src/commit/fc328c57a4bf100d6b16a7f14e9c96d29a083bad/juix/deploy/debbugs.scm#L366-L390

Please feel to try that without the snippet. The error looked similar to
yours.

Kind regards
Felix


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-19  7:26 Help packaging network-manager-sstp and sstp-client Lars Rustand
  2024-01-21  7:25 ` Marek Paśnikowski
  2024-01-21 14:23 ` Felix Lechner via
@ 2024-01-23  7:23 ` Efraim Flashner
  2024-01-24 21:34   ` Lars Rustand
  2 siblings, 1 reply; 11+ messages in thread
From: Efraim Flashner @ 2024-01-23  7:23 UTC (permalink / raw)
  To: Lars Rustand; +Cc: help-guix

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

On Fri, Jan 19, 2024 at 08:26:23AM +0100, Lars Rustand wrote:
> 
> Hello, I'm trying to package network-manager-sstp (and its dependency
> sstp-client), but I'm running into a weird error. I'm sure it is a very
> easy problem to solve for someone with a little more experience with the
> build-system.
> 
> From what I can tell these packages should be fairly standard autotools
> projects, but I have no real experience in using autotools neither in
> Guix packages nor elsewhere so I don't know what I'm doing here.
> 
> I would greatly appreciate it if someone could help me take a look at
> the packages and help me build them successfully.
> 
> sstp-client is failing with the following error:
> 
> --8<---------------cut here---------------start------------->8---
> ./autogen.sh: ./configure: /bin/sh: bad interpreter: No such file or directory
> error: in phase 'bootstrap': uncaught exception:
> %exception #<&invoke-error program: "./autogen.sh" arguments: () exit-status: 126 term-signal: #f stop-signal: #f>
> phase `bootstrap' failed after 5.6 seconds
> command "./autogen.sh" failed with status 126
> --8<---------------cut here---------------end--------------->8---
> 
> Which is weird, since /bin/sh does exist, but it should also have been
> told to use something else I think.

Looking at the source code¹ it looks like the included autoconf script
tries to execute configure.  This doesn't work because between the
bootstrap phase and the configure phase we have a phase to adjust the
locations of /bin/sh and other binaries.  I'd suggest overriding the
'bootstrap phase with something like:

(replace 'bootstrap
  (lambda _
    (invoke "autoconf" "-vfi")))

¹ https://gitlab.com/sstp-project/sstp-client/-/blob/master/autogen.sh?ref_type=heads#L19


-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

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

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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-23  7:23 ` Efraim Flashner
@ 2024-01-24 21:34   ` Lars Rustand
  2024-01-28 17:42     ` Efraim Flashner
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Rustand @ 2024-01-24 21:34 UTC (permalink / raw)
  To: help-guix; +Cc: Efraim Flashner


Efraim Flashner <efraim@flashner.co.il> writes:

> Looking at the source code¹ it looks like the included autoconf script
> tries to execute configure.  This doesn't work because between the
> bootstrap phase and the configure phase we have a phase to adjust the
> locations of /bin/sh and other binaries.  I'd suggest overriding the
> 'bootstrap phase with something like:
>
> (replace 'bootstrap
>   (lambda _
>     (invoke "autoconf" "-vfi")))
>
> ¹ https://gitlab.com/sstp-project/sstp-client/-/blob/master/autogen.sh?ref_type=heads#L19

Thanks Efraim, that worked (with a small modification - I had to use
autoreconf instead of autoconf, since autoconf did not recognize the
-vfi flags), so now the package built successfully.

Do you have any ideas for the other package as well? I still have not
figured out how to build that one. From looking at the autogen.sh script
there seems to be a similar situation here, this script also tries to
execute configure, but replacing the bootstrap phase did not do anything
for this package.


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

* Re: Help packaging network-manager-sstp and sstp-client
  2024-01-24 21:34   ` Lars Rustand
@ 2024-01-28 17:42     ` Efraim Flashner
  0 siblings, 0 replies; 11+ messages in thread
From: Efraim Flashner @ 2024-01-28 17:42 UTC (permalink / raw)
  To: Lars Rustand; +Cc: help-guix

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

On Wed, Jan 24, 2024 at 10:34:16PM +0100, Lars Rustand wrote:
> 
> Efraim Flashner <efraim@flashner.co.il> writes:
> 
> > Looking at the source code¹ it looks like the included autoconf script
> > tries to execute configure.  This doesn't work because between the
> > bootstrap phase and the configure phase we have a phase to adjust the
> > locations of /bin/sh and other binaries.  I'd suggest overriding the
> > 'bootstrap phase with something like:
> >
> > (replace 'bootstrap
> >   (lambda _
> >     (invoke "autoconf" "-vfi")))
> >
> > ¹ https://gitlab.com/sstp-project/sstp-client/-/blob/master/autogen.sh?ref_type=heads#L19
> 
> Thanks Efraim, that worked (with a small modification - I had to use
> autoreconf instead of autoconf, since autoconf did not recognize the
> -vfi flags), so now the package built successfully.
> 
> Do you have any ideas for the other package as well? I still have not
> figured out how to build that one. From looking at the autogen.sh script
> there seems to be a similar situation here, this script also tries to
> execute configure, but replacing the bootstrap phase did not do anything
> for this package.

Looking at the repo for network-manager-sstp I'd recommend the same
thing with that package, with just replacing the 'bootstrap phase.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

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

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

end of thread, other threads:[~2024-01-28 17:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-19  7:26 Help packaging network-manager-sstp and sstp-client Lars Rustand
2024-01-21  7:25 ` Marek Paśnikowski
2024-01-21 14:23 ` Felix Lechner via
2024-01-21 14:40   ` Lars Rustand
2024-01-21 16:03     ` Felix Lechner via
2024-01-21 14:50   ` Clément Lassieur
2024-01-21 15:37   ` Clément Lassieur
2024-01-21 16:00     ` Felix Lechner via
2024-01-23  7:23 ` Efraim Flashner
2024-01-24 21:34   ` Lars Rustand
2024-01-28 17:42     ` Efraim Flashner

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).