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

fribidi build failure on Linux #9035

Closed
Ghasan opened this issue Nov 18, 2019 · 6 comments
Closed

fribidi build failure on Linux #9035

Ghasan opened this issue Nov 18, 2019 · 6 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@Ghasan
Copy link

Ghasan commented Nov 18, 2019

Host Environment

  • OS: Linux (WSL)
  • Compiler: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0

To Reproduce
Steps to reproduce the behavior:
./vcpkg install fribidi

Failure logs

the following packages will be built and installed:
    fribidi[core]:x64-linux
Starting package 1/1: fribidi:x64-linux
Building package fribidi[core]:x64-linux...
-- Using cached /home/ghasan/vcpkg/downloads/fribidi-fribidi-58c6cb390a9a18c98b2cbaac555d8ea9352a9e4f.tar.gz
-- Using source at /home/ghasan/vcpkg/buildtrees/fribidi/src/a9352a9e4f-1a97bf5d69
-- Configuring x64-linux-rel
-- Configuring x64-linux-rel done
-- Configuring x64-linux-dbg
-- Configuring x64-linux-dbg done
-- Package x64-linux-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
    Command failed: /usr/bin/ninja install -v
    Working Directory: /home/ghasan/vcpkg/buildtrees/fribidi/x64-linux-rel
    Error code: 1
    See logs for more information:
      /home/ghasan/vcpkg/buildtrees/fribidi/package-x64-linux-rel-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_meson.cmake:8 (vcpkg_execute_required_process)
  ports/fribidi/portfile.cmake:19 (vcpkg_install_meson)
  scripts/ports.cmake:94 (include)


Error: Building package fribidi:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: fribidi:x64-linux
  Vcpkg version: 2019.09.12-unknownhash
cat /home/ghasan/vcpkg/buildtrees/fribidi/package-x64-linux-rel-out.log
[1/63] cc  -Igen.tab/gen-unicode-version@exe -Igen.tab -I../src/a9352a9e4f-1a97bf5d69/gen.tab -Ilib -I../src/a9352a9e4f-1a97bf5d69/lib -I. -I../src/a9352a9e4f-1a97bf5d69/ -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 /DWIN32 /D_WINDOWS /W3 /utf-8 /MD /O2 /Gy /DNDEBUG /Z7 -UHAVE_CONFIG_H -DHAVE_STRINGIZE -DDONT_HAVE_FRIBIDI_CONFIG_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STRINGS_H -DSTDC_HEADERS=1 -MD -MQ 'gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o' -MF 'gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o.d' -o 'gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o' -c ../src/a9352a9e4f-1a97bf5d69/gen.tab/gen-unicode-version.c
FAILED: gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o
cc  -Igen.tab/gen-unicode-version@exe -Igen.tab -I../src/a9352a9e4f-1a97bf5d69/gen.tab -Ilib -I../src/a9352a9e4f-1a97bf5d69/lib -I. -I../src/a9352a9e4f-1a97bf5d69/ -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 /DWIN32 /D_WINDOWS /W3 /utf-8 /MD /O2 /Gy /DNDEBUG /Z7 -UHAVE_CONFIG_H -DHAVE_STRINGIZE -DDONT_HAVE_FRIBIDI_CONFIG_H -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STRINGS_H -DSTDC_HEADERS=1 -MD -MQ 'gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o' -MF 'gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o.d' -o 'gen.tab/gen-unicode-version@exe/gen-unicode-version.c.o' -c ../src/a9352a9e4f-1a97bf5d69/gen.tab/gen-unicode-version.c
cc: error: /DWIN32: No such file or directory
cc: error: /D_WINDOWS: No such file or directory
cc: error: /W3: No such file or directory
cc: error: /utf-8: No such file or directory
cc: error: /MD: No such file or directory
cc: error: /O2: No such file or directory
cc: error: /Gy: No such file or directory
cc: error: /DNDEBUG: No such file or directory
cc: error: /Z7: No such file or directory
ninja: build stopped: subcommand failed.

Additional context
Windows x86 and x64 builds like a breeze.

@Ghasan Ghasan added the category:port-bug The issue is with a library, which is something the port should already support label Nov 18, 2019
@LilyWangL
Copy link
Contributor

Hi @grdowns, there are this information in config-x64-linux-rel-out.log:

Native C compiler: cc (gcc 7.4.0 "cc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0")
Appending CFLAGS from environment: ' /DWIN32 /D_WINDOWS /W3 /utf-8  /MD /O2 /Gy /DNDEBUG /Z7'
Appending LDFLAGS from environment: ' /DEBUG  /INCREMENTAL:NO /OPT:REF /OPT:ICF'

I don't know how to fix this issue. Could you help to fix it?

Thanks.

fungos added a commit to fungos/vcpkg that referenced this issue Nov 30, 2019
- Fixes microsoft#7412 by using gtk 3.24.10.

- Possibly fixes microsoft#6554, microsoft#7827, microsoft#8103 as now all the missing assets are
correctly copied into installed/<triplet>/share/ and should be deployed
with the final application.

This simplify the gtk port and correctly generate the missing files.

The source of the problem is with the underlying build system, as these
files were installed by the demo `icon-browser`, but the
gtk-update-icon-cache were executed by the main gtk project, failing if
the demo wasn't built or installed.

- This also fixes microsoft#7641 as now the meson build will correctly generate
the missing .pc files.

- This also fixes microsoft#9035, microsoft#7150 by fixing `vcpkg_configure_meson.cmake`
which fails on Linux/OSX because it indiscriminately try to pass msvc
cl arguments to the cmake c/xx flags. Although this works, it is not
the ideal fix. The correct fix would be to do as suggested in
issue microsoft#8271. Also see issue microsoft#8630.
@giladbau
Copy link
Contributor

Hi, I just encountered the same issue. I updated my meson cmake file and it works. Why isn't this fix merged into vcpkg?

@jim4067
Copy link

jim4067 commented Apr 9, 2020

Hi, I just encountered the same issue. I updated my meson cmake file and it works. Why isn't this fix merged into vcpkg?

hey, what did you do? i'm new and have no idea what to do

@PhoebeHui PhoebeHui assigned PhoebeHui and unassigned LilyWangL Nov 12, 2020
@Osyotr
Copy link
Contributor

Osyotr commented Jun 2, 2021

Bump
UPD: build fails with x64-linux-dynamic triplet:

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:105 (message):
    Command failed: /usr/bin/python3 /home/me/development/vcpkg/downloads/tools/meson/meson-753954be868ed78b3e339e8811fd1d29eb2af237/meson.py -Ddocs=false -Dbin=false -Dtests=false --buildtype plain --backend ninja --wrap-mode nodownload --native /home/me/development/vcpkg/buildtrees/fribidi/meson-nativ-x64-linux.log --default-library shared --libdir lib --native /home/me/development/vcpkg/buildtrees/fribidi/meson-nativ-x64-linux-debug.log -Ddebug=true --prefix /home/me/development/vcpkg/packages/fribidi_x64-linux/debug --includedir ../include -Dcmake_prefix_path=['/home/me/development/vcpkg/installed/x64-linux/debug','/home/me/development/vcpkg/installed/x64-linux'] /home/me/development/vcpkg/buildtrees/fribidi/src/3bb089f553-744296bd76.clean
    Working Directory: /home/me/development/vcpkg/buildtrees/fribidi/x64-linux-dbg
    Error code: 1
    See logs for more information:
      /home/me/development/vcpkg/buildtrees/fribidi/config-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_meson.cmake:485 (vcpkg_execute_required_process)
  ports/fribidi/portfile.cmake:9 (vcpkg_configure_meson)
  scripts/ports.cmake:139 (include)

Contents of x64-linux-dynamic triplet:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)

set(VCPKG_CXX_FLAGS "-Wl,-rpath,'$ORIGIN/../lib'")
set(VCPKG_C_FLAGS "-Wl,-rpath,'$ORIGIN/../lib'")
set(VCPKG_LINKER_FLAGS "-Wl,-rpath,'$ORIGIN/../lib'")

There is only one line in vcpkg/buildtrees/fribidi/config-x64-linux-dbg-out.log

ERROR: Malformed value in machine file variable 'c_args'.

UPD2: Upon closer look, it seems that there is an issue with meson. It does not escape ' in input strings so c_args looks like c_args = ['-fPIC', '-Wl,-rpath,'$ORIGIN/../lib'-g', '-I"/home/me/development/vcpkg/installed/x64-linux/include"']
I've been able to build it with following lines in my overlay-port:

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)

if(PORT MATCHES "fribidi")
    set(pretty_ORIGIN_name "\$ORIGIN")
    set(VCPKG_LINKER_FLAGS "-Wl,-rpath,${pretty_ORIGIN_name}:${pretty_ORIGIN_name}/../lib")
else()
    set(VCPKG_LINKER_FLAGS "-Wl,-rpath,'$ORIGIN':'$ORIGIN/../lib'")
endif()

Also note that setting rpath here allows us to somewhat simulate windows behavior when finding shared libs.

ldd /home/me/development/vcpkg/installed/x64-linux/lib/libpng.so
linux-vdso.so.1 (0x00007ffe77de2000)
libz.so.1 => /home/me/development/vcpkg/installed/x64-linux/lib/libz.so.1 (0x00007f52591d0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5259087000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5258ec2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5259230000)

readelf -d /home/me/development/vcpkg/installed/x64-linux/lib/libpng.so
0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN:$ORIGIN/../lib]

@PhoebeHui
Copy link
Contributor

@Osyotr, could you create a new issue for your problem? it's a different issue with original one.

@LilyWangLL
Copy link
Contributor

Thanks for posting this issue. fribidi:x64-linux can install succeed on Linux now, please reopen this issue if it still be a problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants