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

Proposal: refactor rust programs to remove dependancy on pkg-config #297610

Closed
lolbinarycat opened this issue Mar 21, 2024 · 4 comments
Closed

Proposal: refactor rust programs to remove dependancy on pkg-config #297610

lolbinarycat opened this issue Mar 21, 2024 · 4 comments
Labels

Comments

@lolbinarycat
Copy link
Contributor

most rust packages depend on pkg-config so that the openssl-sys crate can find openssl.

however, one alternative is to tell it where openssl is directly:

  env = {
    OPENSSL_DIR = openssl.dev.outPath;
    OPENSSL_LIB_DIR = openssl.out.outPath + "/lib";
  };

if this attrset was added as a field on openssl.passthru, it could potentially be used by rust crates to speed up the build process a moderate amount.

@lolbinarycat
Copy link
Contributor Author

of course, fixing the redundant build during checkPhase would speed things up a lot more, and so that should be prioritized

@SuperSandro2000
Copy link
Member

it could potentially be used by rust crates to speed up the build process a moderate amount.

On what is this based? Is pkg-config that slow? Or did you benchmark this?

Also does this impact cross compilation?

@lolbinarycat
Copy link
Contributor Author

On what is this based? Is pkg-config that slow? Or did you benchmark this?

i have not benchmarked this, but i know getenv is going to be faster than spawn.

how much faster, i'm not sure.

@SuperSandro2000
Copy link
Member

This probably makes a really negligible difference and compared to the effort of reimplementing the cross logic in nix, I highly doubt that that is worth it. Also keeping close to the build system upstream uses makes sure that we don't introduce subtle bugs and can easier report issues to upstream.

As you wrote earlier, reducing the duplicated builds done by tests would be much more worth wile and the decreased build time for every package would be wort wile. There is already an issue for that here #291222

@SuperSandro2000 SuperSandro2000 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants