Skip to content

Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail #46486

Closed

Description

@jlt63
mannequin
BPO 2233
Superseder
  • bpo-45537: Cygwin is unsupported - close all open issues and list them here.
  • Files
  • python.patch: Remove extra slashes Makefile.pre.in patch
  • Makefile.pre.in.diff
  • py-issue-2233.patch: shell based solution
  • Makefile.pre.in.v2.diff
  • 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 2021-10-20.12:19:58.479>
    created_at = <Date 2008-03-04.17:47:50.277>
    labels = ['build', 'OS-windows']
    title = 'Makefile.pre.in contains extra slash before $(DESTDIR) which can cause Cygwin build to fail'
    updated_at = <Date 2021-10-21.09:56:42.567>
    user = 'https://bugs.python.org/jlt63'

    bugs.python.org fields:

    activity = <Date 2021-10-21.09:56:42.567>
    actor = 'iritkatriel'
    assignee = 'jlt63'
    closed = True
    closed_date = <Date 2021-10-20.12:19:58.479>
    closer = 'iritkatriel'
    components = ['Build', 'Windows']
    creation = <Date 2008-03-04.17:47:50.277>
    creator = 'jlt63'
    dependencies = []
    files = ['9603', '12652', '12725', '12741']
    hgrepos = []
    issue_num = 2233
    keywords = ['patch']
    message_count = 12.0
    messages = ['63256', '78715', '78725', '79413', '79567', '79704', '79855', '79874', '79877', '80350', '222604', '222658']
    nosy_count = 2.0
    nosy_names = ['jlt63', 'rpetrov']
    pr_nums = []
    priority = 'low'
    resolution = 'wont fix'
    stage = 'resolved'
    status = 'closed'
    superseder = '45537'
    type = 'compile error'
    url = 'https://bugs.python.org/issue2233'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    Activity

    1. jlt63 commented on Mar 4, 2008

      jlt63mannequin
      MannequinAuthor

      Makefile.pre.in contains extra slash before $(DESTDIR) in two locations
      as in the following:

      sharedinstall:
      $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
      --prefix=$(prefix) \
      --install-scripts=$(BINDIR) \
      --install-platlib=$(DESTSHARED) \
      --root=/$(DESTDIR)

      This causes Cygwin builds to fail if DESTDIR is set as follows:

      creating //tmp
      error: could not create '//tmp': No such host or network path

      The following Open Group Specification:

      http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html

      indicates the following:

      4.11 Pathanme Resolution

      [snip]

      A pathname that begins with two successive slashes may be interpreted
      in an implementation-defined manner,...

      IMO, these extra slashes should be removed as indicated in the
      attached patch. OK to commit? If so, to which branches?

    2. self-assigned this
      on Mar 4, 2008
    3. added
      buildThe build process and cross-build
      on Mar 4, 2008
    4. rpetrov commented on Jan 1, 2009

      rpetrovmannequin
      Mannequin

      I would like to confirm issue for trunk.

    5. rpetrov commented on Jan 1, 2009

      rpetrovmannequin
      Mannequin

      I'm not sure that installation work if slash is removed and DESTDIR is
      not specified. What about to replace "slash before $(DESTDIR)" with "/./" ?

    6. jlt63 commented on Jan 8, 2009

      jlt63mannequin
      MannequinAuthor

      Sorry for the delay, but I was on vacation and then recovering from
      vacation...

      You are correct that my initial patch does not handle the case when
      DESTDIR is not specified. Your suggestion will work, but seems hacky.

      What about adding the defaulting of DESTDIR to "/" to my initial
      patch? This seems cleaner. See my second patch for the details.

      If this approach is acceptable, then feel free to move the defaulting
      of DESTDIR to a more appropriate place in Makefile.pre.in. I wasn't
      sure where to put this change.

    7. rpetrov commented on Jan 10, 2009

      rpetrovmannequin
      Mannequin

      Jason, did you test what is result is DESTDIR default to "/".

      This variable(macro) is used with specific syntax by example (from
      Makefile):
      $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
      where $$b is absolute path.

    8. jlt63 commented on Jan 12, 2009

      jlt63mannequin
      MannequinAuthor

      Obviously not... :,(

      It seems like we might have to go with your "/./" workaround, but let
      me see if I can come up with another approach.

    9. jlt63 commented on Jan 14, 2009

      jlt63mannequin
      MannequinAuthor

      Your latest patch is on the right track, but see my latest one,
      Makefile.pre.in.v2.diff, for an optimization. I tested make install
      with and without DESTDIR defined on the command line and both cases
      behaved as expected.

    10. rpetrov commented on Jan 14, 2009

      rpetrovmannequin
      Mannequin

      Hi Jason,
      quick review without tests - I expect $${DESTDIR:-/} to work without :
      in expression, i.e. just $${DESTDIR-/}.

      The ":" in expression is not so portable (some shells fail on this).
      Please see "Shell Substitutions" in autoconf manual.

    11. jlt63 commented on Jan 14, 2009

      jlt63mannequin
      MannequinAuthor

      I guess you mean the following:

      ${var:-value}
      Old BSD shells, including the Ultrix sh, don't accept the colon for
      any shell substitution, and complain and die.

      If so, should we just go forward without the colon? The bash manpage
      indicates the following:

      In each of the cases below, ... bash tests for a parameter that is
      unset or null; omitting the colon results in a test only for a
      parameter that is unset.

      So, if a user executes "make DESTDIR= install", then the build will
      fail. Or, maybe we shouldn't worry about that corner case.

      What do you think?

    12. rpetrov commented on Jan 21, 2009

      rpetrovmannequin
      Mannequin

      No response from py-dev list :( . May be solution has to work in all cases.

    13. BreamoreBoy commented on Jul 9, 2014

      BreamoreBoymannequin
      Mannequin

      Is this still a problem with cygwin?

    14. jlt63 commented on Jul 10, 2014

      jlt63mannequin
      MannequinAuthor

      AFAICT, yes.

    15. 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-windowsbuildThe build process and cross-build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions