zephir
zephir copied to clipboard
Better Support FreeBSD
I was working to get this ported to FreeBSD. There are some issues I hit that I can work around but would be nice to have addressed.
- [x] Use
#!/usr/bin/env bash
instead of#!/bin/bash
- FreeBSD never installs packages to /bin, and bash is installed as a package since it is not the default shell.
- [x] Make 'bin/zepher' completely POSIX compliant to drop the dependency for bash
- This might not be doable in a clean way so we may need to skip this.
- [x] Make 'parser/parser/build_linux.sh' completely POSIX compliant to drop the dependency for bash
- [x] Execute 'parser/parser/build_linux.sh' using /bin/sh instead of directly so this script doesn't necessarily need execute permissions.
- [ ] Replace instances of "gcc" with "cc" to drop the dependency for gcc
- When I tested compiling an extension without gcc installed it failed because gcc was missing. I might be able to work around this by setting the CC variable to cc, but I did not have time to test this.
- [ ] Drop dependency for sudo
- It would be nice to allow systems admins, that do not have sudo installed to still install extensions. I noticed when I built an extension as root, without sudo installed, the extension was silently not installed.
- Maybe this could be accomplished with su? If not, we can just disregard this.
I had a possible idea to tackle the sudo point. Maybe we could do a check on the current UID and only use sudo if it is not '0'?
@josh4trunks I like this approach
Is there any reason https://github.com/phalcon/zephir/blob/master/Library/Compiler.php and https://github.com/phalcon/zephir/blob/master/parser/parser/build_linux.sh have gcc
/ CC="gcc"
instead of cc
?
@andresgutierrez
Any word on the the need for GCC?
It would be great to get this working by the next zephir release. That way we could add a stable version to the ports tree. See the request here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211144
@josh4trunks Any progress?
I submitted the port for review and no FreeBSD ports reviewer has looked at it =
I could try authoring a new bug report (since I did not start that one) maybe that would get more attention.
Also see: phalcon/cphalcon#12473
Hi all,
I’m revisiting this. I’ve got connections to FreeBSD commiters so we should be able to make this happen pretty quickly.
I’ve got the parser port done, now just working through the Zephir port.
Ports for both Zephir (lang/zephir) and Zephir parser (textproc/pecl-zephir_parser) are available here for testing https://github.com/theonemcdonald/FreeBSD-ports/tree/add-zephir
Still need to write a patch to support clang on FreeBSD, which is preferred due to licensing reasons.
https://www.freshports.org/lang/zephir/ https://www.freshports.org/textproc/pecl-zephir_parser/