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

Provide binaries for FreeBSD #849

Closed
ararslan opened this issue Aug 16, 2022 · 6 comments
Closed

Provide binaries for FreeBSD #849

ararslan opened this issue Aug 16, 2022 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ararslan
Copy link

Is your feature request related to a problem? Please describe.

FreeBSD builds are offered by two CI providers supported by the official Codecov uploader: Cirrus and Travis. However, coverage information collected on FreeBSD can't be submitted to Codecov via the uploader since there is no FreeBSD binary for it. That means that software designed for FreeBSD that runs its tests on CI can't use Codecov's official uploader.

Describe the solution you'd like

It would be great to be able to upload results to Codecov from FreeBSD using the official uploader. Ideally the binary would be installable in the same way as for Linux.

Describe alternatives you've considered

There are a few alternatives that I can think of:

  1. Community support for the binary, likely via a port. At least in my mind, this somewhat defeats the purpose of the centralized, single-source-of-truth uploader, as it means that there's a separate distribution and maintenance mechanism from that of the other platforms. There is some discussion relevant to that point in Document upload API so other projects can implement it feedback#226.

  2. Use the Linux binary with FreeBSD's Linux binary compatibility. I gave this a whirl in Support uploading code coverage to Codecov ararslan/CirrusCI.jl#11 and, while it actually does successfully submit coverage, the process hangs until the CI step times out and I've yet to determine why. That would be a rather suboptimal user experience.

Additional context

The uploader uses the Node.js package pkg for static compilation, which doesn't officially support FreeBSD but lets you try to build for it (see https://github.com/vercel/pkg#targets). pkg in turn uses pkg-fetch, which actively does not support FreeBSD (see https://github.com/vercel/pkg-fetch/issues/39#issuecomment-1023748139). I imagine this will complicate matters.

If you're interested in supporting FreeBSD, the amazing @lwhsu has offered to see what the FreeBSD Project and the FreeBSD Foundation can do to help.

@drazisil-codecov drazisil-codecov added enhancement New feature or request help wanted Extra attention is needed labels Aug 16, 2022
@drazisil-codecov
Copy link
Contributor

Hi @ararslan and @lwhsu,

This requires far more stakeholders than myself to decide, but I like the idea!

I have some questions (which might become more):

  • I'm not seeing a NodeJS build for FreeBSD: https://nodejs.org/en/download/. Does that mean it would need to be compiled from scratch, similar to what we are/were doing with Alpine? https://github.com/codecov/node-alpine-static

  • What C lib does FreeBSD use? Linux uses libc and Apline uses musl. Can it be statically compiled?

  • What are we expecting in terms of a static compiled standalone zero-dependency binary? Customers have already raised concerns regarding the size of the existing binaries.

  • If we went with a container image, as requested here Container image #744, would that work?

@ararslan
Copy link
Author

Hi @drazisil-codecov, thanks for the response! Li-Wen can surely provide better details than I can but in the meantime I'll do my best to answer your questions.

I'm not seeing a NodeJS build for FreeBSD: https://nodejs.org/en/download/. Does that mean it would need to be compiled from scratch, similar to what we are/were doing with Alpine?

Node on FreeBSD is community-supported but prebuilt binaries are available via the system package manager, pkg. It could alternatively be compiled from source but would require (at least some of) the patches used by the port. Apparently the Node package pkg (not the system package manager) also applies its own set of patches to Node: https://github.com/vercel/pkg#build.

What C lib does FreeBSD use?

The BSDs (including macOS 😄) each have their own libc. Some very basic information about FreeBSD's is available here.

Can it be statically compiled?

There is a /usr/lib/libc.a alongside /usr/lib/libc.so so I assume so but I'm not sure what it takes to compile it yourself.

What are we expecting in terms of a static compiled standalone zero-dependency binary?

How do you mean? Expecting in terms of size?

If we went with a container image

I guess it depends on the kind of container you mean. Containerization on FreeBSD is primarily done via a mechanism called "jails" rather than something like Docker. You can run Linux inside of a jail on FreeBSD but it goes through the same binary compatibility stuff that I mentioned in the OP so you'd likely hit the same issue.

@drazisil-codecov
Copy link
Contributor

What are we expecting in terms of a static compiled standalone zero-dependency binary?

How do you mean? Expecting in terms of size?

Yes, sorry I forgot an important word there. 😓

Yes, in terms of the size of the binary

@drazisil-codecov
Copy link
Contributor

@ararslan

It sounds like there is a lot of work involved then if it even ends up being possible. Happy to accept PRs if the community would like to give it a shot. I don't know if we have the bandwidth to investigate adding this support at this time :-/

@ararslan
Copy link
Author

Yes, in terms of the size of the binary

Unfortunately I don't have a good sense of that but I can't imagine it'd be meaningfully different than the one for Linux.

It sounds like there is a lot of work involved then if it even ends up being possible.

I do suspect it is possible but would be an undertaking.

Happy to accept PRs if the community would like to give it a shot. I don't know if we have the bandwidth to investigate adding this support at this time :-/

Totally, totally understand! I'll keep poking at using the Linux binary as that would be the simplest solution if I can get it to work. Hopefully Li-Wen and/or the other FreeBSD folks are able to take a look; if a roadmap of sorts with the steps required for native support can be laid out, I imagine that could make engaging the broader FreeBSD community easier as there would be well-defined tasks to tackle.

Thanks again for your responsiveness and consideration, @drazisil-codecov!

@thomasrockhu-codecov
Copy link
Contributor

Going to close this out for now. @ararslan please feel free to open if you get something working on the Linux binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants