Skip to content

Building on CygWin 1.7: PATH_MAX redefined #52794

Closed

Description

@jbinder
mannequin
BPO 8548
Nosy @berkerpeksag, @ma8ma
Files
  • python-build-logs.tar.gz: Logs of ./configure and make output
  • py_cygwin_build-3.1.3.txt: Log of make error
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-11-02.10:20:49.636>
    created_at = <Date 2010-04-27.16:43:08.905>
    labels = ['build', 'OS-windows']
    title = 'Building on CygWin 1.7: PATH_MAX redefined'
    updated_at = <Date 2017-11-02.10:20:49.634>
    user = 'https://bugs.python.org/jbinder'

    bugs.python.org fields:

    activity = <Date 2017-11-02.10:20:49.634>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-02.10:20:49.636>
    closer = 'berker.peksag'
    components = ['Build', 'Windows']
    creation = <Date 2010-04-27.16:43:08.905>
    creator = 'jbinder'
    dependencies = []
    files = ['17107', '20155']
    hgrepos = []
    issue_num = 8548
    keywords = []
    message_count = 9.0
    messages = ['104334', '113037', '124589', '161910', '224260', '224619', '241698', '305403', '305411']
    nosy_count = 9.0
    nosy_names = ['jlt63', 'stutzbach', 'rpetrov', 'jbinder', 'BreamoreBoy', 'Scott.Rostrup', 'berker.peksag', 'Nicholas.DiPiazza', 'masamoto']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue8548'
    versions = ['Python 3.4', 'Python 3.5']

    Activity

    1. jbinder commented on Apr 27, 2010

      jbindermannequin
      MannequinAuthor

      Building Python 3.1.2 on Cygwin 1.7, I got errors in main.c stemming from a warning: PATH_MAX redefined (see attached log). I got around this by commenting out the #define. I don't know if the best solution is #ifndef, #undef, or something else. . . . I know CygWin has changed the value of PATH_MAX in 1.7 (see: http://www.cygwin.com/cygwin-ug-net/ov-new1.7.html), though I'm not sure why that would cause this problem.

    2. added
      build
      on Apr 27, 2010
    3. terryjreedy commented on Aug 5, 2010

      @terryjreedy
      Member

      None of the developers are much up on Cygwin and I am not sure it is directly supported by the core distribution. If it is not, this should be closed unless you have a specific patch.

      In any case, you might do better with your question on python-list. Also, PEP-11 list Jason Tishler (jason@tishler.net) as Cygwin maintainer.

      Next time, please attach an edited, plain-text .txt log that can be viewed in the browser. I would have to be really motivated to download and extract a tar.gz file.

    4. ScottRostrup commented on Dec 24, 2010

      ScottRostrupmannequin
      Mannequin

      I just encountered this error in python 3.1.3 on cygwin 1.7.
      I used the same fix as jbinder.

      Old Modules/main.c (line 13):

        #if defined(MS_WINDOWS) || defined(__CYGWIN__)
        #include <windows.h>
        #ifdef HAVE_FCNTL_H
        #include <fcntl.h>
        #define PATH_MAX MAXPATHLEN
        #endif
        #endif

      I guess now cygwin is defining PATH_MAX, one possible fix with ifndef:

        #if defined(MS_WINDOWS) || defined(__CYGWIN__)
        #include <windows.h>
        #ifdef HAVE_FCNTL_H
        #include <fcntl.h>
        #ifndef
        #define PATH_MAX MAXPATHLEN
        #endif
        #endif
        #endif

      This compiled and worked for me and it appears jbinder as well.

    5. NicholasDiPiazza commented on May 29, 2012

      NicholasDiPiazzamannequin
      Mannequin

      In Python3.1.2-src/Modules/main.c

      I actually had to use this to get it to work:

      #if defined(MS_WINDOWS) || defined(__CYGWIN__)
      #include <windows.h>
      #ifdef HAVE_FCNTL_H
      #include <fcntl.h>
      #endif
      #ifndef HAVE_FCNTL_H
      #define PATH_MAX MAXPATHLEN
      #endif
      #endif
    6. BreamoreBoy commented on Jul 29, 2014

      BreamoreBoymannequin
      Mannequin

      main.c has this.

      #if defined(MS_WINDOWS) || defined(__CYGWIN__)
      #include <windows.h>
      #ifdef HAVE_FCNTL_H
      #include <fcntl.h>
      #define PATH_MAX MAXPATHLEN
      #endif
      #endif

      Wouldn't inserting #else before #define fix this issue?

    7. added
      build
      and removed on Jul 29, 2014
    8. rpetrov commented on Aug 3, 2014

      rpetrovmannequin
      Mannequin

      Hi Mark,
      #else before is not solution. See unified diff below as post by Scott Rostrup lack definition

      Some additional information:
      a) move outside #ifdef HAVE_FCNTL_H : definition PATH_MAX is not related to control functions on open files (fcntl.h)
      b) HAVE_FCNTL_H is defined for MSC build as well. so no impact on other build

      --- a/Modules/main.c
      +++ b/Modules/main.c
      @@ -9,6 +9,8 @@
       #include <windows.h>
       #ifdef HAVE_FCNTL_H
       #include <fcntl.h>
      +#endif
      +#ifndef PATH_MAX
       #define PATH_MAX MAXPATHLEN
       #endif
       #endif
      --
    9. ma8ma commented on Apr 21, 2015

      ma8mamannequin
      Mannequin

      This issue resolved on default branch in bpo-20597 .

      In 3.4 branch latest, PATH_MAX seems unused already in Modules/main.c:12 and Python/pythonrun.c:35.
      I want to cherry-pick bpo-20597 to 3.4 branch.

    10. ma8ma commented on Nov 2, 2017

      ma8mamannequin
      Mannequin

      This issue has been out-of-date since Python 3.4 maintenance became security status.

    11. berkerpeksag commented on Nov 2, 2017

      @berkerpeksag
      Member

      Thank you for doing issue triage, Masayuki!

    12. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      OS-windowsbuild

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions