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

can we avoid exporting LD_PRELOAD in set_env_vars.sh? #194

Open
2 tasks
cdisselkoen opened this issue Jan 8, 2024 · 2 comments
Open
2 tasks

can we avoid exporting LD_PRELOAD in set_env_vars.sh? #194

cdisselkoen opened this issue Jan 8, 2024 · 2 comments
Labels
internal-improvement Refactoring, performance improvement, or other non-breaking change

Comments

@cdisselkoen
Copy link
Contributor

Category

DRT infrastructure

Describe the feature you'd like to request

Currently, set_env_vars.sh sets (exports) a number of environment variables, like LD_LIBRARY_PATH, JAVA_HOME, CLASSPATH. Most of these are sensible. However, it also sets (exports) LD_PRELOAD. This is less reasonable in my opinion, because it will cause that preload (Lean's libm) to be loaded for every future command in that shell, not just Lean-related ones. (Even worse, at the time of this writing, if you source set_env_vars.sh while not having lean on your PATH, the script will set LD_PRELOAD to a bogus path, which prints an error message every time you do anything subsequently in that shell. I'll have a PR shortly for the narrow issue of what happens when lean is not on your PATH.)

In my opinion it would be better if we could somehow set LD_PRELOAD only for the commands it is necessary, not globally in the shell.

Describe alternatives you've considered

Instead of a set_env_vars.sh meant for interactive use, we could have a runner script that sets all of these variables just locally (no export), and is responsible for calling cargo fuzz.

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@cdisselkoen
Copy link
Contributor Author

PR for the lean-not-on-PATH issue is #195. But the main issue discussed here remains.

@john-h-kastner-aws
Copy link
Contributor

If there's nothing too expensive in setting the env vars, maybe something like

#!/bin/bash
cargo() (
  export LD_PRELOAD="..."
  command cargo "$@"
)

@khieta khieta added backlog internal-improvement Refactoring, performance improvement, or other non-breaking change and removed feature-request Request for a new feature pending-triage Hasn't been triaged yet labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-improvement Refactoring, performance improvement, or other non-breaking change
Projects
None yet
Development

No branches or pull requests

3 participants