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

Properly set dylib search path for doctests #10469

Commits on Mar 9, 2022

  1. Properly set dylib search path for doctests

    Fixes rust-lang#8531.
    
    This issue was introduced by 3fd2814.
    Prior to that commit, the `rustdoc_process` function took other branch
    of the if statement being modified by this commit. The flag was
    previously called `is_host`, and `rustdoc` was run reporting `false`. In
    that commit, the flag was changed to `is_rustc_tool`, and rustdoc began
    reporting `true`, which resulted in the native directories added by
    build scripts no longer being appended to LD_LIBRARY_PATH when running
    doctests.
    
    This commit changes the behavior so that we are always appending the
    same set of paths, and the only variance is if we are cross compiling or
    not. An alternative would be to change rustdoc to always pass
    `kind: CompileKind::Host, is_rustc_tool: false`, but as rustdoc is in
    fact a rustc tool, that feels wrong. The commit which introduced the bug
    did not include context on why the flag was changed to `is_rustc_tool`,
    so I don't have a sense for if we should just change that flag to mean
    something else.
    
    While the test suite previously had an explicit test for the
    library path behavior of `cargo run`, it did not test this for various
    test forms. This commit modifies the test to ensure the behavior is
    consistent across `run`, normal tests, and doctests.
    sgrif committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    88b413e View commit details
    Browse the repository at this point in the history