Skip to content

Use ftpmirror.gnu.org to fetch GNU files#1919

Merged
nicolasnoble merged 1 commit intogrumpycoders:mainfrom
rpaulucci3:ftpmirror
Apr 10, 2025
Merged

Use ftpmirror.gnu.org to fetch GNU files#1919
nicolasnoble merged 1 commit intogrumpycoders:mainfrom
rpaulucci3:ftpmirror

Conversation

@rpaulucci3
Copy link
Copy Markdown
Contributor

According to the GNU Mirror List page, ftpmirror.gnu.org automatically emits an HTTP 302 to the user's nearest GNU mirror.
This substantially increases download speeds for GNU files, especially for users geographically distant from Boston, USA.

I have replaced all mentions of ftp.gnu.org with ftpmirror.gnu.org. However, tests must be made to ensure downloads work properly, given the redirect.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2025

Walkthrough

The changes update several tool scripts and Dockerfiles to replace download URLs from ftp.gnu.org to ftpmirror.gnu.org for GNU Binutils, GCC, and GDB packages. In addition, the Linux MIPS spawn script now adds --max-redirect=2 and --trust-server-names options to its wget command, ensuring improved handling of HTTP redirects. No modifications were made to any actual logic or control flow.

Changes

Files Change Summary
tools/linux-mips/spawn-compiler.sh Updated URLs for both binutils-2.43.tar.gz and gcc-14.2.0.tar.gz from ftp.gnu.org to ftpmirror.gnu.org; added --max-redirect=2 and --trust-server-names options to the wget command.
tools/macos-mips/mipsel-none-elf-binutils.rb, tools/vscode-extension/scripts/mipsel-none-elf-binutils.rb, tools/win32-mips/Dockerfile (BINUTILS) Changed the binutils URL from ftp.gnu.org to ftpmirror.gnu.org.
tools/macos-mips/mipsel-none-elf-gcc.rb, tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb, tools/win32-mips/Dockerfile (GCC) Changed the gcc URL from ftp.gnu.org to ftpmirror.gnu.org.
tools/macos-mips/mipsel-none-elf-gdb.rb, tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb, tools/win32-gdb/Dockerfile Changed the gdb URL from ftp.gnu.org to ftpmirror.gnu.org.

Poem

I'm a bunny hopping through the code,
Smiling at URLs on a brand-new road.
ftp to mirror, a smooth little swap,
With wget flags guiding each download hop.
Carrots and code, a joyful little spree—
A rabbit's cheer for changes made flawlessly!
🥕🐇


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 783f74d and 39c8b55.

📒 Files selected for processing (9)
  • tools/linux-mips/spawn-compiler.sh (2 hunks)
  • tools/macos-mips/mipsel-none-elf-binutils.rb (1 hunks)
  • tools/macos-mips/mipsel-none-elf-gcc.rb (1 hunks)
  • tools/macos-mips/mipsel-none-elf-gdb.rb (1 hunks)
  • tools/vscode-extension/scripts/mipsel-none-elf-binutils.rb (1 hunks)
  • tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb (1 hunks)
  • tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb (1 hunks)
  • tools/win32-gdb/Dockerfile (1 hunks)
  • tools/win32-mips/Dockerfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (10)
tools/win32-gdb/Dockerfile (1)

48-48: URL Mirror Update for GDB Download Source

The URL for the GDB package has been successfully updated from the original GNU FTP server to use the ftpmirror.gnu.org service. This change aligns with the PR objective and is consistent with similar updates in other components.

tools/macos-mips/mipsel-none-elf-gdb.rb (1)

4-4: Mirror URL Update for GDB Source

The url attribute has been updated to the mirror (https://ftpmirror.gnu.org/gnu/gdb/gdb-15.1.tar.xz). This change is straightforward and consistent with the effort to improve download speeds via redirection.

tools/vscode-extension/scripts/mipsel-none-elf-gcc.rb (1)

4-4: Updated GCC Source URL to Mirror

The URL specified in the MipselNoneElfGcc class is now using ftpmirror.gnu.org instead of the older FTP address. This change meets the PR objective and is consistent with similar URL modifications elsewhere.

tools/vscode-extension/scripts/mipsel-none-elf-gdb.rb (1)

4-4: Updated GDB Source URL to Use ftpmirror.gnu.org

The update to the url attribute in the MipselNoneElfGdb class correctly replaces the old FTP URL with the mirror URL. This update is in line with the overall pull request goal and should improve download performance.

tools/linux-mips/spawn-compiler.sh (2)

16-18: Binutils URL and wget Options Update

The for-loop now attempts to download binutils-2.43.tar.gz from the new mirror (https://ftpmirror.gnu.org/gnu/binutils/binutils-2.43.tar.gz) and includes the --max-redirect=2 and --trust-server-names options. These additions help manage redirects and ensure proper file naming. Please verify in testing that these options work seamlessly in your environment.


26-28: GCC URL and wget Options Update

Similarly, the for-loop for downloading gcc-14.2.0.tar.gz now uses the mirror URL and the enhanced wget options. This is consistent with the binutils update and the overall objective of leveraging ftpmirror.gnu.org.

tools/vscode-extension/scripts/mipsel-none-elf-binutils.rb (1)

4-4: Updated download URL for Binutils.

The URL has been updated from the traditional GNU FTP server to the mirror (ftpmirror.gnu.org) as intended by the PR. This change should improve download speeds without altering functionality.

tools/macos-mips/mipsel-none-elf-binutils.rb (1)

4-4: Consistent URL update for Binutils.

The source URL now points to ftpmirror.gnu.org rather than ftp.gnu.org, aligning with the overall PR objective of improving file download speeds via a better mirror.

tools/macos-mips/mipsel-none-elf-gcc.rb (1)

4-4: Updated GCC source URL.

The URL for downloading GCC has been updated to use ftpmirror.gnu.org. This modification is consistent with the approach taken in other formulas and meets the PR's objective.

tools/win32-mips/Dockerfile (1)

48-49: Updated Dockerfile ARGs for BINUTILS and GCC.

Both ARG variables have been updated to point to the ftpmirror.gnu.org URLs for Binutils and GCC, ensuring consistency across platforms and enhancing download performance with automatic redirection to nearby mirrors.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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.

@nicolasnoble nicolasnoble enabled auto-merge April 10, 2025 16:35
@rpaulucci3
Copy link
Copy Markdown
Contributor Author

It seems the Linux CI failure occurred because of a network instability on https://gcc.gnu.org/pub/gcc/infrastructure/:

2025-04-10T17:23:19.1562857Z + ./contrib/download_prerequisites
2025-04-10T17:25:32.3447865Z failed: Connection timed out.
2025-04-10T17:25:32.3448538Z failed: Network is unreachable.
2025-04-10T17:25:32.3454159Z error: Cannot download gettext-0.22.tar.gz from http://gcc.gnu.org/pub/gcc/infrastructure/
2025-04-10T17:25:32.3484993Z ##[error]Process completed with exit code 1.

@nicolasnoble
Copy link
Copy Markdown
Member

A bit ironical :D

@johnbaumann
Copy link
Copy Markdown
Collaborator

A bit ironical :D

I think I received this same error on the build run for #1911 last night

@nicolasnoble nicolasnoble merged commit 0e6eda7 into grumpycoders:main Apr 10, 2025
22 of 23 checks passed
@rpaulucci3 rpaulucci3 deleted the ftpmirror branch April 10, 2025 19:19
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.

3 participants