-
Notifications
You must be signed in to change notification settings - Fork 867
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
initial support for FreeBSD #1906
Conversation
cc: @bryanmacfarlane @vtbassmatt @chrisrpatterson @wfurt does dotnet support build self-contained app on FreeBSD? |
I'm investigating that @TingluoHuang The SDK support is in early stages. I did some tests yesterday and failed to produce self-contained app for HelloWorld. But that can be also packaging problem as there are no packages published on MyGet/NuGet. |
I got self-contained app working on FreeBSD. It is tricky at this moment but that should be easier once we get all packages published. Also note that the RID is still somewhat in flux and this change uses least specific like other OSes. Few more notes: |
…them to cli first
This should be ready @TingluoHuang . We have 2.142.1 running for several weeks and now we also have 2.144 building official builds. let me know if you have any questions. cc: @safern |
@wfurt i am not worry about the code change, but we do have work on the service (UI/acquisition) & doc side before we can add this new FreeBSD agent. |
that make sense. I can progress on Documentation and notes. Even if not part of official builds this change helps others to make builds as needed. (and possibly takes that from me) It is also harder to keep up with other changes and keep this PR fresh. |
CI tests all green. sorry for the turn. |
It would be really awesome to have a FreeBSD agent |
Any more thoughts on this @bryanmacfarlane @vtbassmatt @chrisrpatterson @TingluoHuang |
Unfortunately, we can't pursue a FreeBSD agent right now. We don't have official .NET Core support for the platform, and my team can't take on the responsibility for maintaining shims or compat hacks. |
Maybe you misunderstood the ask @vtbassmatt. This is not about your team taking responsibility or producing builds. Look at it as community support at this moment. This is essential for .NET Core building up FreeBSD support. It is dependency loop problem. Without build agent we will not be able ever have official support. |
@wfurt is there some documentation on how to build this? I tried but ran into issues. Thanks. |
I'll update PR to resolve conflicts and I'll post notes later @vkrasnov. |
This is the single missing feature that keeps us from choosing Azure Pipelines. |
I updated freebsd branch. One can build with following commands:
There is no FreeBSD in 2.x and there was no easy way how to make it configurable. Note, that .Net on FreeBSD is not complete and production quality. As early adopters you may run to issues. If so, please report on corefx or coreclr repo with os-freebsd label. Most testing was done on 11.2. 12.0 had reported issue with thread locking and it should be fixed in FreeBSD updates as well as there is workaround. If you running on Azure instance and if you use /mnt/resource volume, add following line to /etc/fstab good luck. |
Thank you Tomas. When trying to build on an azure FreeBSD 11.2 instance I get this:
Should I report to coreclr? |
Never mind, the problem was too little RAM, resizing to an 8GB instance solved the problem! |
I can confirm that this works on FreeBSD 11.2, on clean install also requires: And 8GB of RAM (to build) |
I thought the canonical way of doing this was “/usr/bin/env bash”? That’s what we’ve done in lots of the dotnet build-scripts to make them fully portable. |
This is not complete change @josteink. For one we need to target 3.0 as well as use different SDK version. But at least this would get us to more manageable state. |
Apparently I can't comment on the code directly, so I'll leave some notes here:
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <libprocstat.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
if (argc != 2)
{
fprintf(stderr, "PID not specified\n");
return -1;
}
pid_t pid = strtol(argv[1], NULL, 0);
struct procstat *ps = procstat_open_sysctl();
unsigned count;
struct kinfo_proc *proc = procstat_getprocs(ps, KERN_PROC_PID, pid,
&count);
if (count != 1)
{
fprintf(stderr, "Failed to get process\n");
return -1;
}
// env is owned by proc.
char **env = procstat_getenvv(ps, proc, 0);
for (char **e=env ; *e != NULL ; e++)
{
puts(*e);
}
procstat_freeenvv(ps);
procstat_freeprocs(ps, proc);
procstat_close(ps);
return 0;
} |
Until .NET has FreeBSD on their roadmap for official support, we can't commit to this. (There's a chicken-and-egg problem in that they need a Pipelines agent before they can ship. I could break that cycle if we had directional alignment.) The most recent comment I found indicates that this is still not on the roadmap, so I'm going to close this PR. Again, we're very open to doing this once it appears on .NET's horizons for real. |
Is it possible to build the agent with another .NET implementation? Mono is supported on FreeBSD, for example. |
@davidchisnall it's probably possible. And as an open source codebase, we wouldn't dare try to stop someone from doing so on their own effort. But without either .NET (with whom we have a special relationship, since we are their CI platform and they are our implementation platform) or a large enough community desire, we can't commit to the maintenance & support overhead. And FWIW, we recently added two features which would make it easier to maintain a fork:
There are probably a lot of Linux-isms in the adjunct code (config.sh, run.sh, installdependencies.sh, and so on). Also, I spoke with someone (possibly you?) and learned that there are a lot of differences in container details, which rules out a pretty big swath of our features. |
Thanks. We are working on a collaboration with ARM, the University of Cambridge, and others under the Digital Security By Design Industrial Strategy Challenge Fund (£70m UK government funding, over £100m industry matched funding) and the demonstration platform there is all FreeBSD-based. Lack of support here is the blocker for our partners to use Azure for CI, so a way of unblocking this would be very helpful. We are also considering adding Cirrus CI to Microsoft/snmalloc, so that we can avoid regressions in our FreeBSD implementation, but it's not a great look for a Microsoft GitHub project to use non-Microsoft CI, so we'd much prefer to see a fully supported offering in Azure Pipelines. |
FreeBSD support is coming back in .NET5. Current strategy is to cross-compile native code on Linux (and use Linux agents) |
I can provide an implementation of the azure-pipelines-agent (version 2.165.2) for FreeBSD. It was built using the .NET Core SDK and essential NuGet packages mentioned on this wiki page. |
@joperator I'd be happy to help. |
This needs more testing but it somewhat builds and runs.
cc: @jonfortescue @MattGal