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

windows: build docs and tweaks #7463

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

ringerc
Copy link
Contributor

@ringerc ringerc commented May 24, 2023

Docs and minor CMake build tweaks for Windows builds

  • Abort cmake early if flex, bison or openssl missing on windows builds, since the build is not tested without them and is currently known to fail if they are missing. See plugins: exec: exit fluent-bit after oneshot and propagate exit code #7207 for context.
  • Enable workflow_dispatch for .github/workflows/pr-windows-build.yaml so users of forked repos can run it manually on their branches via their github repo Actions tab. The workflow must have workflow_dispatch in the default (master) branch for this to work, so it's sensible to have this pre-defined.
  • add Windows build section in DEVELOPER_GUIDE.md
  • x-ref comments in the various windows CI files to point to each other and the docs

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@ringerc
Copy link
Contributor Author

ringerc commented May 24, 2023

IDK why the docs-required label was added. No external docs are required.

@ringerc
Copy link
Contributor Author

ringerc commented May 24, 2023

Here's an example run of the windows PR checker, invoked via "Actions" tab on my fork repo https://github.com/ringerc/fluent-bit , to show that the instructions in the new README are valid: https://github.com/ringerc/fluent-bit/actions/runs/5063461747

Since fluent/fluent-bit upstream doesn't have the workflow_dispatch for the workflow in the master branch yet, I had to merge this branch into my fork's master before I could use it. This won't be required for new forks once this PR is merged upstream, or for forks that update their fork master branches.

@ringerc ringerc force-pushed the windows-build-docs-and-tweaks branch from fa6048d to d8596fe Compare May 24, 2023 00:57
@ringerc
Copy link
Contributor Author

ringerc commented May 24, 2023

I think the PR template should also be changed to remove the request to run Valgrind, unless someone's going to make fluent-bit Valgrind-clean. Right now it's so noisy on master that there's absolutely no point asking people to use Valgrind on their PRs.

@ringerc
Copy link
Contributor Author

ringerc commented May 24, 2023

Showing that running the windows workflow on my fork works as a way to build fluent-bit patches w/o needing to go through all the windows pain:

https://github.com/ringerc/fluent-bit/actions/runs/5063461747/jobs/9090178755

image

image

Not pretty, for sure, and slow as can be, but good enough for one-shot work. It'd be a lot better if there was a base container image canned in ghcr with the deps preinstalled.

@ringerc ringerc force-pushed the windows-build-docs-and-tweaks branch from d8596fe to ba8b78d Compare May 24, 2023 01:41
@ringerc
Copy link
Contributor Author

ringerc commented May 24, 2023

Fixed DCO

@ringerc ringerc temporarily deployed to pr May 24, 2023 06:14 — with GitHub Actions Inactive
@ringerc ringerc temporarily deployed to pr May 24, 2023 06:14 — with GitHub Actions Inactive
@ringerc ringerc temporarily deployed to pr May 24, 2023 06:14 — with GitHub Actions Inactive
@ringerc ringerc temporarily deployed to pr May 24, 2023 06:35 — with GitHub Actions Inactive
@patrick-stephens patrick-stephens changed the title Windows build docs and tweaks windows: build docs and tweaks May 24, 2023
# The build will fail later if flex and bison are missing, so there's no
# point attempting to continue. There's no test cover for windows builds
# without FLB_PARSER anyway.
message(FATAL_ERROR "flex and bison not found, see DEVELOPER_GUIDE.md")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also say there's no way to actually build a lot of the plugins with FLB_RECORD_ACCESSOR=No as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sensible, feel free to raise a suggestion on the PR and I'll merge

@patrick-stephens
Copy link
Contributor

All looks fine, just the usual macOS failures @leonardo-albertovich

@leonardo-albertovich
Copy link
Collaborator

Looks good, the only thing I would personally change would be switching chocolatey for vcpkg for openssl and libyaml but that's just because it's what I use.

Lately I have been using it in a virtualized windows 11 environment in my mac which means I was able to install and use x86, x86_64 and aarch64 versions of those libraries side by side (I explicitly did the same thing in the three different developer shell types) and it worked perfectly.

@ringerc
Copy link
Contributor Author

ringerc commented Jun 2, 2023

@leonardo-albertovich I'm not interested in expanding this cleanup to require more changes or testing than are scoped in the current PR - such as changing tools used to install things etc. This is meant to be a minimal and targeted PR for the issues I tripped over while trying to satisfy the requests for Windows support on my exec plugin patch.

ringerc added 3 commits July 7, 2023 12:23
The dev guide had no references for how to build or test for windows at
all. Add a short section with some minimal info and guidance for where
to find more detailed resources.

I didn't want to write extensive docs on this, especially as they're
likely to be unmaintained and go stale, so the user is expected to look
at the CI automation files to extract required library URLs, commands
etc.

Signed-off-by: Craig Ringer <[email protected]>
Windows builds will fail if flex, bison or the OpenSSL libraries
are missing. So modify the CMake code to ensure that we fail at
CMake time, rather than during the subsequent build.

Signed-off-by: Craig Ringer <[email protected]>
Add comments on the Windows workflows to cross-reference them
with each other and the new DEVELOPER_GUIDE.md docs section for Windows
builds.

Add a short note to the windows PR workflow on how to run it manually
on a forked repo when submitting patches.

Signed-off-by: Craig Ringer <[email protected]>
@ringerc ringerc force-pushed the windows-build-docs-and-tweaks branch from ba8b78d to 8fbc1e9 Compare July 7, 2023 00:23
@ringerc ringerc mentioned this pull request Jul 7, 2023
2 tasks
@ringerc ringerc temporarily deployed to pr July 7, 2023 00:30 — with GitHub Actions Inactive
@ringerc ringerc temporarily deployed to pr July 7, 2023 00:30 — with GitHub Actions Inactive
@ringerc ringerc temporarily deployed to pr July 7, 2023 00:30 — with GitHub Actions Inactive
@ringerc ringerc temporarily deployed to pr July 7, 2023 00:52 — with GitHub Actions Inactive
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Dec 10, 2023
@edsiper edsiper merged commit ff2962f into fluent:master Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants