Skip to content

Fix Windows build#90

Merged
dvarrazzo merged 4 commits intodvarrazzo:masterfrom
petrutlucian94:vs_variable_fix
Dec 11, 2020
Merged

Fix Windows build#90
dvarrazzo merged 4 commits intodvarrazzo:masterfrom
petrutlucian94:vs_variable_fix

Conversation

@petrutlucian94
Copy link
Copy Markdown
Contributor

@petrutlucian94 petrutlucian94 commented Dec 4, 2020

Fix Windows build

At the moment, py-setproctitle cannot be compiled using Visual
Studio, which complains about a certain static variable initialization.

This PR updates this initialization, allowing the project
to be compiled successfully: http://paste.openstack.org/raw/800734/

At the same time, we're providing GitHub actions that will take care
of building Windows Python wheels.

Closes: #89
Related issue: #47

Signed-off-by: Lucian Petrut lpetrut@cloudbasesolutions.com

At the moment, py-setproctitle cannot be compiled using Visual
Studio, which complains about a certain static variable initialization.

This simple patch updates this initialization, allowing the project
to be compiled successfully: http://paste.openstack.org/raw/800734/

Closes: dvarrazzo#89

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
@dvarrazzo
Copy link
Copy Markdown
Owner

Thank you very much for this contribution! 💜

@dvarrazzo
Copy link
Copy Markdown
Owner

Have you noticed the warnings?

D:\a\py-setproctitle\py-setproctitle\src\spt_python.h(36): warning C4273: 'Py_GetArgcArgv': inconsistent dll linkage
C:\hostedtoolcache\windows\Python\3.9.0\x64\include\cpython/initconfig.h(456): note: see previous definition of 'Py_GetArgcArgv'
src/spt_setup.c(23): warning C4273: '__p__environ': inconsistent dll linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\stdlib.h(1158): note: see previous definition of '__p__environ'

Are them anything to worry about?

@petrutlucian94
Copy link
Copy Markdown
Contributor Author

petrutlucian94 commented Dec 4, 2020

Have you noticed the warnings?

D:\a\py-setproctitle\py-setproctitle\src\spt_python.h(36): warning C4273: 'Py_GetArgcArgv': inconsistent dll linkage
C:\hostedtoolcache\windows\Python\3.9.0\x64\include\cpython/initconfig.h(456): note: see previous definition of 'Py_GetArgcArgv'
src/spt_setup.c(23): warning C4273: '__p__environ': inconsistent dll linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt\stdlib.h(1158): note: see previous definition of '__p__environ'

Are them anything to worry about?

Those are being redefined, it doesn't affect the build though.

I think the __p__environ one can be easily avoided. I'm not sure about Py_GetArgcArgv, some Python versions might not publicly expose it, based on those commits:

1e6f340
python/cpython@dedaac0

On Windows, "environ" is a macro that expands to __p__environ [1],
which is an array of strings.

This commit will avoid redefining it.

https://docs.microsoft.com/en-us/cpp/c-runtime-library/environ-wenviron?view=msvc-160

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
This patch will add a few simple Windows setproctitle tests.
The existing ones are Linux specific, so we're going to add
a new file while using module-level platform checks.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
@petrutlucian94 petrutlucian94 force-pushed the vs_variable_fix branch 2 times, most recently from 1f7beeb to 0f46dfd Compare December 7, 2020 08:33
This commit adds Github workflows for building the Windows wheels
and running the tests.

Related issue: dvarrazzo#47

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
@petrutlucian94
Copy link
Copy Markdown
Contributor Author

@dvarrazzo Thanks for feedback. I've added x86 packages as well as some tests. Please let me know if there's anything else that I should add.

@dvarrazzo
Copy link
Copy Markdown
Owner

Hi @petrutlucian94 thank you very much for your contribution!

I will try to review and merge the branch as soon as I have time, in the next days.

Very appreciated, thank you :)

@dvarrazzo dvarrazzo merged commit a9f50c2 into dvarrazzo:master Dec 11, 2020
@dvarrazzo
Copy link
Copy Markdown
Owner

Merged to master, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

win32: error C2099: initializer is not a constant

2 participants