couchbase / couchbase/couchbase-php-client

nmake command exiting with non-zero status on Windows container

Open
#202 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
7
Forks
13
Avg merge
6d 10m
Merged PRs (30d)
2

Description

I am trying to build a windows docker container where php is compiled along with couchbase extension. To do the compilation, I am following this resource.

My Environment:

OS: Windows servercore 2022 (On docker)
Php: 8.4.3 NTS, Debug
Arch: x64
VS: 17

Issue description:

As a first step, I was able to build and compile plain php-src from scratch using the php-sdk. Now, I am having issues adding the couchbase extension. Initially, I tried adding the precompiled DLLs to the extension directory but whatever, I have tried I got the error:

Warning: PHP Startup: Unable to load dynamic library 'couchbase' (tried: C:\php\Debug\couchbase (The specified module could not be found), C:\php\Debug\php_couchbase.dll (The specified module could not be found)) in Unknown on line 0

Since, I could not resolve this error, I tried compiling the extension from source code. For compilation, I have downloaded the source code from pecl website for 4.2.5 version. The configure (with --enable-couchbase flag) command is working fine. After that when nmake command is being executed, I am seeing the following error:

cl : Command line error D8016 : '/O2' and '/RTC1' command-line options are incompatible
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe" @C:\Users\ContainerAdministrator\AppData\Local\Temp\nmC99.tmp' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\nmake.exe" -f CMakeFiles\couchbase.dir\build.make /nologo -L CMakeFiles\couchbase.dir\build' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64\nmake.exe" -f CMakeFiles\Makefile2 /nologo -L all' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe" --build "C:\php\Debug\cmake-build" --verbose' : return code '0x2'
Stop.

Please let me know if there is any fix for this issue? Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the php-src Windows build, php-sdk-binary-tools setup, and the PECL couchbase-4.2.5 source configured through CMake. Reproduce the verbose nmake build in the Windows Server Core container and trace where /O2 and /RTC1 are added; done means the extension builds successfully and its DLL loads in the reported PHP environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, docker, php
Domain
build-system, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.