gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: [Git][gpsd/gpsd][master] 3 commits: SConstruct: Add automatic pdb br


From: Gary E. Miller
Subject: Fw: [Git][gpsd/gpsd][master] 3 commits: SConstruct: Add automatic pdb breakpoint.
Date: Sun, 2 Aug 2020 19:06:41 -0700

Yo Fred!

> This now allows specifying just the program name, as an alternative to
> the full path.  Values without a leading slash automatically have
> "/usr/bin/env " prepended.  The default is now simply
> 'python', which has the same result as before, but with a
> better example in the help text.

Pretty late for a change like this.  At this point we should be only
fixing obivous bugs, nothing "nice to have".  Now a lot of tests need
to be re-run.  Seems to me added complexity, and obfuscation, for zero
benefit.

What exactly is the benefit?

> It's not clear that making python_shebang and target_python
> independent is either useful or convenient, but that issue isn't
> addressed here.

There are a number of cross-compiling and multi-slot reasons to do this.
Which why it was done after many requests.

> At least it's now valid to set them to the same
> value in all cases.

And the benefit of that is?

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Fred Wright pushed to branch master at gpsd / gpsd

Commits:

1 changed file:

Changes:

  • SConstruct
    ... ... @@ -46,6 +46,18 @@ from distutils import sysconfig
    46 46
     import SCons
    
    47 47
     
    
    48 48
     
    
    49
    +# Facilitate debugging with pdb.
    
    50
    +# At pdb startup, the environment is such that setting breakpoints in
    
    51
    +# SConstruct requires specifying its full absolute path, which is incovenient.
    
    52
    +# Stopping here at an automatic breakpoint makes this easier.  Note that this
    
    53
    +# code has no effect unless pdb is loaded.
    
    54
    +# To use this, run with pdb and continue from the initial pdb prompt.
    
    55
    +pdb_module = sys.modules.get('pdb')
    
    56
    +if pdb_module:
    
    57
    +    pdb_module.set_trace()
    
    58
    +    pass  # Breakpoint default file is now SConstruct
    
    59
    +
    
    60
    +
    
    49 61
     # ugly hack from http://www.catb.org/esr/faqs/practical-python-porting/
    
    50 62
     # handle python2/3 strings
    
    51 63
     def polystr(o):
    
    ... ... @@ -91,6 +103,28 @@ def _getstatusoutput(cmd, nput=None, shell=True, cwd=None, env=None):
    91 103
         return (status, output)
    
    92 104
     
    
    93 105
     
    
    106
    +# Workaround for old SCons bug that couldn't overwrite existing symlinks
    
    107
    +# This was fixed in 2.3.2, but we allow 2.3.0 (e.g., on Ubuntu 14)
    
    108
    +#
    
    109
    +# In the troublesome versions, we monkey-patch os.symlink to bully it through
    
    110
    +
    
    111
    +standard_os_symlink = os.symlink
    
    112
    +
    
    113
    +def _forced_symlink(source, link_name):
    
    114
    +    try:
    
    115
    +        standard_os_symlink(source, link_name)
    
    116
    +    except OSError:
    
    117
    +        # Out of paranoia, only do this when the target is a symlink
    
    118
    +        if os.path.islink(link_name):
    
    119
    +            os.remove(link_name)
    
    120
    +            standard_os_symlink(source, link_name)
    
    121
    +        else:
    
    122
    +            raise
    
    123
    +
    
    124
    +if SCons.__version__ in ['2.3.0', '2.3.1']:
    
    125
    +    os.symlink = _forced_symlink
    
    126
    +
    
    127
    +
    
    94 128
     # TODO: this list is missing stuff.
    
    95 129
     # built man pages found in all_manpages
    
    96 130
     generated_sources = [
    
    ... ... @@ -422,7 +456,7 @@ nonboolopts = (
    422 456
         ("prefix",           "/usr/local",  "installation directory prefix"),
    
    423 457
         ("python_coverage",  "coverage run", "coverage command for Python progs"),
    
    424 458
         ("python_libdir",    "",            "Python module directory prefix"),
    
    425
    -    ("python_shebang",   "/usr/bin/env python", "Python shebang"),
    
    459
    +    ("python_shebang",   "python",      "Python shebang (path or program)"),
    
    426 460
         ("qt_versioned",     "",            "version for versioned Qt"),
    
    427 461
         ("rundir",           rundir,       "Directory for run-time variable data"),
    
    428 462
         ("sysroot",          "",
    
    ... ... @@ -2011,6 +2045,9 @@ with open('gpsd.h') as sfp:
    2011 2045
                     pythonized_header += ('%s = %s\n' %
    
    2012 2046
                                           (_match3.group(1), _match3.group(2)))
    
    2013 2047
     
    
    2048
    +if not env['python_shebang'].startswith(os.path.sep):
    
    2049
    +    env['python_shebang'] = '/usr/bin/env ' + env['python_shebang']
    
    2050
    +
    
    2014 2051
     # tuples for Substfile.  To convert .in files to generated files.
    
    2015 2052
     substmap = (
    
    2016 2053
         ('@ANNOUNCE@',   annmail),
    

  • Attachment: pgp_cYfpoVHFF.pgp
    Description: OpenPGP digital signature


    reply via email to

    [Prev in Thread] Current Thread [Next in Thread]