[Scons-users] Single binary SCons and byte-code caching

Brad Kraemer computerpro_58 at hotmail.com
Thu Mar 10 21:31:29 EST 2022


Hi Fellows,

That makes sense. I don't currently have a need for an installer or 
self-contained binary (just a nice warm-fuzzy feeling thought about it). 
Judging from your response's though, it sounds like it would be a 
non-trivial amount of experimenting to get it to work (with all the 
potential corner-cases and whatnot). If I find myself in need of another 
side-project though I might do some experimenting and get back to you 
about any positive results.

As for my other issue, I was hit-and-miss on whether this would be 
something for SCons to change. It sounds like I'd be better off just 
waiting on the python community to square it up (I'm sure by Python 4.7 
or so they might default to using a specific state directory, i.e. 
~/.cache, AppData or similar).


Just for my future memory (and again not having a good grasp on the 
Python ecosystem), is PyInstaller the go-to project for making 
self-contained Python project?


Thanks,

Brad


On 2022-03-10 7:53 p.m., Bill Deegan wrote:
> Brad,
>
> We used to have .exe installer, but we've dropped that in favor of 
> recommending pypi install.
>
> There'd be a non-trivial amount of work getting pyinstaller working, 
> and ongoing maintenance.
> And we have almost zero users asking for it, so it's unlikely we'll 
> create a pyinstaller.
>
> If, for your use model, you need such, then feel free to roll your own.
> That said:
> python -mpip install scons
> Is pretty darned easy.
>
> Re byte codes, SCons is unlikely to support this request.
> It'd just add to the maintenance effort with so far (in 20 years) 1 
> user asking for it... ;)
>
> But as above, nothing stops you from modifying, forking, etc to make 
> SCons work in whatever way you desire.
>
> -Bill
>
> On Thu, Mar 10, 2022 at 1:32 PM Mats Wichmann <mats at wichmann.us> wrote:
>
>     On 3/10/22 13:25, Brad Kraemer wrote:
>     > Hello,
>     >
>     > I'm not very well versed in the Python ecosystem, but did note that
>     > their seem to be several projects which allow for a Python
>     application
>     > to be packaged into a single binary (ELF or PE). Has anyone
>     tried to do
>     > this with SCons? Perhaps not entirely self-contained (in the static
>     > sense) but at least a single launch point (where no pre-existing
>     Python
>     > installation is present).
>
>     pyinstaller can pretty much do this. might need some work - there's a
>     hook mechanism you use to teach it about things it can't detect
>     itself,
>     and some of the dynamic stuff scons does - umm, Tool importing in
>     particular comes to mind - might defeat it. That's just guessing,
>     never
>     tried it.
>
>     > Somewhat related I've noticed Python byte-code spawning in my Tools
>     > directories. I realize there is a benefit to this byte-code
>     being cached
>     > ahead of time, but this does feel like a implementation-from-design
>     > leak. As a workaround, I can (Python 3.3+) set the environment
>     variable
>     > PYTHONPYCACHEPREFIX to a better location which isn't within my Tools
>     > directories. As I look at this as a work around, I'm wondering
>     if this
>     > couldn't be set by SCons itself when starting up (or equivalent
>     Python
>     > functionality/variables)?
>
>     That's on behalf of the Python import system - keeping the bytecode
>     together with the source file (thankfully with Python 3 we at
>     least get
>     a subdirectory) keeps the logic natural - if you find the .pyc
>     there you
>     don't have to first compile the .py, but you don't want to go hunting
>     all over the place in the normal case.
>
>     _______________________________________________
>     Scons-users mailing list
>     Scons-users at scons.org
>     https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20220310/2b481d3d/attachment.htm>


More information about the Scons-users mailing list