Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FreeBSD compatibility #5

Closed
wants to merge 7 commits into from
Closed

Add FreeBSD compatibility #5

wants to merge 7 commits into from

Conversation

jhriggs
Copy link

@jhriggs jhriggs commented Oct 9, 2014

This fixes a couple of compilation errors that I have encountered on FreeBSD, minimizes a few Linux-esque dependencies, and generalizes some of the (Net)BSD handling so that the build works as a FreeBSD port.

  • Change #!/bin/bash -> #!/bin/sh as none of the scripts seem to require bash-specific functionality.
  • Similarly, gawk -> awk.
  • Fix compile error in jobexecutor.c.
  • The remainder of the changes are just compatibility changes for FreeBSD. (For the most part, FreeBSD can just use OSTYPE=netbsdelf, but not entirely.)

Nothing in these scripts appears to be bash-specific, so using /bin/sh prevents, for example, BSD system packages/ports having a bash dependency.
Like the previous bash -> sh commit, nothing here appears to be gawk-specific, so this prevents, for example, BSD system packages/ports having a gawk dependency.
It may be something specific to the FreeBSD ports infrastructure, but the -C after $(MAKEFLAGS) causes the build to fail. Swapping their order fixes it.
@schedulix
Copy link
Owner

Hi Jim,

thank you very much! I'll have a look at your changes and merge them if nothing speaks against it.

I did have some problems with the bourne shell on Solaris, but I'm not sure if those problems still exist. After starting to use the bash, the scripts did change several times. It is possible that the changes also eliminated the problems I had in the Solaris environment.

The use of gawk has similar reasons. The original awk (from about 5000 BC on the computer scale of time) isn't very powerful and might or might not be able to execute my scripts.
And of course, if you type 'awk' in a Solaris environment you often get that tool made of wood and stone.

I won't have time to review everything this week. I'll come back on you next week.

Best regards,

Ronald

On Thu, 09 Oct 2014 07:31:51 -0700
Jim Riggs notifications@github.com wrote:

This fixes a couple of compilation errors that I have encountered on FreeBSD, minimizes a few Linux-esque dependencies, and generalizes some of the (Net)BSD handling so that the build works as a FreeBSD port.

  • Change #!/bin/bash -> #!/bin/sh as none of the scripts seem to require bash-specific functionality.

  • Similarly, gawk -> awk.

  • Fix compile error in jobexecutor.c.

  • The remainder of the changes are just compatibility changes for FreeBSD. (For the most part, FreeBSD can just use OSTYPE=netbsdelf, but not entirely.)
    You can merge this Pull Request by running:

    git pull https://github.com/jhriggs/schedulix freebsd-compat

Or you can view, comment on it, or merge it online at:

#5

-- Commit Summary --

  • Change shebang to /bin/sh for compatibility.
  • Use awk for compatibility.
  • Move the change directory option to make to be first.
  • Fix missing return value compilation failure.
  • Make the BSD handling less NetBSD specific, so that it works for FreeBSD also.

-- File Changes --

M bin/watch.sh (2)
M install/setup_example_jobservers.sh (2)
M install/setup_examples.sdms (6)
M src/Makefile (6)
M src/Makefile.CommonRules (8)
M src/jobserver/Makefile (10)
M src/jobserver/jobexecutor.c (13)
M src/utility/Makefile (8)
M src/utility/scrolllog.c (2)
M tools/bin/jay (2)
M tools/bin/jflex (2)
M zope/patch.sh (2)

-- Patch Links --

https://github.com/schedulix/schedulix/pull/5.patch
https://github.com/schedulix/schedulix/pull/5.diff


Reply to this email directly or view it on GitHub:
#5

independIT Integrative Technologies GmbH
Bergstrasse 6
86529 Schrobenhausen
HRB Ingolstadt 101.521
Geschäftsführer:
Dieter Stubler, Dipl. Inform. (FH)
Ronald Jeninga, Diplom Mathematiker

e-mail: ronald.jeninga@independit.de
web: http://www.independit.de
Tel: +49 9129 2969040
GSM: +49 1520 1849816
Fax: +49 8252 9658034

@jhriggs
Copy link
Author

jhriggs commented Oct 9, 2014

Yes, it goes without saying (or maybe it doesn't) that I have only tested these changes on FreeBSD, trying to get things working there...and this only gets it building. I haven't gotten to the point of actually running it there yet. ;-)

I can test the changes with some Linux distros if time allows, but I don't necessarily have a lot of time to set up the testing environment, so it may be faster for someone with an existing Linux setup to give them a go and make sure everything still works. I don't have access to or time for Solaris.

If there ends up being a problem with sh or awk, I can always make bash and/or gawk a dependency for the FreeBSD port, but fewer dependencies is always better. Or, it might be better if the makefile was more dynamic (similar to OSTYPE) so that more variables/args could be passed in. A full autoconf/automake setup with a configure script would be nice to sort some of these types of things out, but maybe that's overkill for your needs in this project.

@schedulix
Copy link
Owner

Hi Jim,

don't worry about linux. That's my native platform.
I have a Solaris for Intel VM, so I can test the Solaris part too.

Sure, an autoconf/automake would be nice, but considered the huge amount of C code (basically jobexecutor.c and scrolllog) it'll definitely feel like an overkill.
Since I've never written an autoconf/automake script myself, it'll require a bit of studying I guess.

If your changes work both in a linux and a solaris environment, I'll accept them and then the odds are good that other unix brands (AIX, HPUX, ...) won't have problems too.

Regards,

Ronald

On Thu, 09 Oct 2014 08:04:40 -0700
Jim Riggs notifications@github.com wrote:

Yes, it goes without saying (or maybe it doesn't) that I have only tested these changes on FreeBSD, trying to get things working there...and this only gets it building. I haven't gotten to the point of actually running it there yet. ;-)

I can test the changes with some Linux distros if time allows, but I don't necessarily have a lot of time to set up the testing environment, so it may be faster for someone with an existing Linux setup to give them a go and make sure everything still works. I don't have access to or time for Solaris.

If there ends up being a problem with sh or awk, I can always make bash and/or gawk a dependency for the FreeBSD port, but fewer dependencies is always better. Or, it might be better if the makefile was more dynamic (similar to OSTYPE) so that more variables/args could be passed in. A full autoconf/automake setup with a configure script would be nice to sort some of these types of things out, but maybe that's overkill for your needs in this project.


Reply to this email directly or view it on GitHub:
#5 (comment)

independIT Integrative Technologies GmbH
Bergstrasse 6
86529 Schrobenhausen
HRB Ingolstadt 101.521
Geschäftsführer:
Dieter Stubler, Dipl. Inform. (FH)
Ronald Jeninga, Diplom Mathematiker

e-mail: ronald.jeninga@independit.de
web: http://www.independit.de
Tel: +49 9129 2969040
GSM: +49 1520 1849816
Fax: +49 8252 9658034

Not all supported systems support `mknod ... p' but do seem to support mkfifo.
@schedulix
Copy link
Owner

Hi Jim,

so far I gratefully merged some of your suggestions (master branch):

  1. use mkfifo instead of mknod
  2. use printf instead of echo
  3. eliminated compile error because of missing return value in jobexecutor.c (I did a lot more here)
  4. exchange "change directory" and "makeflags"
  5. make BSD handling less FreeBSD specific

That makes 5 out of 7 so far.

The two others, use of /bin/sh instead of /bin/bash, as well as the use of awk instead of gawk require some more investigation.

One thing's for sure: in a solaris environment (I tested Solaris 10 so far, but IIRC the same applies to solaris 11), awk doesn't work, nawk does.
This leaves the following decision tree:

  1. if gawk is installed, use that, else
  2. if nawk is installed, use that, else
  3. use awk and hope for the best

Exchanging /bin/bash with /bin/sh shouldn't be a problem, but in order to make sure, I'd like to test this under solaris and some ubuntu linux.
The first uses a real bourne shell, and I don't expect problems. The latter uses dash (with /bin/sh linked to /bin/dash) per default, and I had problems with that shell more than once.

As you can see, progress is made.

Best regards,

Ronald

On Thu, 09 Oct 2014 08:04:40 -0700
Jim Riggs notifications@github.com wrote:

Yes, it goes without saying (or maybe it doesn't) that I have only tested these changes on FreeBSD, trying to get things working there...and this only gets it building. I haven't gotten to the point of actually running it there yet. ;-)

I can test the changes with some Linux distros if time allows, but I don't necessarily have a lot of time to set up the testing environment, so it may be faster for someone with an existing Linux setup to give them a go and make sure everything still works. I don't have access to or time for Solaris.

If there ends up being a problem with sh or awk, I can always make bash and/or gawk a dependency for the FreeBSD port, but fewer dependencies is always better. Or, it might be better if the makefile was more dynamic (similar to OSTYPE) so that more variables/args could be passed in. A full autoconf/automake setup with a configure script would be nice to sort some of these types of things out, but maybe that's overkill for your needs in this project.


Reply to this email directly or view it on GitHub:
#5 (comment)

independIT Integrative Technologies GmbH
Bergstrasse 6
86529 Schrobenhausen
HRB Ingolstadt 101.521
Geschäftsführer:
Dieter Stubler, Dipl. Inform. (FH)
Ronald Jeninga, Diplom Mathematiker

e-mail: ronald.jeninga@independit.de
web: http://www.independit.de
Tel: +49 9129 2969040
GSM: +49 1520 1849816
Fax: +49 8252 9658034

@jhriggs
Copy link
Author

jhriggs commented Oct 14, 2014

Yay! Progress is good! Thanks.

@schedulix
Copy link
Owner

I'm near releasing a stable 2.6.1. The only work left is a bit of documentation. I changed the Makefile.Commonrules such that it searches for the best awk available (with the logic described in my previous message).
The shebangs have been replaced as well.

If you feel like it and have some time, could you give it a try?

And if everything's OK, do you happen to know how to continue from here? I'm not a git(hub) specialist.

@schedulix schedulix closed this Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants