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

Erroneous paths in 'gcc --print-search-dirs' #9411

Open
lempamo opened this issue Aug 17, 2021 · 6 comments
Open

Erroneous paths in 'gcc --print-search-dirs' #9411

lempamo opened this issue Aug 17, 2021 · 6 comments

Comments

@lempamo
Copy link

lempamo commented Aug 17, 2021

I was trying to install GTK4 from the repo using meson, but the build failed. After some further investigation, it turns out that the GCC I was using (which came from MSYS) had some library search paths set to the D drive.

Why is this the case, and how can I remove them?

Further details: mesonbuild/meson#9127

install: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/
programs: =C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/
libraries: =C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../lib/;D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/lib/x86_64-w64-mingw32/10.3.0/;D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../;D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/lib/
@Biswa96
Copy link
Member

Biswa96 commented Aug 17, 2021

Can you provide some more information? It will be easy to reproduce

  • gtk4 git repo or any specific branch/commit.
  • dependencies installed.
  • is it in mingw64 environment (the blue icon in start menu)

The erroneous path D:/a/_temp/msys/ came from GitHub Actions CI setup. Other paths look normal.

@jeremyd2019
Copy link
Member

It's just that the build environment paths msys root D:/a/_temp/msys/msys64/ are leaking into the built gcc.

@rubyFeedback
Copy link

Interesting. But these paths don't confuse any compile-related aspects?

Failing to compile GTK4 is an issue though. I actually also had problems compiling it
via meson; in my case I had missing symbols that somehow could not be found. Since
I don't know windows that well I decided to skip it for now and re-try at some later point
in the future.

@revelator
Copy link
Contributor

try adding -fcommon to CFLAGS and see if the symbols are still missing ?.

@acidtonic
Copy link

This is effecting me in the linked issue above (#9615)

Somehow this path gets built into the code-generator step of gdlmm and fails trying to run m4.exe from that erroneous D-drive path.

@pineapplemachine
Copy link

I am also having a related issue. D:/a/_temp/msys/msys64 subdirectories are inexplicably in my gcc search paths, and this is making meson unusable. It is currently not possible to run meson setup because of this issue. Here are some relevant logs:

λ meson setup build
The Meson build system
Version: 0.59.2
Source dir: E:\Sync\Projects\raylib\test-2021-10
Build dir: E:\Sync\Projects\raylib\test-2021-10\build
Build type: native build
Project name: Test
Project version: undefined
C++ compiler for the host machine: c++ (gcc 10.3.0 "c++ (Rev5, Built by MSYS2 project) 10.3.0")
C++ linker for the host machine: c++ ld.bfd 2.36.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

Found ninja-1.10.2 at C:\msys64\mingw64\bin\ninja.EXE
Generating targets:   0%|

Traceback (most recent call last):
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\mesonmain.py", line 228, in run
    return options.run_func(options)
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\msetup.py", line 281, in run
    app.generate()
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\msetup.py", line 184, in generate
    self._generate(env)
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\msetup.py", line 246, in _generate
    intr.backend.generate()
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 546, in generate
    self.generate_target(t)
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 883, in generate_target
    elem = self.generate_link(target, outname, final_obj_list, linker, pch_objects, stdlib_args=stdlib_args)
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 3033, in generate_link
    dep_targets.extend(self.guess_external_link_dependencies(linker, target, commands, internal))
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 2873, in guess_external_link_dependencies
    search_dirs = tuple(search_dirs) + tuple(linker.get_library_dirs(self.environment))
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\compilers\mixins\clike.py", line 254, in get_library_dirs
    return self._get_library_dirs(env, elf_class).copy()
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\compilers\mixins\clike.py", line 213, in _get_library_dirs
    dirs = self.get_compiler_dirs(env, 'libraries')
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\compilers\mixins\gnu.py", line 283, in get_compiler_dirs
    return self._split_fetch_real_dirs(line.split('=', 1)[1])
  File "e:\python\python-3.8.2\lib\site-packages\mesonbuild\compilers\mixins\gnu.py", line 265, in _split_fetch_real_dirs
    if pobj.exists():
  File "e:\python\python-3.8.2\lib\pathlib.py", line 1383, in exists
    self.stat()
  File "e:\python\python-3.8.2\lib\pathlib.py", line 1189, in stat
    return self._accessor.stat(self)
OSError: [WinError 87] The parameter is incorrect: 'D:\\a\\_temp\\msys\\msys64\\mingw64\\x86_64-w64-mingw32\\lib\\x86_64-w64-mingw32\\10.3.0'

λ g++ -print-search-dirs
install: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/ programs: =C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/
libraries: =C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../x86_64-w64-mingw32/10.3.0/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../lib/;D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/lib/x86_64-w64-mingw32/10.3.0/;D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../;D:/a/_temp/msys/msys64/mingw64/x86_64-w64-mingw32/lib/

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

No branches or pull requests

7 participants