-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blender: add shim script for CLI use #18891
Conversation
supersedes #9101 |
shim script could be tested upon installation, e.g., # verify binary
postflight do
require 'tempfile'
tempfile = Tempfile.new('tmp.py')
tempfile.write 'import bpy\nprint(bpy.app.version_string)'
cmd = "blender --background --python #{tempfile.path}"
raise "Cannot run command `#{cmd}`" unless system cmd
end but did not stage that hunk, pending a proper solution (see #18830) |
end | ||
end | ||
|
||
binary shimscript, :target => 'blender' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be target: 'blender'
instead.
OK, commits are piling up. I'll be happy to squash if and when it's acceptable... =) |
File.open(shimscript, 'w') do |f| | ||
f.puts '#!/bin/bash' | ||
f.puts "export PYTHONHOME=#{staged_path}/blender-#{version}-OSX_10.6-x86_64/blender.app/Contents/Resources/#{version}/python/lib/python#{pythonversion}" | ||
f.puts "#{staged_path}/blender-#{version}-OSX_10.6-x86_64/blender.app/Contents/MacOS/blender $*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be "$@"
(quoted as it is), here. Using $*
will break in many cases (see differences).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, thanks for the hint!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this change, guess you can squash.
67b065a
to
4dbcaa9
Compare
OK, I just replaced all the incremental commits by a single new one. |
Just realised something. Travis will break here for sure (wrong stanza order). Instead of app
app
shimscript
preflight
binary try app
app
shimscript
binary
preflight And run |
Thanks, I did notice all the CI failures and was wondering what was going on! |
but I don't understand the failures on travis... |
I’ve seen this Travis hanging before, in otherwise correct changes (like #18879). Can you shed some light, @jawshooah? |
@@ -9,4 +9,17 @@ | |||
|
|||
app "blender-#{version}-OSX_10.6-x86_64/blender.app" | |||
app "blender-#{version}-OSX_10.6-x86_64/blenderplayer.app" | |||
# shim script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean actually inserting the full URL of #18809?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution. It needed some fixes, so they were made in 40754ec. Your contribution is still included (and still credited to you), with the appropriate modifications. Please feel free to ask about any of the changes. |
binary 'blender-#{version}-OSX_10.6-x86_64/blender.app/Contents/MacOS/blender'
is insufficient, since blender needs a customPYTHONPATH
pointing to its bundled python librarypreflight
, then linked withbinary