-
Notifications
You must be signed in to change notification settings - Fork 1
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
Tristan/build windows #6
base: jw/0.0
Are you sure you want to change the base?
Conversation
So what happened with the C++17 setting ? I don't remember needing to set that. Here is my default profile that conan found:
|
build_conan.py
Outdated
subprocess.run([CONAN, 'config', 'install', './conan-config'], shell=True, | ||
stdout=subprocess.DEVNULL, | ||
# might want to log this? | ||
subprocess.run([CONAN, 'config', 'install', f'{os.getcwd()}/conan-config'] |
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.
Ya - I think we need to at least check for failure here.
I think as long as the error goes to stdout - then when slm
runs the task - it will dump the task output.
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.
Nevermind I think it throws an exception on error code. So the script will fail regardless.
print(f'Check logfile \'{CONAN_LOG}\' for progress.') | ||
print() | ||
|
||
with open(CONAN_LOG, 'w+') as logfile : |
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.
The log setup here is a good idea 👍
|
||
# might want something more robust here | ||
try: | ||
os.mkdir(OUTPUT_DIR) |
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.
os.makedirs
has an option exist_ok
https://docs.python.org/3/library/os.html#os.makedirs
CONAN_HOST_PROFILE = os.environ.get('CONAN_HOST_PROFILE', 'default') | ||
SLM_BUILD_DYNAMIC_LIB = os.environ.get('SLM_BUILD_DYNAMIC_LIB', 'False').capitalize() | ||
|
||
def no_conan_profile () : |
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.
Why not use:
(venv) ➜ lbstanza-z3 git:(master) conan profile show -pr asdf
ERROR: Profile not found: asdf
Here instead of digging around in conan
's internals?
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.
Good catch
print(f" VIRTUAL_ENV: {os.environ.get('VIRTUAL_ENV')}") | ||
|
||
# TODO: is there something smarter to do? | ||
subprocess.run([sys.executable, '-m', 'pip', 'install', '-r' 'requirements.txt'], |
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.
At least for this repository - this is unnecessary. The requirements.txt
file is really only there to support installing conan
if it doesn't exist. I think this script is making the assumption that conan
is present in the environment - correct?
The wrapper_requirements.txt
is not required to build the dependency - it is only needed to generate the Wrapper.stanza
file from the Z3 header file.
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.
If we move the LBStanzaGenerator
and lbstanza_deployer
to a pip installable package then this pip install
becomes pertinent again.
print([CONAN, 'config', 'install', f'{os.getcwd()}/conan-config']) | ||
subprocess.run([CONAN, 'config', 'install', f'{os.getcwd()}/conan-config'], |
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.
From what I can tell - the conan config install
command here is really just installing the lbstanza_deployer
and the LBStanzaGenerator
into conan.
I think we can move the LBStanzaGenerator
into the conanfile.py
- Something like:
from stanza import LBStanzaGenerator
...
class StanzaZ3Recipe(ConanFile):
...
generators = "LBStanzaGenerator"
Where the stanza
package is a pip installable package that we construct and push to pypi.
For the deployer - I don't know if there is a way to set the deployer in the conanfile.py
or in some way that it is discoverable by conan. For example - could we pip install a package with the lbstanza_deployer
in it and then pass the full path reference to it on the command line:
--deployer=stanza.lbstanza_deployer
I guess what I'm concerned about is:
- This is going to run on every build - increases build time.
- If two projects have this same setup and their scripts are different versions - what does Conan do? Are they going to fight ? Is the first/last one that gets installed going to win and then always be used for all the deps ?
else | ||
echo "done." | ||
fi | ||
python3 build_conan.py |
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.
Can we move this into the slm.toml
file now that it is just a single line:
libz3.task = { command = "python3 build_conan.py" }
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.
oh yep definitely.
This PR essentially just translates the .sh script to python for use across platforms. This does work on windows (assuming the user has an appropriate build profile set up).