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 support for FreeBSD #4872

Closed
wants to merge 7 commits into from
Closed

Add support for FreeBSD #4872

wants to merge 7 commits into from

Conversation

jjhelmus
Copy link
Contributor

@jjhelmus jjhelmus commented May 5, 2023

Description

  • Add support for FreeBSD platform and the freebsd-64 subdir.
  • Update some non-POSIX uses of source and a patch argument which are not supported on FreeBSD.
  • Document the new freebsd selector and clarify that unix includes the FreeBSD platform.
  • Use bash on FreeBSD rather than the default shell given the numerous uses of bashisms in recipes.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label May 5, 2023
@jjhelmus
Copy link
Contributor Author

jjhelmus commented May 5, 2023

This requires the changes to conda in conda/conda#12647.

jezdez
jezdez previously approved these changes Jun 5, 2023
Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

conda_build/build.py Show resolved Hide resolved
Comment on lines 583 to 587
elif host_platform.startswith("linux"):
return ".so"
elif host_platform.startswith("freebsd"):
return ".so"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elif host_platform.startswith("linux"):
return ".so"
elif host_platform.startswith("freebsd"):
return ".so"
elif host_platform.startswith(("freebsd", "linux")):
return ".so"

@jezdez jezdez force-pushed the freebsd branch 2 times, most recently from 07093c0 to 683d26b Compare June 7, 2023 20:09
* Add support for the FreeBSD platform and the freebsd-64 subdir.
* The platform uses .so extensions, elffiles, and defaults to a clang toolchain.
* Add a freebsd selector and include the freebsd platform in the unix
  selector.
Use the portable and POSIX-standard '.' to execute commands in scripts
on non-Windows platforms rather than the non-portable 'source' command.

Note that on FreeBSD, source is not provided by the default install or
shell.
Use the --posix argument to prevent patch from making backup files
rather than the --no-backup-if-mismatch argument which is specific to
GNU patch and not supported by various *BSD implementations.
Many conda recipe build files use shell syntax and commands that are
specific to bash and not POSIX shells.

Given the large number of these that occur it is easier run the build
script in bash than convert them. On Linux and macOS, bash is already
used explicitly.

On FreeBSD, bash is not part of the base system and must be installed
via ports. The install location is /usr/local/bin/bash.
@jjhelmus
Copy link
Contributor Author

If there is interest in this it might be worth reverting the patch changes in ca1cbdd and requiring GNU patch when running conda-build. When I was building packages on FreeBSD I ran into a number of problem applying patches with the patch utility that is part of FreeBSD's base system. GNU patch is available as a port or can be built from source on FreeBSD.

@isuruf
Copy link
Contributor

isuruf commented Oct 16, 2023

Isn't GNU patch a run requirement of conda-build? I would guess that the patch executable from conda-build's environment would get picked over the system one.

Copy link

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Oct 16, 2024
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Nov 15, 2024
@github-actions github-actions bot closed this Nov 15, 2024
@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA stale::recovered [bot] recovered after being marked as stale
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants