Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

fix BUCK_CLASSPATH limit on linux #2692

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Commits on Mar 30, 2022

  1. fix BUCK_CLASSPATH limit on linux (facebook#2692)

    Summary:
    Pull Request resolved: facebook#2692
    
    When running `buck test ...` the RemoteExecution tests fails with **"Argument list too long"**.
    
    Reason: The concatanation of paths used as BUCK_CLASSPATH is crossing the limit emposed by linux for the env variable values. (https://github.com/torvalds/linux/blob/master/include/uapi/linux/limits.h#L8)
    
    How to reproduce the problem on a devserver:
    - execute jshell
    ```
    /usr/local/java-runtime/impl/11/bin/jshell
    ```
    - paste the script that spawn a process with an env value
    ```
    int test(String env, int size) throws Exception {
        var p = new ProcessBuilder("ls");
        p.environment().put(env, "b".repeat(size));
        return p.start().waitFor();
    }
    
    test("BUCK_CLASSPATH", 131_056)
    // ok: 0
    
    test("BUCK_CLASSPATH", 131_057)
    // fail: 7 - Argument list too long
    ```
    
    Reviewed By: bobyangyf
    
    fbshipit-source-id: 82be3046d32894b9449bfec84c7cf1cc1e87f798
    Adolfo Santos authored and facebook-github-bot committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    284e69e View commit details
    Browse the repository at this point in the history