Skip to content

[8.7.0] Add Socket Secure (SOCKS) proxy support#29305

Merged
iancha1992 merged 7 commits intobazelbuild:release-8.7.0from
ssarad:socks-proxy-8.7.0
Apr 16, 2026
Merged

[8.7.0] Add Socket Secure (SOCKS) proxy support#29305
iancha1992 merged 7 commits intobazelbuild:release-8.7.0from
ssarad:socks-proxy-8.7.0

Conversation

@ssarad
Copy link
Copy Markdown
Contributor

@ssarad ssarad commented Apr 15, 2026

Description

ProxyHelper.java only supported HTTP/HTTPS proxies, rejecting SOCKS proxy URLs with the error "Proxy address socks5://... is not a valid URL". This change adds support for socks://, socks4://, and socks5:// proxy schemes.

Changes:

  • Updated URL validation regex to accept SOCKS proxy schemes
  • Added logic to create Proxy.Type.SOCKS when SOCKS schemes are detected
  • Set default port to 1080 for SOCKS proxies (standard SOCKS port)
  • Added tests for SOCKS proxy functionality

Motivation

Fixes #29301

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES[NEW]: Added SOCKS proxy support. Bazel now accepts socks://, socks4://, and socks5:// URLs in HTTPS_PROXY/HTTP_PROXY environment variables and related system properties.

@ssarad ssarad changed the title [8.7.0 ] Add Socks proxy [8.7.0 ] Add Socket Secure (SOCKS) proxy Apr 15, 2026
@ssarad ssarad changed the title [8.7.0 ] Add Socket Secure (SOCKS) proxy [8.7.0 ] Add Socket Secure (SOCKS) proxy support Apr 15, 2026
@ssarad ssarad marked this pull request as ready for review April 15, 2026 17:33
@ssarad ssarad requested a review from a team as a code owner April 15, 2026 17:33
@github-actions github-actions Bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Apr 15, 2026
@ssarad
Copy link
Copy Markdown
Contributor Author

ssarad commented Apr 15, 2026

cc: @meteorcloudy

The windows-shard-2 failure seems to be unrelated to the changes as its failing / flaking due to infinite symlink expansion in SourceDirectoryIntegrationTest.

INFO: Completed output file stat checks, no modified outputs found
Apr 15, 2026 5:18:00 PM com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor detectModifiedOutputFiles
INFO: Found 1 modified files from last build
ERROR: infinite symlink expansion detected
[start of symlink chain]
C:/b/ahigvc3r/execroot/_main/_tmp/f46842d1774692d5dc4db67c3e4aaa21/_main/foo/dir
C:/b/ahigvc3r/execroot/_main/_tmp/f46842d1774692d5dc4db67c3e4aaa21/_main/foo/dir/subdir/nested2
[end of symlink chain]

Apr 15, 2026 5:18:00 PM com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate run
WARNING: Aborting evaluation while evaluating DirectoryArtifactTraversalRequest{root=DirectTraversalRoot{outputArtifact=null, rootPart=C:/b/ahigvc3r/execroot/_main/_tmp/f46842d1774692d5dc4db67c3e4aaa21/_main, relativePart=foo/dir/subdir/nested2}, isRootGenerated=false, crossPkgBoundaries=CROSS, strictOutputFiles=true, skipTestingForSubpackage=false, errorInfo=Directory artifact foo/dir}
com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalFunction$RecursiveFilesystemTraversalFunctionException: com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalFunction$RecursiveFilesystemTraversalException: Error while traversing directory foo/dir/subdir/nested2: Infinite symlink expansion
	at com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalFunction.compute(RecursiveFilesystemTraversalFunction.java:274)
	at com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalFunction.compute(RecursiveFilesystemTraversalFunction.java:74)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:467)
	at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:435)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Caused by: com.google.devtools.build.lib.skyframe.RecursiveFilesystemTraversalFunction$RecursiveFilesystemTraversalException: Error while traversing directory foo/dir/subdir/nested2: Infinite symlink expansion

@iancha1992 iancha1992 enabled auto-merge April 15, 2026 18:46
@ssarad ssarad changed the title [8.7.0 ] Add Socket Secure (SOCKS) proxy support [8.7.0] Add Socket Secure (SOCKS) proxy support Apr 15, 2026
Copy link
Copy Markdown
Member

@meteorcloudy meteorcloudy left a comment

Choose a reason for hiding this comment

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

Thanks!

@iancha1992 iancha1992 added this pull request to the merge queue Apr 16, 2026
Merged via the queue into bazelbuild:release-8.7.0 with commit f390018 Apr 16, 2026
47 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Apr 16, 2026
@ssarad ssarad deleted the socks-proxy-8.7.0 branch April 25, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants