Skip to content

rustc --dep-info has started using absolute paths in the output #12174

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

Closed
lilyball opened this issue Feb 11, 2014 · 7 comments · Fixed by #12176
Closed

rustc --dep-info has started using absolute paths in the output #12174

lilyball opened this issue Feb 11, 2014 · 7 comments · Fixed by #12176

Comments

@lilyball
Copy link
Contributor

When using rustc --dep-info lib.d lib.rs the resulting lib.d file has started including absolute paths for the resulting library, instead of the expected relative paths.

Previously:

> rustc --dep-info lib.d lib.s
> cat lib.d
libirc-943b2bb5-0.1.rlib: lib.rs conn.rs handlers.rs

Now:

> rustc --dep-info lib.d lib.rs
> cat lib.d
/Users/kevin/Dev/rust/rust-irclib/libirc-943b2bb5-0.1.rlib: lib.rs conn.rs handlers.rs
@lilyball
Copy link
Contributor Author

Adding --out-dir . restores the relative output, which is bizarre because . is the default out dir.

@lilyball
Copy link
Contributor Author

I believe this was introduced in 6e7968b

@alexcrichton
Copy link
Member

I believe the problem is that if you don't specify --out-dir it uses os::getcwd() as the output directory. It should probably just use Path::new(".") as the output directory.

@alexcrichton
Copy link
Member

@lilyball
Copy link
Contributor Author

I'm doing a build right now that restores the old logic of

            let dirpath = match *odir {
                Some(ref d) => d.clone(),
                None => match *input {
                    StrInput(_) => os::getcwd(),
                    FileInput(ref ifile) => ifile.dir_path()
                }
            };

That said, I think I like Path::new(".") better, because that matches my expectation of --out-dir defaulting to ..

@alexcrichton
Copy link
Member

That logic will restore the correct --out-dir behavior, but it will not have the correct build behavior. We changed it to output by default to the current directory, not to the directory holding the source file (which is what the old logic did).

@lilyball
Copy link
Contributor Author

Ahh, I see. In that case, Path::new(".") makes more sense.

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
internal: Improve completion tests by checking that the offset is included in the source_range of items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants