pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc on OpenBSD



On Thu, Aug 27, 2020 at 10:17 PM Ottavio Caruso
<ottavio2006-usenet2012%yahoo.com@localhost> wrote:
> On 27/08/2020 20:35, Ottavio Caruso wrote:
>> On 27/08/2020 18:51, Tom H wrote:
>>> On Thu, Aug 27, 2020 at 3:59 PM Ottavio Caruso
>>> <ottavio2006-usenet2012%yahoo.com@localhost> wrote:
>>>> On 27/08/2020 11:09, Tom H wrote:
>>>>> On Wed, Aug 26, 2020 at 10:54 PM Jonathan Perkin
>>>>> <jperkin%joyent.com@localhost> wrote:
>>>>>> * On 2020-08-26 at 20:13 BST, Tom H wrote:
>>>>>>>
>>>>>>> -amd64/*) abi=64 machine_arch=x86_64 ;;
>>>>>>> +amd64/*) abi=64 machine_arch=amd64 ;;
>>>>>>
>>>>>> Why is this needed? The point of this is to standardise across
>>>>>> various OS, and shouldn't need to match the uname arch.
>>>>>
>>>>> I've just run "bootstrap" without changing anything, followed by a
>>>>> "bmake install".
>>>>>
>>>>> It fails with:
>>>>>
>>>>> ===> Building binary package for digest-20190127
>>>>> => Creating binary package /usr/pkgsrc/packages/All/digest-20190127.tgz
>>>>> malloc() warning: unknown char in MALLOC_OPTIONS
>>>>> ===> Installing binary package of digest-20190127
>>>>> pkg_add: Warning: package `digest-20190127' was built for a platform:
>>>>> pkg_add: OpenBSD/amd64 6.7 (pkg) vs. OpenBSD/x86_64 6.7 (this host)
>>>>> pkg_add: 1 package addition failed
>>>>> *** Error code 1
>>>>>
>>>>> Stop.
>>>>> bmake[3]: stopped in /usr/pkgsrc/pkgtools/digest
>>>>> *** Error code 1
>>>>>
>>>>> Stop.
>>>>> bmake[2]: stopped in /usr/pkgsrc/pkgtools/digest
>>>>> malloc() warning: unknown char in MALLOC_OPTIONS
>>>>> *** Error code 1
>>>>>
>>>>> Stop.
>>>>> bmake[1]: stopped in /usr/pkgsrc/pkgtools/digest
>>>>> *** Error code 1
>>>>>
>>>>> Stop.
>>>>> bmake: stopped in /usr/pkgsrc/shells/oksh
>>>>>
>>>>> On OpenBSD 6.7
>>>>>
>>>>> # arch -s
>>>>> amd64
>>>>>
>>>>> # uname -m
>>>>> amd64
>>>>>
>>>>> # uname -p
>>>>> amd64
>>>>>
>>>>> # sysctl hw.machine
>>>>> hw.machine=amd64
>>>>>
>>>>> I started using pkgsrc on OpenBSD in July, so I don't know whether
>>>>> it worked previously; but the arch was definitely "am64" on previous
>>>>> versions too.
>>>>
>>>> Did you add "--abi " to ./bootstrap? Otherwise it doesn't make sense,
>>>> because ./bootstrap should pick up:
>>>>
>>>>          machine_arch=`arch -s`
>>>>
>>>> oc@OpenBSD:~$ arch -s
>>>> amd64
>>>
>>> The above output was after running "./bootstrap" without setting any
>>> option.
>>>
>>> "arch -s" is the problem. It outputs "amd64" and it's transformed by
>>> "bootstrap" into "x86_64" by "amd64/*) abi=64  machine_arch=x86_64
>>> ;;", and you end up with "package `digest-20190127' was built for a
>>> platform: pkg_add: OpenBSD/amd64 6.7 (pkg) vs. OpenBSD/x86_64 6.7
>>> (this host)".
>>>
>>
>> I cannot reproduce this issue on OpenBSD 6.6, I haven't got a 6.7 host
>> to try it on.
>>
>> oc@OpenBSD:~/cvs/pkgsrc$ uname -a
>> OpenBSD OpenBSD 6.6 GENERIC.MP#3 amd64
>> oc@OpenBSD:~/cvs/pkgsrc$ cd bootstrap
>> oc@OpenBSD:~/cvs/pkgsrc/bootstrap$ doas ./bootstrap
>>
>> [...]
>>
>> ===========================================================================
>>
>> Please remember to add /usr/pkg/bin to your PATH environment variable
>> and /usr/pkg/man to your MANPATH environment variable, if necessary.
>>
>> An example mk.conf file with the settings you provided to "bootstrap"
>> has been created for you. It can be found in:
>>
>>        /usr/pkg/etc/mk.conf
>>
>> You can find extensive documentation of the NetBSD Packages Collection
>> in /home/oc/cvs/pkgsrc/doc/pkgsrc.txt.
>>
>> Thank you for using pkgsrc!
>>
>> ===========================================================================
>>
>> ===> bootstrap started: Thu Aug 27 19:59:52 BST 2020
>> ===> bootstrap ended:   Thu Aug 27 20:20:07 BST 2020
>>
>> oc@OpenBSD:~/cvs/pkgsrc/bootstrap$ cat /usr/pkg/etc/mk.conf
>> # Example /usr/pkg/etc/mk.conf file produced by bootstrap-pkgsrc
>> # Thu Aug 27 19:59:53 BST 2020
>>
>> .ifdef BSD_PKG_MK    # begin pkgsrc settings
>>
>> ABI=            64
>> PKGSRC_COMPILER=    clang
>> CC=            clang
>> CXX=            clang++
>> CPP=            ${CC} -E
>> CLANGBASE=        /usr
>>
>> PKG_DBDIR=        /usr/pkg/pkgdb
>> LOCALBASE=        /usr/pkg
>> VARBASE=        /var
>> PKG_TOOLS_BIN=        /usr/pkg/sbin
>> PKGINFODIR=        info
>> PKGMANDIR=        man
>>
>> .endif            # end pkgsrc settings
>>
>> Full log here:
>> https://drive.google.com/file/d/1SC7fYafrzXE5Lgcm7X9yxg9nAERTK7j2/view
>
> Ok, my apologies, I misunderstood the issue. I can reproduce the issue here:

No problem!

We could have an "case-esac" statement within the "amd64/*) " case
that sets "abi" and "machine_arch".

For example (against "trunk" and untested):

$ diff -u bootstrap bootstrap.new
--- bootstrap 2020-08-27 23:35:18.795347092 +0200
+++ bootstrap.new 2020-08-27 23:40:28.278387346 +0200
@@ -812,7 +812,12 @@
 case "$machine_arch/$abi" in
 # "amd64" translates to "x86_64", defaults to 64-bit
 amd64/32) abi=32 machine_arch=i386 ;;
-amd64/*) abi=64 machine_arch=x86_64 ;;
+amd64/*)
+ case "$opsys" in
+ OpenBSD) abi=64 machine_arch=amd64 ;;
+ *) abi=64 machine_arch=x86_64 ;;
+ esac
+ ::
 # XXX: hppa untested
 hppa/64) abi=64 machine_arch=hppa64 ;;
 hppa/*) abi=32 machine_arch=hppa ;;
$


> $ cd cvs/pkgsrc/pkgtools/pkgin/
> oc@OpenBSD:~/cvs/pkgsrc/pkgtools/pkgin$ /usr/pkg/bin/bmake install
> [..]
>
> => Automatic manual page handling
> => Generating post-install file lists
> => Checking file-check results for digest-20190127
> => Creating binary package
> /home/oc/cvs/pkgsrc/pkgtools/digest/work/.packages/digest-20190127.tgz
> ===> Building binary package for digest-20190127
> => Creating binary package
> /home/oc/cvs/pkgsrc/packages/All/digest-20190127.tgz
> => Becoming ``root'' to make su-real-package-install (/usr/bin/su)
> Password:
> malloc() warning: unknown char in MALLOC_OPTIONS
> ===> Installing binary package of digest-20190127
> pkg_add: Warning: package `digest-20190127' was built for a platform:
> pkg_add: OpenBSD/amd64 6.6 (pkg) vs. OpenBSD/x86_64 6.6 (this host)
> pkg_add: 1 package addition failed
> *** Error code 1
>
> Stop.
> bmake: stopped in /home/oc/cvs/pkgsrc/pkgtools/digest
> *** Error code 1
>
> Stop.
> bmake[2]: stopped in /home/oc/cvs/pkgsrc/pkgtools/digest
> malloc() warning: unknown char in MALLOC_OPTIONS
> *** Error code 1
>
> Stop.
> bmake[1]: stopped in /home/oc/cvs/pkgsrc/pkgtools/digest
> *** Error code 1
>
> Stop.
> bmake: stopped in /home/oc/cvs/pkgsrc/pkgtools/pkgin


Home | Main Index | Thread Index | Old Index