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

Support FreeBSD #49

Closed
4 tasks
Tracked by #14
unflxw opened this issue May 9, 2023 · 5 comments
Closed
4 tasks
Tracked by #14

Support FreeBSD #49

unflxw opened this issue May 9, 2023 · 5 comments
Labels

Comments

@unflxw
Copy link
Contributor

unflxw commented May 9, 2023

Our other integrations have FreeBSD support, but it was not implemented when adding other platform support because there was no easy way to test it. This issue is about implementing it and testing it the hard way, with a FreeBSD VirtualBox.

To do

  • Add FreeBSD entry (or entries) to the build-triple-to-platform-tag map.
    • In this map, the key is the Rust-like build triple, as it appears on agent.py, while the platform tag is "simply" the output of some platform-dependent Python function in that platform, except for all the cases where it is not. 🙃 I tried looking for an existing example in PyPI's package list, filtering by the FreeBSD support category, but couldn't find one. You may need to boot a FreeBSD machine to figure out what the right value is.
    • If you can figure out if the "manylinux" spec somehow applies for FreeBSD, that would be neat, as it would allow us to specify which libc we depend on. I don't think it does, though.
  • Release a build with FreeBSD artifacts to TestPyPI.
  • Test with a FreeBSD virtual machine that pip install appsignal (with the --index-url bits to force installation from TestPyPI) installs the right version of the package. Make sure the agent boots.

Alternative todo list if the above is ETOOHARD:

@backlog-helper
Copy link

backlog-helper bot commented May 9, 2023

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

@tombruijn
Copy link
Member

tombruijn commented Jun 7, 2023

On a FreeBSD 13 VM:

$ sudo pkg install python311-3.11.2_2
$ python3.11
>>> import distutils
<stdin>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
>>> distutils.util.get_platform()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'distutils' has no attribute 'util'

Alternative way that does work on FreeBSD:

>>> import platform
>>> platform.platform()
'FreeBSD-13.2-RELEASE-amd64-64bit-ELF'

This new module seems to output some other kind of key format. What's the expected output format here?

I also see that the macOS keys map to a 10_9 and 12_3 version, while my laptop outputs: 'macOS-13.4-arm64-arm-64bit'. Do we need to map every macOS version as well?

Edit: Ah some docs about this: https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/

@unflxw
Copy link
Contributor Author

unflxw commented Jul 31, 2023

@tombruijn I'm not sure what platform.platform() is. The internet says that sysconfig.get_platform() is the replacement we should look at. In my local machine, these give slightly different results to platform.platform():

>>> import distutils; distutils.util.get_platform()
'macosx-12.6-x86_64'
>>> import sysconfig; sysconfig.get_platform()
'macosx-12.6-x86_64'
>>> import platform; platform.platform()
'macOS-12.6-x86_64-i386-64bit'

I'm also not sure about the current macOS versions specified. I cargo-culted them from somewhere. I don't think we need to specify them exhaustively, but it does seem that they matter somewhat.

Some old conversations online imply that the value provided by distutils.util.get_platform() is not useful for FreeBSD. That, combined with the fact that I've not been able to find any package for FreeBSD published on PyPI (not even numpy, which is probably the most popular Python package with a C extension) and that popular Python packages seem to be published as FreeBSD ports, makes me think that this might not be feasible. It might be that the best we can do is publish a link to a .whl somewhere for manual install.

Of course, I don't really know, because the documentation around all of this is incomplete and inaccurate and outdated. It's quite frustrating.

@tombruijn
Copy link
Member

Before we ship anything, this issue is blocked on general FreeBSD support in https://github.com/appsignal/support/issues/118

@tombruijn
Copy link
Member

We will not support FreeBSD for now: https://github.com/appsignal/support/issues/118
Docs are updated here: https://docs.appsignal.com/support/operating-systems.html

@tombruijn tombruijn closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants