LkpPo Building on OpenBSD Forum Thread


#1

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


#2

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?


#3

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.


#4

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:


#5

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?


#6

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.


#7

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


#8

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?


#9

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


#10

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.


#11

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?


#12

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?


#13

See:

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

And some explanations here:


#14

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.