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

ci: add windows build #6563

Merged

Conversation

PastaPastaPasta
Copy link
Member

@PastaPastaPasta PastaPastaPasta commented Feb 7, 2025

Issue being fixed or feature implemented

add in windows builds to GitHub Actions based CI

What was done?

How Has This Been Tested?

Breaking Changes

Checklist:

Go over all the following points, and put an x in all the boxes that apply.

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@PastaPastaPasta PastaPastaPasta added this to the 23 milestone Feb 7, 2025
Copy link

coderabbitai bot commented Feb 7, 2025

Walkthrough

The changes modify the GitHub Actions workflow and a unit test script. In the workflow configuration, a new Windows build target (win64) is added to both the dependency build and main build jobs by including new matrix entries with the corresponding host specification. In the unit test script, an environment variable (WINEPREFIX) is defined with a temporary directory value, and the directory is created if it does not already exist. These modifications adjust the build matrix to support Windows and prepare the test environment for Wine without altering the existing logic in either the build process or the test execution.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1930572 and 30abb97.

📒 Files selected for processing (2)
  • .github/workflows/build.yml (2 hunks)
  • ci/dash/test_unittests.sh (1 hunks)
🔇 Additional comments (3)
ci/dash/test_unittests.sh (1)

27-29: Wine Environment Setup: Validate Unconditional Creation of WINEPREFIX

The added lines correctly set the Wine prefix and ensure that the designated directory exists. Since these variables are only used when running Wine-based tests (in the "$DIRECT_WINE_EXEC_TESTS" branch), confirm that using them unconditionally does not affect non-Windows builds. If preferred, consider conditionally setting WINEPREFIX only when "$DIRECT_WINE_EXEC_TESTS" is true or when the build target is Windows.

.github/workflows/build.yml (2)

70-71: Win64 Matrix Entry in Build-Depends: Correct Addition

The new matrix entry for the Windows target in the build-depends job is properly added with the appropriate host ("x86_64-w64-mingw32"). This aligns with the overall intent of supporting Windows builds.


137-139: Win64 Matrix Entry in Build Job: Consistency Check

The new win64 entry for the build job is added correctly, including the host and dependency association via "depends_on: win64". This ensures that the Windows build target processes the necessary dependency built in the build-depends job.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

@PastaPastaPasta PastaPastaPasta merged commit 5685090 into dashpay:develop Feb 10, 2025
20 checks passed
@PastaPastaPasta PastaPastaPasta deleted the ci-add-windows-build branch February 10, 2025 20:32
PastaPastaPasta added a commit that referenced this pull request Feb 21, 2025
…ons, refactor cache keys

106500c ci: add x86_64 macOS cross-compilation build to GitHub Actions (Kittywhiskers Van Gogh)
56d8a8e ci: add SDK (extracted) sources to separate SDK cache (Kittywhiskers Van Gogh)
9841155 ci: cleanup restore keys (Kittywhiskers Van Gogh)
2f28f3e ci: replace `runner.os` with adding CI `Dockerfile` to `hashFiles` (Kittywhiskers Van Gogh)
1d8868b merge bitcoin#30451: remove Darwin ENV unsetting (Kittywhiskers Van Gogh)

Pull request description:

  ## Additional Information

  * Depends on #6400

  * ~~`WINEPREFIX` needs to be overridden because of permissions issues with GitHub Actions ([build](https://github.com/kwvg/dash/actions/runs/11952384181/job/33318706080#step:8:3297))~~ Superseded by [dash#6563](#6563)

  * [bitcoin#30451](bitcoin#30451) will enable `ccache` to work with macOS cross-compilation builds (i.e. they will no longer be registered as uncacheable).

  * After merging in [dash#6564](#6564), existing caches resulted in across-the-board build failures ([build](https://github.com/dashpay/dash/actions/runs/13290871849/job/37113644102#step:7:2768), [build](https://github.com/dashpay/dash/actions/runs/13290791962/job/37113418275#step:7:2940), [build](https://github.com/dashpay/dash/actions/runs/13289932901/job/37109498600#step:7:2177)) due to differing compiler versions (GCC 13 build on GCC 11 based cache) and differing glibc versions (2.39 build vs 2.35 cache) due to the change from `jammy` (on which the caches were built) to `noble` (the new base image for CI).

    To prevent this from occurring in the future, we will add CI's [`Dockerfile`](https://github.com/dashpay/dash/blob/265d9b5f9f5af07ff9da3d6fcc318b783d18caea/contrib/containers/ci/Dockerfile) to the `hashFiles()` used to generate the root of the cache key to ensure that the cache is discarded if it is modified.

    * `runner.os` doesn't help us as it tells us what platform the _runner_ is on and is independent from what the base image in the container is using, we only care about the latter.

  * The SDKs were cached separately because
    * The sources cache is shared between variants and the fastest runner (usually a Linux runner) will set the cache and as the download and extraction of the macOS SDK is only done when expected to target macOS, the cache associated with the shared key will not have the requisite SDKs.

      Then when that cache key is used to pull the sources cache by the macOS build, it will succeed due to a cache hit and then fail building because the compiler cannot locate the SDK.
    * The build cache is expected to have a higher churn rate as it is tied to the platform, which will trigger more than necessary downloads of the SDK.
      * If placed here, the cache would need to be re-evaluated if the version of Xcode has been bumped, which involves modifying `depends/hosts/darwin.mk`. Meaning, that file needs to be included when computing `hashFiles()`. But this also would result in unnecessary cache misses for all the platforms that _aren't_ macOS (because the structure of the build key is the same among all variants).

  ## Breaking Changes

  None expected.

  ## Checklist

  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)**
  - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)**
  - [x] I have made corresponding changes to the documentation **(note: N/A)**
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  UdjinM6:
    utACK 106500c
  PastaPastaPasta:
    utACK 106500c; gonna do CI on my repo, and push an empty commit and ensure caches are working as expected

Tree-SHA512: b51608d8791a0d87b6d43388d4173e31123fd62fc3ae346907102504a454133e7b862bf3be784a3610ebd2b816b2aaab8c1d4a2f33a4400cc6cf7bce380e9adf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants