Skip to content

Instantly share code, notes, and snippets.

View bdbaddog's full-sized avatar

William Deegan bdbaddog

View GitHub Profile
import distutils.sysconfig
import os
import os.path
import sys
import pprint
from pathlib import Path
cfg_vars_list = ['CC', 'CXX', 'OPT', 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO', 'BINDIR']
cfg_vars = {v: distutils.sysconfig.get_config_vars(v) for v in cfg_vars_list}
# cfg_vars['LIBPATH'] = "D:/software/python2714_32/libs"
@bdbaddog
bdbaddog / First run post clean build
Last active June 25, 2019 17:51
some profiling for md5-timestamp
Timer unit: 1e-06 s
Total time: 0.018178 s
File: /home/bdeegan/clients/mongodb/mongo/src/third_party/scons-3.0.4/scons-local-3.0.4/SCons/Node/FS.py
Function: _add_strings_to_dependency_map at line 3346
Line # Hits Time Per Hit % Time Line Contents
==============================================================
3346 @profile
3347 def _add_strings_to_dependency_map(self, dmap):
Williams-MacBook-Pro-2:tmp bdbaddog$ python bill_try_dict_keyerror.py
hiit: 0.04
hii : 0.03
nit : 0.82
nii : 0.07
Williams-MacBook-Pro-2:tmp bdbaddog$ python3.7 bill_try_dict_keyerror.py
hiit: 0.04
hii : 0.03
nit : 0.41
nii : 0.03
@bdbaddog
bdbaddog / Try SCons 3.0.5a3
Created March 15, 2019 22:22
Try SCons 3.0.5a3
virtualenv venv
. venv/bin/activate
pip install --index-url https://test.pypi.org/simple/ scons==3.0.5a3
scons --version
@bdbaddog
bdbaddog / SConstruct
Last active February 12, 2019 21:47
--config=force repro
AddOption('--show_bug', action='store_true', dest='show_bug', default=False,
help="Show the config=force bug")
env=Environment()
conf = Configure(env)
if not conf.CheckCXXHeader('vector.h'):
print 'vector.h must be installed!'
# Don't need this to cause the issue
# env = conf.Finish()
@bdbaddog
bdbaddog / example
Created October 23, 2018 04:32
id(i1) == id(i2), but i1 is i2 = False
(Pdb) p id(e1)
53016704
(Pdb) p id(e2)
53016704
(Pdb) p id(str(e1))
53001080
(Pdb) p id(str(e2))
53001080
(Pdb) str(e1) == str(e2)
True
@bdbaddog
bdbaddog / stacktrace
Created October 19, 2018 21:30
target_scanner issue
In Tool example _example_scanner(src/file1.exin, env, ()) [Environment:first one]
scons: *** [src/file1.example] TypeError : _example_target_scanner() takes exactly 1 argument (3 given)
scons: internal stack trace:
File "/Users/bdbaddog/devel/scons/git/as_scons/src/script/../engine/SCons/Job.py", line 199, in start
task.prepare()
File "/Users/bdbaddog/devel/scons/git/as_scons/src/script/../engine/SCons/Script/Main.py", line 176, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
File "/Users/bdbaddog/devel/scons/git/as_scons/src/script/../engine/SCons/Taskmaster.py", line 179, in prepare
self.exception_raise()
File "/Users/bdbaddog/devel/scons/git/as_scons/src/script/../engine/SCons/Taskmaster.py", line 559, in _exception_raise
@bdbaddog
bdbaddog / SCons Node __init__.py
Created May 2, 2018 20:02
2980 patch for SCons/Node/__init__.py
"""SCons.Node
The Node package for the SCons software construction utility.
This is, in many ways, the heart of SCons.
A Node is where we encapsulate all of the dependency information about
any thing that SCons can build, or about any thing which SCons can use
to build some other thing. The canonical "thing," of course, is a file,
but a Node can also represent something remote (like a web page) or
@bdbaddog
bdbaddog / README.txt
Last active April 30, 2018 22:49
WIP sphinx for scons API docs
# adjust to your path
sphinx-apidoc -f -o source/ ../../git/as_scons/src/engine/ "/Users/bdbaddog/devel/scons/git/as_scons/src/engine/SCons/*Tests.py"
# do this then answer the questions
sphinx-quickstart
# Then replace source/conf.py with below, but adjust the paths which are /Users/bdbaddog...
# replace source/index.rst with below
@bdbaddog
bdbaddog / SConstruct
Created February 23, 2018 20:01
How to add to SConscript namespace
env=Environment()
SConscript('src/SConscript',exports='env')