Go on sparc

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Go on sparc

Chris Ross
So, I was trying to follow a recipie online to get a mail server running
on an OpenBSD 6.6 box [1].  Among the packages it wants to install are
opensmtpd-filter-rspamd and opensmtpd-filter-senderscore.  Those packages
don't exist, and I find that they do for amd64 and not sparc.  So,
I thought I'd build them myself, but ports shows those as not supported
for sparc64, and I traced that back to go.

Does anyone know if there is a go for sparc64, or if there are known
issues that just need to be resolved?  I'd be happy to help if I can,
but don't know go at all, and merely moderately good at understanding
architectural problems that I've seen affecting code working on sparc64
systems.

Thanks.

                - Chris

1 https://poolp.org/posts/2019-09-14/setting-up-a-mail-server-with-opensmtpd-dovecot-and-rspamd/

Reply | Threaded
Open this post in threaded view
|

Re: Go on sparc

Stuart Henderson
sparc64 isn't on upstream's list of supported architectures
(https://golang.org/doc/install/source).

There's a third party fork adding this for an old version of go
(https://github.com/4ad/go) but even with this it's going to be a lot of
work to get something usable, and even then there will be problems building
many programs that bundle a "vendored" copy of standard go libraries that
will need updating before they can be used.

It's likely to be much easier to rewrite the tools you want in C than it is
to get go working.

Side note: if something isn't present in release packages on some
particular arch (but is present for other arch), it's not going to build
directly from ports either.

On 12 November 2019 05:56:03 Chris Ross <[hidden email]> wrote:

> So, I was trying to follow a recipie online to get a mail server running
> on an OpenBSD 6.6 box [1].  Among the packages it wants to install are
> opensmtpd-filter-rspamd and opensmtpd-filter-senderscore.  Those packages
> don't exist, and I find that they do for amd64 and not sparc.  So,
> I thought I'd build them myself, but ports shows those as not supported
> for sparc64, and I traced that back to go.
>
>
> Does anyone know if there is a go for sparc64, or if there are known
> issues that just need to be resolved?  I'd be happy to help if I can,
> but don't know go at all, and merely moderately good at understanding
> architectural problems that I've seen affecting code working on sparc64
> systems.
>
>
> Thanks.
>
>
>                - Chris
>
>
> 1
> https://poolp.org/posts/2019-09-14/setting-up-a-mail-server-with-opensmtpd-dovecot-and-rspamd/



Reply | Threaded
Open this post in threaded view
|

Re: Go on sparc

Chris Ross


> On Nov 12, 2019, at 00:25, Stuart Henderson <[hidden email]> wrote:
>
> sparc64 isn't on upstream's list of supported architectures (https://golang.org/doc/install/source).
>
> There's a third party fork adding this for an old version of go (https://github.com/4ad/go) but even with this it's going to be a lot of work to get something usable, and even then there will be problems building many programs that bundle a "vendored" copy of standard go libraries that will need updating before they can be used.
>
> It's likely to be much easier to rewrite the tools you want in C than it is to get go working.

Well, I don’t know how easy that would be either.  These were both, I believe, written by Gilles.  I would appreciate your input Gilles.  I see both of these particularly tools, opensmtpd filters, are Golang only and require nothing beyond the standard library.  It would be ugly, but I might be able to hack them into my system with the go fork you mention above.  Whether or not I _want_ to is more complicated.  :-/

> Side note: if something isn't present in release packages on some particular arch (but is present for other arch), it's not going to build directly from ports

Okay.  Thanks.  I’m new to OpenBSD, and I know some other BSD’s work based on people building and supplying packages, which sometimes take longer on some of the less used arch’s.

> On 12 November 2019 05:56:03 Chris Ross <[hidden email]> wrote:
>>
>>
>> 1 https://poolp.org/posts/2019-09-14/setting-up-a-mail-server-with-opensmtpd-dovecot-and-rspamd/
>

Reply | Threaded
Open this post in threaded view
|

Re: Go on sparc

Stuart Henderson
On 2019/11/12 11:45, Chris Ross wrote:
>
>
> > On Nov 12, 2019, at 00:25, Stuart Henderson <[hidden email]> wrote:
> >
> > sparc64 isn't on upstream's list of supported architectures (https://golang.org/doc/install/source).
> >
> > There's a third party fork adding this for an old version of go (https://github.com/4ad/go) but even with this it's going to be a lot of work to get something usable, and even then there will be problems building many programs that bundle a "vendored" copy of standard go libraries that will need updating before they can be used.
> >
> > It's likely to be much easier to rewrite the tools you want in C than it is to get go working.

> Well, I don’t know how easy that would be either. These were both, I

Seriously it's a relatively simple program. Not belittling it, but
it takes messages via opensmtpd's filter interface, passes them to
rspamd over http, and feeds the result back to opensmtpd. Porting
that to a different language is a complete different magnitude of
complexity than porting a (not-upstream-supported version of) the
go compiler and standard library to OpenBSD/sparc64.

(...of course it doesn't have to be C, some other language with json+http
support would also work).

Also note that we don't have luajit for sparc64 either, so rspamd will
use more resources / be slower on sparc64 than one of the arches that do
support this.

> believe, written by Gilles. I would appreciate your input Gilles. I see
> both of these particularly tools, opensmtpd filters, are Golang only and
> require nothing beyond the standard library. It would be ugly, but I
> might be able to hack them into my system with the go fork you mention
> above. Whether or not I _want_ to is more complicated. :-/

> > Side note: if something isn't present in release packages on some particular arch (but is present for other arch), it's not going to build directly from ports
>
> Okay.  Thanks.  I’m new to OpenBSD, and I know some other BSD’s work based on people building and supplying packages, which sometimes take longer on some of the less used arch’s.

We don't take 3rd party binaries, they are built on OpenBSD's own
hardware infrastructure by OpenBSD develoeprs.

Fewer packages are available on the less common arches, but this is
usually because many of them require additional work to make them build
at all, and many developers only have the more common arches.


Reply | Threaded
Open this post in threaded view
|

Re: Go on sparc

Chris Ross
In reply to this post by Stuart Henderson


> On Nov 12, 2019, at 16:42, [hidden email] wrote:
>
> November 12, 2019 5:45 PM, "Chris Ross" <[hidden email]> wrote:
>> Well, I don’t know how easy that would be either. These were both, I believe, written by Gilles. I
>> would appreciate your input Gilles. I see both of these particularly tools, opensmtpd filters, are
>> Golang only and require nothing beyond the standard library. It would be ugly, but I might be able
>> to hack them into my system with the go fork you mention above. Whether or not I _want_ to is more
>> complicated. :-/
>>
>
> I don't know what input to provide here :-)

Just your experience, I guess.  Thank you for that.  ;-)

> The API was designed so that it is very easy to write filters using tools you know, so if you wonder
> if you should hack an old go fork or use an existing filter as a model to write your own, my take is
> to go the second option as you will avoid having to maintain a huge hack and might just have a thing
> working in an hour or so.
>
> There is a C library by martijn@ that can ease writing a C filter btw.

Great to know that, too.  Thanks.  I’ll take a swing at that.  Might be faster to write in python, but if
there’s already a library to give structure, C will be as easy and is preferred.

         - Chris