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

Change PATH_MAX to JL_PATH_MAX #43986

Merged
merged 3 commits into from
Feb 15, 2022
Merged

Change PATH_MAX to JL_PATH_MAX #43986

merged 3 commits into from
Feb 15, 2022

Conversation

2005m
Copy link
Contributor

@2005m 2005m commented Jan 30, 2022

Linked to #10682 and to avoid warning like the below one (see https://discourse.julialang.org/t/ccall-c-sort-vector-of-string/74635/21):

D:\Code\test>clang++ --std=c++17 -shared -undefined dynamic_lookup -o libsort.dll 
-I C:\Users\gitboy\.julia\artifacts\ddaec29ab3e1def8127a1757203ee4a75c1bbead\include\
-ID:\julia-1.7.1-win64\julia-1.7.1\include\julia
-LD:\julia-1.7.1-win64\julia-1.7.1\lib\julia sort.cpp

In file included from sort.cpp:1:
In file included from C:\Users\gitboy\.julia\artifacts\ddaec29ab3e1def8127a1757203ee4a75c1bbead\include\jlcxx/jlcxx.hpp:13:
In file included from C:\Users\gitboy\.julia\artifacts\ddaec29ab3e1def8127a1757203ee4a75c1bbead\include\jlcxx/julia_headers.hpp:15:
In file included from D:\julia-1.7.1-win64\julia-1.7.1\include\julia\julia.h:12:
In file included from D:\julia-1.7.1-win64\julia-1.7.1\include\julia\julia_fasttls.h:14:
  D:\julia-1.7.1-win64\julia-1.7.1\include\julia/dirpath.h:10:9: warning: 'PATH_MAX' macro
    redefined [-Wmacro-refedined]
  #define PATH_MAX MAX_PATH
          ^
  D:\llvm-mingw-20211002-msvcrt-x86_64\llvm-mingw-20211002-msvcrt-x86_64\include\limits.h:20:9:
      previous definition is here
  #define PATH_MAX   260
          ^
  1 warning generated

@musm
Copy link
Contributor

musm commented Feb 9, 2022

We should prefix this with JL instead of JULIA to be consistent.

@2005m 2005m changed the title Change PATH_MAX to JULIA_PATH_MAX Change PATH_MAX to JL_PATH_MAX Feb 9, 2022
@2005m
Copy link
Contributor Author

2005m commented Feb 9, 2022

@musm please let me know if you need anything else.

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 9, 2022
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Feb 14, 2022
@DilumAluthge
Copy link
Member

DilumAluthge commented Feb 14, 2022

The CI failures seem to be related to the contents of this PR.

package_win32 (log):

/cygdrive/c/buildbot/worker/package_win32/build/cli/loader_lib.c: In function 'load_library':
/cygdrive/c/buildbot/worker/package_win32/build/cli/loader_lib.c:52:17: error: 'JL_PATH_MAX' undeclared (first use in this function)
   52 |     char path[2*JL_PATH_MAX + 1] = {0};
      |                 ^~~~~~~~~~~
/cygdrive/c/buildbot/worker/package_win32/build/cli/loader_lib.c:52:17: note: each undeclared identifier is reported only once for each function it appears in
/cygdrive/c/buildbot/worker/package_win32/build/cli/loader_lib.c: At top level:
/cygdrive/c/buildbot/worker/package_win32/build/cli/loader_lib.c:101:14: error: 'JL_PATH_MAX' undeclared here (not in a function)
  101 | char lib_dir[JL_PATH_MAX];
      |              ^~~~~~~~~~~
make[1]: *** [Makefile:49: loader_lib.o] Error 1
make: *** [Makefile:79: julia-cli-release] Error 2
make: *** Waiting for unfinished jobs....

package_win64 (log):

/cygdrive/c/buildbot/worker/package_win64/build/cli/loader_lib.c: In function 'load_library':
/cygdrive/c/buildbot/worker/package_win64/build/cli/loader_lib.c:52:17: error: 'JL_PATH_MAX' undeclared (first use in this function)
   52 |     char path[2*JL_PATH_MAX + 1] = {0};
      |                 ^~~~~~~~~~~
/cygdrive/c/buildbot/worker/package_win64/build/cli/loader_lib.c:52:17: note: each undeclared identifier is reported only once for each function it appears in
/cygdrive/c/buildbot/worker/package_win64/build/cli/loader_lib.c: At top level:
/cygdrive/c/buildbot/worker/package_win64/build/cli/loader_lib.c:101:14: error: 'JL_PATH_MAX' undeclared here (not in a function)
  101 | char lib_dir[JL_PATH_MAX];
      |              ^~~~~~~~~~~
make[1]: *** [Makefile:49: loader_lib.o] Error 1
make: *** [Makefile:79: julia-cli-release] Error 2
make: *** Waiting for unfinished jobs....

@2005m
Copy link
Contributor Author

2005m commented Feb 14, 2022

@DilumAluthge should be fixed for win_32 and win_64. Please let me know if any issue related to this PR. Thank you.

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Feb 14, 2022
@DilumAluthge DilumAluthge merged commit 3897667 into JuliaLang:master Feb 15, 2022
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Feb 15, 2022
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request Feb 17, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
@2005m 2005m mentioned this pull request Mar 2, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
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

Successfully merging this pull request may close these issues.

4 participants