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

feat: Added support for generating and distributing Drifty CLI and GUI compatible with MacOS on Intel processors #594

Merged
merged 6 commits into from
Aug 16, 2024

Conversation

SaptarshiSarkar12
Copy link
Owner

@SaptarshiSarkar12 SaptarshiSarkar12 commented Aug 12, 2024

Fixes issue

Fixes #574

Changes proposed

This pull request aims to:

  • Implement support for the generation and automated distribution of Drifty CLI executable and GUI pkg file for MacOS with Intel chipset.
  • Introduce a feature on the download page that allows users to select and download the appropriate version of Drifty CLI and GUI based on their Mac's architecture.

Testings

Tested working for

  • MacOS with x86_64 architecture (using Rosetta Translation Environment)
  • MacOS with Apple Silicon processor (aarch64)

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

Summary by CodeRabbit

  • New Features

    • Improved download options for macOS users with separate links for Apple Silicon and Intel architectures.
    • Enhanced build configuration to support macOS 14 and accommodate both Apple Silicon and Intel architectures.
  • Bug Fixes

    • Refined artifact handling in the build process to ensure correct processing based on macOS version.
  • Chores

    • Streamlined documentation in deployment workflows, removing unnecessary comments for clarity.

…ith Intel chips (x86_64)

The Build workflow is now capable of generating and distributing macOS apps for Intel architecture. Unnecessary header from the website deployment CI/CD has also been removed.
Copy link

vercel bot commented Aug 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drifty ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2024 6:55am

Copy link
Contributor

coderabbitai bot commented Aug 12, 2024

Walkthrough

The recent changes significantly enhance the Drifty build process for macOS by introducing support for both Apple Silicon and Intel architectures. This update ensures that users on different hardware can access the correct binaries, improving overall compatibility and user experience. Additionally, the GitHub Actions workflows have been refined to better manage these builds, while the download functionality on the website has been updated to facilitate easier access to the appropriate versions.

Changes

Files Change Summary
.github/workflows/build.yml, .github/workflows/dev-docker-build.yml Updated GitHub Actions workflows to support macOS 14 for both Apple Silicon and Intel architectures, refining job configurations and artifact handling.
CLI/pom.xml, GUI/pom.xml Maven configurations updated to specify macOS 14 builds and added profiles for both Intel and ARM architectures.
Website/app/Releases.js Enhanced download functions to support differentiated download options for MacOS Apple Silicon and Intel users.

Assessment against linked issues

Objective Addressed Explanation
Add support for Intel builds of Drifty for macOS (#[574])
Distributing Intel builds via the download page (#[574])

Poem

🐇 In the forest, I hop with glee,
New builds for all, oh what a spree!
Apple or Intel, let’s celebrate,
Drifty’s now ready, it’s truly great!
With every download, a joyful cheer,
For all my friends, the updates are here! 🍏✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@github-actions github-actions bot added CI/CD 🔁 Pull Requests which update GitHub Actions code dependencies 📦️ Pull Requests that update dependencies maven 📦️ Pull Requests that update Maven dependencies labels Aug 12, 2024
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Yeah! You did it 🎉 Now, Relax 😉, Grab a drink ☕, and wait for the maintainers to check your contributions. Meanwhile, you can discuss on other issues and solve them 😀. Thank You 😃!

Meanwhile you can also discuss about the project in our Discord Server 😀

@github-actions github-actions bot added the Website 🌐 Issues/Pull Requests regarding Website label Aug 16, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
GUI/pom.xml (2)

87-93: Missing linker file for macOS 14 profile configuration

The file missing_symbols-macos-14.o, referenced in the macOS 14 profile configuration, is missing from the config/ directory. This could lead to issues when building the native image for macOS ARM64. Please ensure this file is added to the repository or update the configuration if the file location has changed.

Analysis chain

Confirm correctness of macOS 14 profile configuration.

Ensure that the linker argument and resource configuration file are appropriate for macOS 14.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configuration for macOS 14 profile in GUI/pom.xml.

# Test: Check for the existence of the specified linker and resource configuration files.
fd 'missing_symbols-macos-14.o' config/
fd 'resource-config-mac.json' config/

Length of output: 109


101-112: Missing linker file for macOS 13 profile configuration

The linker argument specifies missing_symbols-macos-13.o, which is not found in the config/ directory. This missing file could lead to build issues for the macOS 13 native image. Please ensure that this file is added to the repository or update the configuration to reflect the correct file path.

  • Missing file: config/missing_symbols-macos-13.o
Analysis chain

Verify macOS 13 profile configuration.

Ensure that the linker argument and resource configuration file are appropriate for macOS 13.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configuration for macOS 13 profile in GUI/pom.xml.

# Test: Check for the existence of the specified linker and resource configuration files.
fd 'missing_symbols-macos-13.o' config/
fd 'resource-config-mac.json' config/

Length of output: 109

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8af03e4 and 48dd8d9.

Files selected for processing (6)
  • .github/workflows/build.yml (6 hunks)
  • .github/workflows/dev-docker-build.yml (1 hunks)
  • .github/workflows/nextjs.yml (1 hunks)
  • CLI/pom.xml (1 hunks)
  • GUI/pom.xml (1 hunks)
  • Website/app/Releases.js (11 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/nextjs.yml
Additional comments not posted (22)
.github/workflows/dev-docker-build.yml (1)

21-21: Verify compatibility with macOS 14.

Ensure that all dependencies and tools used in the build process are compatible with macOS 14.

Verification successful

macOS 14 Compatibility Verified

The GitHub Actions used in the workflows appear to be compatible with macOS 14. These actions are well-maintained and generally support recent OS versions. However, ensure that any native dependencies or binaries used in the build process are also verified for compatibility with macOS 14.

  • Actions like actions/checkout, actions/setup-node, and others are commonly updated for compatibility with new OS releases.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility of the build process with macOS 14.

# Test: Check for any macOS version-specific dependencies or configurations.
rg --type yaml -A 3 'macos-14' .github/workflows/

Length of output: 1559


Script:

#!/bin/bash
# Search for any macOS-specific dependencies or tools in the workflow files.
rg --type yaml -A 5 'uses: ' .github/workflows/

Length of output: 17230

CLI/pom.xml (2)

117-156: Check macOS ARM profile configuration.

Verify that the resource configuration file is appropriate for macOS ARM.

Verification successful

macOS ARM profile configuration appears appropriate.

The resource-config-mac.json file includes macOS-specific resources, suggesting it is configured for macOS ARM. Ensure that these resources are compatible with ARM architecture. If additional ARM-specific configurations are needed, consider updating the file accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configuration for macOS ARM profile in CLI/pom.xml.

# Test: Check for the existence of the specified resource configuration file.
fd 'resource-config-mac.json' config/

Length of output: 69


Script:

#!/bin/bash
# Display the contents of the resource configuration file for macOS ARM.
cat config/resource-config-mac.json

Length of output: 155


157-159: Validate macOS Intel profile configuration.

Ensure that the resource configuration file is appropriate for macOS Intel.

Verification successful

macOS Intel profile configuration is appropriate.

The CLI/pom.xml file correctly references resource-config-mac.json within the macOS Intel profile. The file exists, and the configuration is consistent with other profiles. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configuration for macOS Intel profile in CLI/pom.xml.

# Test: Check for the existence of the specified resource configuration file.
fd 'resource-config-mac.json' config/

Length of output: 69


Script:

#!/bin/bash
# Search for references to 'resource-config-mac.json' within the CLI/pom.xml file.
rg 'resource-config-mac.json' CLI/pom.xml -A 5 -B 5

Length of output: 912

.github/workflows/build.yml (9)

25-25: Matrix Configuration Update for macOS Versions

The matrix configuration now includes macos-14 for Apple Silicon and macos-13 for Intel. This is a crucial update to ensure builds are generated for both architectures.


61-61: Conditional Logic for macOS Builds

The if condition correctly checks for all macOS builds, ensuring the yt-dlp update runs only when targeting the master branch and using workflow dispatch.


133-144: Artifact Categorization for macOS Apple Silicon

The categorization process for Apple Silicon is clear and correctly renames and moves the build artifacts into designated directories.


145-155: Artifact Categorization for macOS Intel

The added logic for Intel-based macOS follows the same pattern as Apple Silicon, ensuring consistency in handling and naming conventions.


216-217: Directory Creation for macOS Builds

Separate directories for macos_aarch64 and macos_x86_64 are created, which is essential for organizing build outputs by architecture.


223-226: Extraction of macOS Build Files

The extraction commands for macOS builds are correctly aligned with the architecture-specific directories, ensuring the tar files are unpacked into the right locations.


233-238: Size Calculation for macOS Artifacts

The size calculation for both Apple Silicon and Intel macOS artifacts is accurately captured, which helps in generating a detailed build summary.


263-275: Build Summary for macOS Artifacts

The build summary includes detailed sections for both macOS architectures, enhancing transparency and clarity for users downloading the artifacts.


287-295: Release Creation for Different Architectures

The release creation commands now include architecture-specific artifacts, ensuring users can download the correct version for their system.

Website/app/Releases.js (10)

21-28: Enhanced Download Logic for Latest Release (CLI)

The logic now distinguishes between "MacOS Apple Silicon" and "MacOS Intel," providing specific download URLs for each architecture. This improves user experience by directing users to the appropriate binary.


43-54: Enhanced Download Logic for Latest Release (GUI)

Similar to the CLI, the GUI download logic now includes architecture-specific URLs for macOS, ensuring users get the correct package for their system.


73-90: Enhanced Download Logic for Older Releases (CLI)

The conditional logic for downloading older CLI releases now supports specific macOS architectures, aligning with the updates for the latest releases.


111-128: Enhanced Download Logic for Older Releases (GUI)

The GUI download logic for older releases mirrors the CLI changes, ensuring consistency across application types and versions.


312-317: Conditional Logic for macOS Download Button

The button logic now checks the version to determine whether to show options for Apple Silicon or Intel, aligning with the versioning strategy.


324-335: Additional Button for macOS Intel

The additional button for macOS Intel appears conditionally based on the version, ensuring users with Intel-based Macs have a clear download option.


376-392: Download Count Logic for Pre-Releases

The logic for calculating download counts now includes checks for different macOS architectures, ensuring accurate reporting.


451-481: Download Logic for Pre-Releases

The download logic for pre-releases includes architecture-specific buttons, enhancing clarity and accessibility for users.


501-517: Download Count Logic for Past Releases

Similar to pre-releases, the logic for past releases now accurately reflects download counts across different architectures.


576-607: Download Logic for Past Releases

The download logic for past releases includes architecture-specific options, aligning with the updates for the latest and pre-releases.

Copy link
Owner Author

@SaptarshiSarkar12 SaptarshiSarkar12 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@SaptarshiSarkar12 SaptarshiSarkar12 merged commit 4628b6c into master Aug 16, 2024
3 checks passed
@SaptarshiSarkar12 SaptarshiSarkar12 deleted the feature-macos-intel-support branch August 16, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD 🔁 Pull Requests which update GitHub Actions code dependencies 📦️ Pull Requests that update dependencies maven 📦️ Pull Requests that update Maven dependencies Website 🌐 Issues/Pull Requests regarding Website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for running Drifty on macOS with Intel processor
1 participant