Skip to content

GREP_HEADER() is broken #16199

Closed
Closed

Description

@nono303

Description

Hi,

testing compilation on MSVC (vs17 x64) of PHP 8.4.0RC1 configure --with-openssl-argon2 with openssl 3.3.2

  1. had the error:
Enabling extension ext\openssl [shared]
Checking for OSSL_set_max_threads in openssl/thread.h ... 
Checking for openssl/thread.h ...  <not found>
Checking for openssl/thread.h ...  C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include
Problem reading C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include
No
WARNING: OpenSSL argon2 hashing requires OpenSSL >= 3.2
  1. checked all the stuff on openssl part : no problem
  2. looked why the message Problem reading C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include didn't include the filename and realize that GREP_HEADER in /win32/build/confutils.js is buggy:

header_name is only appended in file_get_contents() param when path_to_check() is set and not when path come from search_paths() result.

  1. here is a working path
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -968,11 +968,11 @@ function GREP_HEADER(header_name, regex, path_to_check)
 
 		var p = search_paths(header_name, path_to_check, "INCLUDE");
 		if (typeof(p) == "string") {
-			c = file_get_contents(p);
+			c = file_get_contents(p+ "\\" + header_name);
 		} else if (p == false) {
 			p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
 			if (typeof(p) == "string") {
-				c = file_get_contents(p);
+				c = file_get_contents(p+ "\\" + header_name);
 			}
 		}
 		if (!c) {
  1. configure log after patch
Enabling extension ext\openssl [shared]
Checking for OSSL_set_max_threads in openssl/thread.h ... 
Checking for openssl/thread.h ...  <not found>
Checking for openssl/thread.h ...  C:\sdk\release\vs17_x64-avx2\_openssl\openssl\include
OK

Note: Don't know where the useless No and OK message line come from... might be removed

PHP Version

PHP 8.4.0RC1

Operating System

Win11

Activity

  1. cmb69 commented on Oct 3, 2024

    @cmb69
    Member

    4. here is a working path

    Thank you. See also #15619.

    Don't know where the useless No and OK message line come from... might be removed

    Only when search_paths() is called, you get <in default path>/<not found>; otherwise you get

    Checking for OSSL_set_max_threads in openssl/thread.h ... OK
    Checking for OSSL_set_max_threads in openssl/thread.h ... No
    

    So removing OK/No needs more adjustments. I don't think this output is a real problem, though.

  2. nono303 commented on Oct 3, 2024

    @nono303
    ContributorAuthor

    Thx @cmb69!

    So removing OK/No needs more adjustments. I don't think this output is a real problem, though.

    This output is not a problem,
    I just didn't understand where it came from (and that also explain some \n issue during the search_paths sequence)

  3. self-assigned this
    on Oct 3, 2024
  4. changed the title [-]bug on GREP_HEADER in /win32/build/confutils.js[/-] [+]GREP_HEADER() is broken[/+] on Oct 3, 2024
  5. added a commit that references this issue on Oct 3, 2024
    e915ed7
  6. added a commit that references this issue on Oct 3, 2024
    850a5a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions