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

Conversation

adolfojunior
Copy link

Summary:
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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D35240414

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D35240414

facebook-github-bot pushed a commit that referenced this pull request Mar 30, 2022
Summary:
Pull Request resolved: #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: 7a95aac009e4c25c3ea536ec4a3d371525ee2654
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants