-
Notifications
You must be signed in to change notification settings - Fork 4
Add config options for build and python versions. Add configs for windows and linux arm64. #38
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
base: master
Are you sure you want to change the base?
Conversation
5f1183a
to
d0fbdcf
Compare
I tried adding windows and linux arm64 builds, but they are failing because of binary incompatibility:
That's a ToDo for the future. Arm runners are currently an Enterprise feature. The strip problem may be solvable with more infrastructure: https://github.com/electron/electron/blob/main/script/strip-binaries.py#L16-L25 But then, we also run |
b247007
to
13e116a
Compare
13e116a
to
bc7f14a
Compare
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.
A lot to look at, will have to do a deeper look later.
auto py_minor = std::to_string(PY_MINOR_VERSION); | ||
auto py_version = py_major + "." + py_minor; | ||
auto py_version_no_dot = py_major + py_minor; | ||
auto python_zip_name = "python" + py_version_no_dot + ".zip"; |
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.
Naming of the zip here is pretty standard. I believe there is a document in the python manual detailing the layout, but don't have a link on hand.
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's been a while so I don't remember my reason for changing it. I think it was because I wanted the zip
name to be consistent with the lib
name, which uses dots (e.g. python3.2
). That makes more sense to me, but I suppose if there's a PEP for a python lib zip name, I agree we should adhere to it.
bc7f14a
to
c91852d
Compare
env['python'] = prepare_python.prepare_for_platform(env['platform'], env['arch'], | ||
src_dir = src, dest_dir = dest) | ||
|
||
prepare_python_alias = env.Alias("prepare_python", [ |
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 was the alias removed? I think the alias may have existed to ensure something else built or for some build optimization (don't remember exactly)
May need to review this part again once I understand what's happening better.
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's been a while, but IIRC the Command
usage did pretty much the same as Builder(Action)
which is in use right now, but more concisely and with less call overhead. I didn't find a reason why it was implemented with aliases and builders.
|
||
|
||
def _append_python_config(env, target, **kwargs): | ||
src_dir = generated_path / 'python' / prepared_python_config.name |
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.
Note to self: became overwhelmed by above, once understand above better review from here to end of file.
class PlatformConfig: | ||
platform: str | ||
arch: str | ||
python_version_major: str |
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.
Naming of these is confusing me, would like to come up with something more concise as well as descriptive.
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 the members? I'm open to any changes :)
If you're referring to the python version names specifically, those are named from semver's major-minor-patch
system.
|
||
shutil.make_archive(dest_dir / f'python{config.python_version_minor}-lib', 'zip', root_dir=src / config.python_lib_dir, base_dir='') | ||
|
||
if __name__ == '__main__': |
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.
I might want to add this back but that can be a separate patch for later
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 didn't really make sense to me anymore because the new system allows for thousands of configs (based on indygreg version numbers), instead of just a handful like before.
…ell as python version. Move build files. Unlock windows and linux build configs for arm64.
c91852d
to
1747cf6
Compare
This is quite a big change. Review required. I haven't tested running this with different python versions yet, will do this later.
Note (I think) the
"python"
option available previously didn't do anything, as the environment variable was overridden anyway.