Add FreeBSD support - #10987
Conversation
Signed-off-by: Igor Sokolov <disk.destroyer@yahoo.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for FreeBSD by adding package installation steps in DependencyInstaller.sh and configuring search paths and compiler definitions in src/CMakeLists.txt. Feedback on these changes includes guarding the FreeBSD package installation to only run when installing base or all packages (as it requires root privileges), and fixing a minor indentation issue. Additionally, in src/CMakeLists.txt, it is recommended to append /usr/local to CMAKE_PREFIX_PATH at the top of the file instead of using legacy global directory commands, and to use target_compile_definitions directly on the openroad target to ensure the _GNU_SOURCE definition is correctly applied.
| "FreeBSD") | ||
| _install_freebsd_packages | ||
| cat <<EOF | ||
| FreeBSD installs \`tclsh\` binary as \`tclsh86\` and any python 3 version as \`python3.XX\`, | ||
| not \`python3\`, you'll have to make symlinks to those programs yourself. | ||
| EOF | ||
| ;; |
There was a problem hiding this comment.
There are two issues with this block:
- Unconditional Execution:
_install_freebsd_packagesis called unconditionally on FreeBSD, even if the user ran the script with-common(which is intended for non-root local prefix installations). Sincepkgrequires root privileges, this will fail or prompt for root unexpectedly. It should be guarded to only run whenoptionisbaseorall. - Indentation: Line 1505 uses a literal tab character for indentation, whereas the rest of the script consistently uses spaces.
| "FreeBSD") | |
| _install_freebsd_packages | |
| cat <<EOF | |
| FreeBSD installs \`tclsh\` binary as \`tclsh86\` and any python 3 version as \`python3.XX\`, | |
| not \`python3\`, you'll have to make symlinks to those programs yourself. | |
| EOF | |
| ;; | |
| "FreeBSD") | |
| if [[ "${option}" == "base" || "${option}" == "all" ]]; then | |
| _install_freebsd_packages | |
| fi | |
| cat <<EOF | |
| FreeBSD installs \`tclsh\` binary as \`tclsh86\` and any python 3 version as \`python3.XX\`, | |
| not \`python3\`, you'll have to make symlinks to those programs yourself. | |
| EOF | |
| ;; |
still hacky, needs a lot more work to make it appropriate Signed-off-by: Igor Sokolov <disk.destroyer@yahoo.com>
|
Got a successful Bazel build, but it requires modifying third-party rules and/or switching rule versions. Also a lot of issues with GNU-isms. Too much work, closing this. |
Summary
FreeBSD has all the dependencies available in the default
pkgrepository, requires only minor changes to the build system and runs absolutely fine, BUT there are some concerns:third-party/abchas amakecall hardcoded inCmakeLists.txt- logic to switch togmakeon FreeBSD is needed (otherwise the build fails).tclshandpython3binaries are absent, FreeBSD uses a different naming scheme - either the user will have to make the symlinks (eg., frompython3.12topython3) or the source files will have to be configured to use the proper names../etc/use bash, which is not present on the base system. IMHO, using bash for the dependency installer is superfluous, since most of the "bashisms" can be easily replaced with POSIX alternatives without affecting code readability. Or users can simply be told to install bash.