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

make install error on Windows #13810

Closed
mrec opened this issue Apr 28, 2014 · 11 comments
Closed

make install error on Windows #13810

mrec opened this issue Apr 28, 2014 · 11 comments
Labels
O-windows Operating system: Windows P-low Low priority

Comments

@mrec
Copy link
Contributor

mrec commented Apr 28, 2014

Trying to build latest on Win7-64, on a freshly-installed MSYS. The previous make check-fast mostly worked, with only one failure. (See #13439 - @klutzy has already commented on that.)

tmp/dist/rust-0.11-pre-i686-pc-mingw32/install.sh: line 387: /home/Mike/rust/tmp/dist/rust-0.11-pre-
i686-pc-mingw32//lib/rustlib/manifest.in: No such file or directory
install: verifying installed binaries are executable
tmp/dist/rust-0.11-pre-i686-pc-mingw32/install.sh: line 393: /usr/local/bin/rustc: No such file or d
irectory
install: error: can't execute installed rustc binary. installation may be broken. if this is expecte
d then rerun install.sh with `--disable-verify` or `make install` with `--disable-verify-install`
/home/Mike/rust/mk/install.mk:18: recipe for target `install' failed
make: *** [install] Error 1

Possibly relevant:

  • the double slash in the manifest.in path
  • I have a ~/rust/tmp/dist/rust-0.11-pre-i686-pc-mingw32 folder, but no lib under it
  • I don't have a /usr folder at all
@alexcrichton
Copy link
Member

cc @brson

@iliekturtles
Copy link
Contributor

Just ran into the same issue. After some digging I've found that configure sets CFG_LIBDIR to $PREFIX/lib on Linux and $PREFIX/bin on mingw32. See the make install output at the bottom of the post. install.sh has a number of locations that assume $PREFIX/lib including line 387. I'll see about submitting a pull request that removes these assumptions.

I'm not sure what should be done about the /usr error. Should this be considered a MSYS setup issue? This is the default directory if configure is run without prefix. I also saw the double slashes. These have no affect on the path, and in my case were caused by running configure --prefix=.../dest/dir/ -- the trailing slash is added by MSYS' tab completition and isn't expected or stripped out by configure.

Linux, note liblibc-*.so directory:

cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: using gcc
cfg: no pdflatex found, deferring to xelatex
cfg: no xelatex found, deferring to lualatex
cfg: no lualatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: no llnextgen found, omitting grammar-verification
cfg: including prepare rules
cfg: including dist rules
cfg: including install rules
cleaning destination tmp/dist/rust-0.11.0-pre-x86_64-unknown-linux-gnu
prepare: tmp/dist/rust-0.11.0-pre-x86_64-unknown-linux-gnu/bin
prepare: tmp/dist/rust-0.11.0-pre-x86_64-unknown-linux-gnu/lib
prepare: tmp/dist/rust-0.11.0-pre-x86_64-unknown-linux-gnu/share/man/man1
prepare: tmp/dist/rust-0.11.0-pre-x86_64-unknown-linux-gnu/lib/liblibc-*.so
...

mingw32, note libc-*.dll directory:

cfg: build triple i686-pc-mingw32
cfg: host triples i686-pc-mingw32
cfg: target triples i686-pc-mingw32
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for i686-pc-mingw32 is i386
cfg: os for i686-pc-mingw32 is pc-mingw32
cfg: using gcc
cfg: disabling valgrind due to its unreliability on this platform
cfg: no pdflatex found, deferring to xelatex
cfg: no xelatex found, deferring to lualatex
cfg: no lualatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: no llnextgen found, omitting grammar-verification
cfg: including prepare rules
cfg: including dist rules
cfg: including install rules
cleaning destination tmp/dist/rust-0.11.0-pre-i686-pc-mingw32
prepare: tmp/dist/rust-0.11.0-pre-i686-pc-mingw32/bin
prepare: tmp/dist/rust-0.11.0-pre-i686-pc-mingw32/bin
prepare: tmp/dist/rust-0.11.0-pre-i686-pc-mingw32/share/man/man1
prepare: tmp/dist/rust-0.11.0-pre-i686-pc-mingw32/bin/libc-*.dll
...

iliekturtles added a commit to iliekturtles/rust that referenced this issue May 18, 2014
Replaced literal 'lib' with source relative lib directory. mingw32 uses 'bin'
instead of 'lib'. Closes rust-lang#13810.
@mrec
Copy link
Contributor Author

mrec commented May 19, 2014

Re the possibility of the missing /usr being an MSYS setup issue, I did raise one at the time that might be related, but didn't get much of a response.

@mrec
Copy link
Contributor Author

mrec commented May 19, 2014

Actually, scratch that, I was just misunderstanding how MSYS set things up. I think I was misled by /usr not appearing in Explorer under the msys root, but /usr within the MSYS shell seems to be the MSYS root.

@brson
Copy link
Contributor

brson commented May 19, 2014

I'm assuming that per #14284 fixing this one line solves this entire issue.

Unfortunately the subtleties here are pretty deep. The solution proposed in #14284 makes several assumptions about relative paths that don't hold: all path-related options configure/install.sh may be either relative to cwd or absolute.

The root of the issue is that on windows we don't use a lib directory, but stuff everything into bin. The reason we do this is to hack around Window's lack of options for locating dynamic libs at runtime.

I think I prefer to continue using this strategy of having a different filesystem layout on windows, though we may also be able to just add more to the $PATH variable at install time to make this entire difference go away.

In any case, I would like to purge this difference in layouts from the build process, and defer the decision on where to put various artifacts until install-time. So, when we produce our dist artefacts, they have the same internal layout on all platforms, and the build system is less complex. Doing that would solve this issue since then the manifest would be at the same location on all platforms.

If we do that then we have some options: since this installer is explicitly for Unixy systems (here msys), we may not need to mess with --libdir at all, if msys has previously set up the paths correctly to dynamically load libs from /usr/local/lib.

Note that overriding --libdir is super-prone to utter breakage, both at compile time - when locating crates, and also at runtime - when dynamically loading libraries.

After writing all this I'm more convinced that the right solution is to remove this hacky difference in filesystem layout completely.

In the meantime though I am not opposed to copying some of the platform-detection code from configure to install.sh and special-casing mingw to look in $prefix/bin for the install manifest.

@iliekturtles
Copy link
Contributor

Thanks for the feedback. I was fearing it wouldn't be so simple. I'll start taking a look at the short-term solution of copying some of the platform detection code. No promises on time if someone else wants to pick this up before I get a chance to submit something for review.

@pnkfelix
Copy link
Member

@brson after all of my check-stage1 work I am more familiar with the issues involved here (in terms of both the logic dictating where libraries are emitted and the dynamic library resolution process on various platforms), so I can try to poke at this if you like.

@brson
Copy link
Contributor

brson commented May 20, 2014

That would be swell @pnkfelix. Thanks
On May 19, 2014 4:08 PM, "Felix S Klock II" [email protected]
wrote:

@brson https://github.com/brson after all of my check-stage1 work I am
more familiar with the issues involved here (in terms of both the logic
dictating where libraries are emitted and the dynamic library resolution
process on various platforms), so I can try to poke at this if you like.


Reply to this email directly or view it on GitHubhttps://github.com//issues/13810#issuecomment-43569466
.

iliekturtles added a commit to iliekturtles/rust that referenced this issue Jul 3, 2014
Platform-detection code from `configure` copied over to `install.sh`
in order to special case the lib dir being `bin` on Windows instead
of `lib`.

Short-term fix for rust-lang#13810.
bors added a commit that referenced this issue Jul 3, 2014
…r=brson

Short-term fix per @brson's comment: #13810 (comment). Tested on Win7 x64 and Linux.

One possible issue is that `install.sh` doesn't have a `need_cmd` definition like `configure` does. Should this be ported over as well?

Platform-detection code from `configure` copied over to `install.sh` in
order to special case the lib dir being `bin` on Windows instead of
`lib`.

Short-term fix for #13810.
@brson brson mentioned this issue Aug 12, 2014
33 tasks
@pnkfelix
Copy link
Member

P-low, not 1.0.

@steveklabnik
Copy link
Member

How relevant is this issue today? I don't have a Windows machine...

@alexcrichton
Copy link
Member

Our installers have changed quite a bit since this was opened, so I'm going to close this as "probably fixed"

arcnmx pushed a commit to arcnmx/rust that referenced this issue Jan 9, 2023
Add action to expand a declarative macro once, inline. Fixes rust-lang#13598

This commit adds a new r-a method, `expandMacroInline`, which expands the macro that's currently selected. See  rust-lang#13598 for the most applicable issue; though I suspect it'll resolve part of rust-lang#5949 and make rust-lang#11888 significantly easier).

The macro works like this:

![rust-analyser-feature](https://user-images.githubusercontent.com/10906982/208813167-3123e379-8fd5-4206-a4f4-5af1129565f9.gif)

I have 2 questions before this PR can be merged:

1. **Should we rustfmt the output?** The advantage of doing this is neater code. The disadvantages are we'd have to format the whole expr/stmt/block (since there's no point just formatting one part, especially over multiple lines), and maybe it moves the code around more in weird ways. My suggestion here is to start off by not doing any formatting; and if it appears useful we can decide to do formatting in a later release.
2.   **Is it worth solving the `$crate` hygiene issue now?** -- I think this PR is usable as of right now for some use-cases; but it is annoying that many common macros (i.e. `println!()`, `format!()`) can't be expanded further unless the user guesses the correct `$crate` value. The trouble with solving that issue is that I think it's complicated and imperfect. If we do solve it; we'd also need to either change the existing `expandMacro`/`expandMacroInline` commands; provide some option to allow/disallow `$crate` expanding; or come to some other compromise.
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 28, 2025
Currently
https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_dependencies
doc doesn't contain explanation how it should be so added more details

----

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows P-low Low priority
Projects
None yet
Development

No branches or pull requests

6 participants