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 *BSD / Solaris to the CI #1400

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Add *BSD / Solaris to the CI #1400

merged 5 commits into from
Feb 29, 2024

Conversation

fraggerfox
Copy link
Contributor

@fraggerfox fraggerfox commented Feb 24, 2024

Add support for building htop in DragonFlyBSD / FreeBSD / NetBSD / OpenBSD / Solaris environments in the CI workflow.

NOTE: In future, this should help catch any changes that can potentially break the BSD / Solaris builds.

Workflows adapted from btop's GHAs.

@fraggerfox fraggerfox force-pushed the add-bsd-to-ci branch 8 times, most recently from 9d4a2cf to 3efdcec Compare February 24, 2024 12:49
@fraggerfox fraggerfox changed the title Add NetBSD to the ci. Add FreeBSD / NetBSD / OpenBSD to the ci. Feb 24, 2024
@fraggerfox fraggerfox marked this pull request as ready for review February 24, 2024 12:58
@BenBE BenBE added build system 🔧 Affects the build system rather then the user experience FreeBSD 👹 FreeBSD related issues NetBSD 🎏 NetBSD related issues OpenBSD 🐡 OpenBSD related issues labels Feb 24, 2024
@fraggerfox fraggerfox force-pushed the add-bsd-to-ci branch 5 times, most recently from 4692e6e to 00bca18 Compare February 25, 2024 14:51
@Explorer09
Copy link
Contributor

Your latest DragonFlyBSD commit (00bca18) caused a build failure, and I noticed one thing in the build log: The configure scripts detected gcc and tried to use it instead of clang. Did you notice that?

Also, the line mv htop htop-clang-"$GIT_HASH" got run even when make produced errors. (What's the purpose of this rename, by the way?)

@fraggerfox
Copy link
Contributor Author

fraggerfox commented Feb 26, 2024

Your latest DragonFlyBSD commit (00bca18) caused a build failure, and I noticed one thing in the build log: The configure scripts detected gcc and tried to use it instead of clang. Did you notice that?

Yes, I was just testing out how DragonFlyBSD works, I was assuming it would be using clang instead of gcc (like in FreeBSD), but that is a minor change to do. I was more curious on the missing ncurses library. I am trying to get a copy of DragonFlyBSD to boot locally in my system so that I can check this out.

Also, the line mv htop htop-clang-"$GIT_HASH" got run even when make produced errors. (What's the purpose of this rename, by the way?)

The rename if it fails (i.e. the binary was not built) would cause the workflow to fail, I did that since it is the easiest way I could check if the build failed or not.

An example of a build failure but not a failed step can be found here

@BenBE BenBE added Solaris Solaris, Illumos, OmniOS, OpenIndiana DragonflyBSD 🪰 DragonflyBSD related issues labels Feb 26, 2024
@BenBE BenBE added this to the 3.4.0 milestone Feb 26, 2024
@fraggerfox fraggerfox force-pushed the add-bsd-to-ci branch 2 times, most recently from bf43829 to 3908c1c Compare February 26, 2024 11:36
@BenBE
Copy link
Member

BenBE commented Feb 26, 2024

No Unicode support on NetBSD/OpenBSD?

@fraggerfox
Copy link
Contributor Author

An example of a build failure but not a failed step can be found here

* https://github.com/htop-dev/htop/actions/runs/8029660529/job/21936201103#step:3:1724

Does a "set -e" line work within a CI script file? That could save you some || exit 1 code there.

I tested out this suggestion and it seem to have worked. Thank you.

I have updated the file with the changes.

@fraggerfox fraggerfox changed the title Add DragonFly BSD / FreeBSD / NetBSD / OpenBSD / Solaris to the ci. Add DragonFlyBSD / FreeBSD / NetBSD / OpenBSD / Solaris to the ci. Feb 26, 2024
Copy link
Member

@BenBE BenBE left a comment

Choose a reason for hiding this comment

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

LGTM.

You could fixup the set -e patch into the individual platforms, but that's optional.

@BenBE BenBE requested review from fasterit and Explorer09 and removed request for Explorer09 February 26, 2024 13:27
@BenBE BenBE changed the title Add DragonFlyBSD / FreeBSD / NetBSD / OpenBSD / Solaris to the ci. Add *BSD / Solaris to the CI Feb 26, 2024
export CFLAGS="-I/usr/local/include"
./autogen.sh
./configure --enable-unicode
gmake
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the -k option to the gmake commands. This would keep the make program running even when there's a build error on one object file. Useful for catching multiple source file errors.
(Other platform targets in this .yml file have this -k option.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I have updated the command.

Copy link
Member

Choose a reason for hiding this comment

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

Same should be done for regular make too … Good point.

@BenBE
Copy link
Member

BenBE commented Feb 26, 2024

Some ideas, no need to implement them right now:

  • What about ZFS support on FreeBSD/NetBSD? Shouldn't we try to build on the CI with such support enabled?
  • What about PCP builds? @natoscott AFAIR PCP should build on all platforms¹, right?
  • Other optional libs we should test in the CI?

¹given the right dependencies are installed

@fasterit
Copy link
Member

What about ZFS support on FreeBSD/NetBSD? Shouldn't we try to build on the CI with such support enabled?

This is not gated by a config-flag. So it is build in automatically (on FreeBSD).
Now, having test-cases is another thing...

/DLange

@natoscott
Copy link
Member

Some ideas, no need to implement them right now:
[...]
* What about PCP builds? @natoscott AFAIR PCP should build on all platforms¹, right?
¹given the right dependencies are installed

Yes, many platforms are supported by PCP - the issue will be ensuring the PCP bits are readily accessible on non-Linux platforms.

If possible, it'd be great to get PCP builds for non-Linux platforms here in htop.dev repo, however in practice I think it will be more practical for this to happen via the actual PCP build (which builds a vendored htop git repo via git-subtree). Perhaps best will be if we automate the sync between PCP and htop (currently its manual) so that commits here automatically trigger a PCP build.

https://github.com/performancecopilot/pcp/tree/main/vendor/github.com/htop-dev/htop

@BenBE
Copy link
Member

BenBE commented Feb 27, 2024

@natoscott Thus it's best to skip the PCP stuff in this PR.

@BenBE BenBE merged commit 4feac8e into htop-dev:main Feb 29, 2024
17 checks passed
@fraggerfox fraggerfox deleted the add-bsd-to-ci branch March 16, 2024 09:51
@Explorer09
Copy link
Contributor

May I bump this PR and mention an issue of it?

The "build-openbsd-latest-gcc" CI job in commit 1fa7d6c does not actually run GCC, but Clang under the program name "cc" ! I discovered this when it build-failed in one of my commits and threw me a compile warning. Please either correct the job name or do something to let GCC run in there.

@fraggerfox
Copy link
Contributor Author

May I bump this PR and mention an issue of it?

The "build-openbsd-latest-gcc" CI job in commit 1fa7d6c does not actually run GCC, but Clang under the program name "cc" ! I discovered this when it build-failed in one of my commits and threw me a compile warning. Please either correct the job name or do something to let GCC run in there.

You are right, I also over looked this, I can raise a PR to fix this and update the name to clang instead of gcc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system 🔧 Affects the build system rather then the user experience DragonflyBSD 🪰 DragonflyBSD related issues FreeBSD 👹 FreeBSD related issues NetBSD 🎏 NetBSD related issues OpenBSD 🐡 OpenBSD related issues Solaris Solaris, Illumos, OmniOS, OpenIndiana
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants