LkpPo Building on OpenBSD Forum Thread

Since @LkpPo reported problems creating new threads, and @gchiu seems to be MIA the last 4 days on holiday, I thought I'd create a new thread to offer any building support. This is generally done on StackOverflow, but we can do it here as well.

We haven't done a bootstrap to a system we don't have binaries for in a while (!)

The idea is that there are some generated files, and to generate these files you need a working Rebol. But what you can do is you can be on one machine and tell it to build a "prep" directory with all these files for another target machine. Then you move that folder over and build with a C compiler, and get your executable. Now you're bootstrapped: you can use that executable for any subsequent builds.

This hasn't happened since we went to an "all Rebol" build system. The build system is big...Shixin wrote it and I think probably considered working on it as annoying as I would. So it didn't really get documentation or peer review. But on the upside, it is all Rebol - so you don't need GNU make or other tools installed. And when we wrangle it to try and make it better we can use Rebol to do so...so it doesn't feel like as much a waste of time as fiddling with CMake/etc. It provides experience that feeds back into improvement of the language, and a much-needed "big" test case.

Debian is probably the best system to try first

You should be able to go to the %make/ directory and type:

./r3-linux-x64-8994d23 make.r

That will run a Ren-C executable built at commit 8994d23. There are various options you can use, here's an example of settings I use for development on Linux:

./r3-linux-x64-8994d23 make.r config: configs/generic-c++.r optimize: 0 rigorous: true debug: sanitize standard: c++17 target: makefile static: yes

That generates a heavily instrumented build with Address Sanitizer, that runs slow but catches a lot of issues. It uses C++ to build, which adds extra checks at compile-time, though is equivalent at runtime to the C build.

I'm not sure what your specific areas of interest or skills are, but reply to this thread if you need any help... or ideally, join StackOverflow and ask a couple of Q&A there. We can help upvote you to get chat privileges (it's very easy, only 20 points).

1 Like

Thanks for your help. I can't use SO now because I'm in holidays without my logins.

I'm not a C/C++ dev. but it's not out of my interest. Language and system design is of interest for me. I spend a lot of time on this purpose. Designing an interpreter or a compiler is very interesting, but out of my competencies right now.

So, you say I have to generate sources files on Debian, copy them on OpenBSD and compile them with a C++ compiler to bootstrap aa ren-c interpreter.

Any dependencies with libs other than the libc?

Hello,

Finally I find some time and the bootstrapping is done. I have a working interpreter compiled on OpenBSD 6.3 for amd64 with command:

./r3-openbsd-x64 make.r config: configs/generic.r optimize: 0 rigorous: false debug: false standard: c99 static: no os-id: 0.9.40

I just did a little fix form environ.

2 Likes

That's good news! Even better news is that you're resourceful enough to do something like this, which implies you are probably able to do a lot of other things. :slight_smile:

2 Likes

Thanks to the good work in the code I could do it without much difficulty.

The code is pretty clear although I struggled to find the option os-id. I spent time rebuilding the right flags for the target system when it was already done via os-id.

There is a problem with the file separator in the makefile that is not generated according to the target system.

What should you do now?

  • Add a config for this system?

  • Added a Travis build for it?

  • Try a build with different options for validation?

Even better news is that you’re resourceful enough to do something like this, which implies you are probably able to do a lot of other things.

Maybe, I have little experience with C/C++ and build systems. I work daily with interpreted languages.

If you'd like a Travis build you'll need to modify the Travis build script.
But in the meantime I can link your builds to our downloads page. Just make a PR to this page

https://github.com/gchiu/rebol-misc/blob/master/community-links.reb

1 Like

A quick check. It seems that Travis does not support OpenBSD.

I think I have to build it by myself.

Where is displayed this community-links page?

You release your own builds on a puplic FTP?

Do I have to push my bootstrapped build on the master repo?

It's supposed to display here http://metaeducation.s3.amazonaws.com/index.html

If you've looked at the %systems.r file in the make tools, then you kind of get the gist of the philosophy of what we're trying to do.

(I've been informed you have been around, and you know Rebol, so you aren't coming from ground zero on this.)

You are the only person using or testing OpenBSD so...congratulations, you are the one defining those flags. :slight_smile:

I personally am wanting to focus more on WebAssembly; I think that's a more relevant-than-average target. But I want us to stick close to the C standard and be portable. We should keep dependencies low, and be agile in some ways other projects can't.

If you’ve looked at the %systems.r file in the make tools, then you kind of get the gist of the philosophy of what we’re trying to do.

(I’ve been informed you have been around, and you know Rebol, so you aren’t coming from ground zero on this.)

So few in fact, almost zero.

You are the only person using or testing OpenBSD so…congratulations, you are the one defining those flags.

This file is ok for obsd x64 at this point. I just wanted to offer a regular build. So I will do it by myself later.

I personally am wanting to focus more on WebAssembly; I think that’s a more relevant-than-average target. But I want us to stick close to the C standard and be portable. We should keep dependencies low, and be agile in some ways other projects can’t.

It's quite interesting. Did you have started?

But in the meantime I can link your builds to our downloads page. Just make a PR to this page

If I understand, I push binaries online and build a page like that:

http://giuliolunati.altervista.org/r3/ls.php

After that I put a link to the page in community-links block?

See:

http://hostilefork.com/media/shared/replpad-js/

And some explanations here:

The actual link we use for Giulio's builds is:

`http://rebolbinaries.0pt.pw/downloads.reb`

and it contains only this

[http://rebolbinaries.0pt.pw/linux-armhf/r3-7e8edcf0-debug]

The type of build (linux-armhf) is pulled from the file path, and the build hash (738edcf0) is pulled from the filename. You only need to make a PR with your web page link to that community-links block. I've updated the downloads page now that his page is available again.

NB : I need to bootstrap again (Build fails on OpenBSD) with commit 8994d23, because my binary fails to build with last commits.

1 Like

I bootstrapped again. The new binary works well with the last buil script but the build result segfault. Maybe some commits broke the build on OpenBSD.

The UTF-8 change committed today is extremely significant. It's work that began over a year ago, and has taken a long time to move along to the stage of commitment. There'll probably be a settling period as the early bugs get worked out, so you're just in time to help. :slight_smile:

But always better to know than to guess, so debug builds are the first recourse if an error occurs. (Generally speaking I prefer it if people always run debug builds unless they have a very compelling reason not to...running somewhat slower and knowing if anything is going wrong is a good tradeoff a lot of the time.)

Thanks for your post. I wonder what in particular in OpenBSD's culture you are interested in. Is there a particular program that runs on it, or an initiative?

I've always been curious about in "alternative" OSes (I ran Linux of 3.5" floppy disks downloaded off the Internet in the pre-1.0 days, via SlackWare).

I kept up with BeOS back in the day, and look in every now and again at HaikuOS. Strangely, now that I've got the knowledge to really understand the tradeoffs and design matters in operating systems, I haven't really spent long looking under the hood of the AltOS'es.

It's a bit of a tradeoff to want to engage people who like "weird" things--who are maybe the best to appreciate Rebol--vs. managing the distraction. I think that the JavaScript web build is a good start, but not to forget the low-dependency builds...and keep the JavaScript extension quarantined.

1 Like

Stephane,

Does the build on OpenBSD also work for FreeBSD?

Hi iArnold,

Not tested on FreeBSD. I don't intend to do that.