Closed cryptorick closed 6 years ago
@cryptorick Thanks! Getting Shen working reliably on BSD will be a boon to the language.
I tested this branch on Windows and it works fine, and the CI build passes, so we know it works on recent Linux (Ubuntu).
One little thing: Clozure CL is not mentioned in the readme additions under the BSDs. Ideally, we'd have each CL implementation tested per OS and mention explicitly in the readme which are not working. Is Clozure well-supported on BSD or installable in the same way as the others? Does gmake ccl
work?
All
variable in the Makefile
for the BSDs, leaving out ccl
, or whatever is not supported for that descendant of BSD. ecl
is currently excluded for Windows because of the difficulty in getting it set up correctly.I'll also wait for @tizoc review it before hitting merge. And maybe try it out on macOS.
Thank you @cryptorick !
The changes look good to me and safe to merge. I can't test it on OSX today, but I will do it during the weekend and report back.
BTW, here's a rundown of available CLs on these BSDs (as of today), for which I will change the All
variable accordingly (as you requested).
FreeBSD 11.1 amd64
clisp -- NOT AVAILABLE in ports/packages
Port was deprecated in 2014. Source: https://www.freshports.org/lang/clisp/
ccl -- available in ports/packages (1.11)
ecl -- available in ports/packages (15.3.7_1)
sbcl -- available in ports/packages (1.4.2,1)
OpenBSD 6.2 amd64
clisp -- available in ports/packages (2.49p1)
ccl -- NOT AVAILABLE in ports/packages
ecl -- available in ports/packages (16.1.3p0)
sbcl -- available in ports/packages (1.3.10p1)
NetBSD 7.0/8.0 amd64
clisp -- available as binary package (2.49nb24)
ccl -- NOT AVAILABLE as binary or source package
ecl -- available as binary package (16.1.2)
sbcl -- NOT AVAILABLE as binary package
However, sbcl is available is a pre-built binary on i386. Source: http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/lang/sbcl/README.html
Also: sbcl might be able to be built via source package in pkgsrc (what FreeBSD/OpenBSD calls "ports"), but I haven't tried. (It's a big undertaking to get the pkgsrc tree and then configure the build environment as a non-root user. Somebody already using NetBSD this way would be a better candidate.)
I was surprised to find out that I couldn't find a (binary) package of clisp on FreeBSD, because I used to have it; it turns out that the port/package was deprecated. This usually happens when a (volunteer) port maintainer can't continue anymore (and no one else was found to take over). OTOH, FreeBSD is the only BSD here to have ccl (a very nice CL).
(Sorry for the double push -- I was working with too many locals and forgot where I was. :)
@rkoeninger @tizoc I think I covered all the outstanding items, but please check me.
Also, you wouldn't put me off in the least of you changed anything I submitted to improve the expression or fix something functionally. I just want it to work, and I consider this a team effort.
That said, the text I typed in the README may be a bit too long-winded / not in keeping with what you have in the other sibling sections. Please change to whatever seems more appropriate for your style and your audience (whom you know better than I do anyway).
Also, I'm not a fan of -- and no great shakes at -- writing conditionals in GNU makefiles. For instance, the lines I added, namely:
ifeq ($(OSName),freebsd)
All=ccl ecl sbcl
else ifeq ($(OSName),openbsd)
All=clisp ecl sbcl
else ifeq ($(OSName),netbsd)
All=clisp ecl
endif
seem to work fine (I tested it); however, according to the manual here which says
Extra spaces are allowed and ignored at the beginning of the conditional directive line, but a tab is not allowed. (If the line begins with a tab, it will be considered part of a recipe for a rule.)
the tab I put in front of ifeq ($(OSName),freebsd)
(on the first line) should be a no-go; yet, it works. (Maybe this is because, at this point, we are not yet under a rule?)
But also, that block I inserted should end with two more endif
s, according to the manual (same section), but ... it works. However, I don't usually write GNU makefiles; so, I am not sure that it is correct and I hope you will please check it out. Thanks! You guys have been great. I wish this project great success!
@cryptorick I remember avoiding indenting control structures, but when I removed them, CI failed and I don't feel like playing 20 questions with it.
I added a grid of install instructions/compatibilities for the BSDs to the readme (based on this). I don't know the BSD package commands. Is it the same for all of them? If the commands are the same, then the grid can just mention compatibilities.
Let's can go ahead and wrap this up, and I'll worry about neat presentation later.
@rkoeninger I added the package manager commands to the matrix. I hope that's what you wanted. I will test the current Makefile, with your changes, next. (Roger on the 20 questions.)
Oops. End of gmake
invocation.
;; Wrote the memory image into ./bin/clisp/shen (8,856,736 bytes)
Bytes permanently allocated: 164,192
Bytes currently in use: 4,996,752
Bytes available until next GC: 77,296
Bye.
./bin/clisp/shen --clisp-m 10MB -e "(do (cd \"kernel/tests\") (load \"README.shen\") (load \"tests.shen\"))"
GNU CLISP: invalid argument: '-e'
GNU CLISP: use '-h' for help
gmake: *** [Makefile:150: test-clisp] Error 1
Don't know why it doesn't like -e
. Any ideas?
I looked at the Clisp --help and it doesn't list -e
, but lists -x
as the option to eval expressions. But that doesn't seem to work either:
$ ./bin/clisp/shen --clisp-m 10MB -x "(do (cd \"kernel/tests\") (load \"README.shen\") (load \"tests.shen\"))"
module 'syscalls' requires package OS.
This is on OpenBSD 6.2 amd64. gmake sbcl
and gmake ecl
are both completing successfully though.
@cryptorick I think the readme is good now. I started going overboard on how much instruction was provided to the user. The CL's individual project pages can tell them anything more they need to know.
The -e
argument is supposed to be handled by shen.toplevel
in primitives.lsp
, but it looks like clisp itself is trying to interpret it. I thought arguments to clisp itself had to be prefixed with --clisp-
, like --clisp-m
. That's the way it works everywhere else.
Was this working earlier? Also, you should be able to run make all
/gmake all
successfully on a machine with all available CL binary distributions installed.
Was this working earlier?
No. I had only run gmake sbcl
on OpenBSD earlier (cf. my original message).
Status on builds/tests after your makefile changes
All=ccl ecl sbcl
All=clisp ecl sbcl
clisp
(with that odd error complaining about -e
)All=clisp ecl
clisp
PASSES (no probs with -e
option)ecl
: Don't know yetThe NetBSD box I'm on is a shell account for which I've put in a request to the admin (today) to install ecl. I will report back when that happens. If it takes too long, I could find another machine in a few days.
(BTW, as you have probably guessed, that odd error on OpenBSD cannot be caused by any changes we made to Makefile
, since I get the same error when I switch back to the master
branch.)
My sysadmin installed ecl
on the NetBSD machine. All's well. So now, the status of the builds/tests are:
All=ccl ecl sbcl
All=clisp ecl sbcl
clisp
(with that odd error complaining about -e
)All=clisp ecl
Still don't know what to do about that OpenBSD Clisp -e
thingy yet. Until we resolve that issue, in the meantime, should we take clisp
off of the All
list for OpenBSD, or leave it the way it is? Thanks!
@cryptorick I went ahead and removed clisp
from the All
variable for OpenBSD. I installed OpenBSD in a VM last night and was able to reproduce the problems you mention, but I have no idea what to do about them.
The make all
command is really just a convenience for testing changes - I wanted to be able to re-build and re-test all CLs on a machine quickly. So a CL missing from the All
variable doesn't guarantee it won't work, it's just not been shown to consistently work yet.
I think we've gotten plenty done with this PR and we can put the OpenBSD/CLisp problems in as an issue if we want to revisit them later. I'll merge it in unless there are any other issues.
Thanks for contributing and all your help with testing!
@rkoeninger sounds great! Thanks!
@rkoeninger sorry you had to go to the trouble of standing up an OpenBSD VM. Glad you were able to do it and reproduce the problem. ("I'm not crazy!" \o/ :)
Hi!
With these changes, Shen installs a bit easier for FreeBSD, OpenBSD and NetBSD users. A few notes.
The fetch command used on the BSDs is not
wget
but rather whatever is available in the base system of each operating system, so that there is no need for the user to install any extra program. (BSD users tend to like to use base as much as possible.)BSD tar (also found in base) needs the
z
option to uncompress the kernel sources. GNU tar apparently doesn't (need to be told) -- it can figure it out. However, I added thez
option anyway so that thetar
command unarchiving the kernel sources can work on the BSDs as well as Linux. Also, there is anothertar
invocation inMakefile
that still uses thez
flag (so, historical use :).Could not get around the fact that BSD users need to install GNU make; so, this is now noted in the README.
Tested on
FreeBSD 11.1-RELEASE-p4 #0 amd64
. Rangmake fetch && gmake sbcl
with success.Tested on
OpenBSD 6.2 GENERIC.MP#337 amd64
. Rangmake fetch && gmake sbcl
with success.Tested on
NetBSD 8.0_BETA (GENERIC.201712221850Z) amd64
. Rangmake fetch && gmake clisp
with success.Tested on
Linux 2.6.32-696.6.3.el6.x86_64 x86_64
. Rangmake fetch && gmake clisp
with success. (I don't have access to another, newer Linux system.)