Skip to content
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

compile error with python3.7 on mac #36

Closed
HughesLou opened this issue Sep 16, 2018 · 22 comments
Closed

compile error with python3.7 on mac #36

HughesLou opened this issue Sep 16, 2018 · 22 comments

Comments

@HughesLou
Copy link

hi, when I try to insall dukpy with latest version 0.2.2 (or 0.2.1, 0.2.0) on mac, some error messages occur.

Mac: RELEASE_X86_64 x86_64
Python: 3.7
pip3: 18.0

when run command:
pip3 install dukpy

error messages:
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I./src/duktape -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/duktape/duktape.c -o build/temp.macosx-10.13-x86_64-3.7/src/duktape/duktape.o
duk_bi_date_unix.c:53:15: error: array has incomplete element type 'struct tm'
struct tm tms[2];
^
duk_bi_date_unix.c:53:9: note: forward declaration of 'struct tm'
struct tm tms[2];
^
duk_bi_date_unix.c:134:28: error: invalid application of 'sizeof' to an incomplete type 'struct tm'
DUK_MEMZERO((void *) tms, sizeof(struct tm) * 2);
^ ~~~~~~~~~~~
./src/duktape/duk_config.h:1965:46: note: expanded from macro 'DUK_MEMZERO'
#define DUK_MEMZERO(p,n) DUK_MEMSET((p), 0, (n))
^
/usr/include/secure/_string.h:76:33: note: expanded from macro 'memset'
__builtin___memset_chk (dest, VA_ARGS, __darwin_obsz0 (dest))
^~~~~~~~~~~
duk_bi_date_unix.c:53:9: note: forward declaration of 'struct tm'
struct tm tms[2];
...

Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/x0/y4wx_dy95cg6kshhsnnvlhkr0000gn/T/pip-install-nemfkg94/dukpy/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/x0/y4wx_dy95cg6kshhsnnvlhkr0000gn/T/pip-record-afo8rlwm/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/x0/y4wx_dy95cg6kshhsnnvlhkr0000gn/T/pip-install-nemfkg94/dukpy/

@webknjaz
Copy link
Contributor

@amol- I think it might be a good idea to add macOS builds to Travis CI matrix..

@webknjaz
Copy link
Contributor

@HughesLou what was the last one not failing?

@amol-
Copy link
Owner

amol- commented Sep 19, 2018

I don't think it's related to changes to the codebase.
I use OSX as my development environment daily and it compiles fine on 3.7:

(venv37) Pulsar:dukpy amol$ python setup.py build
running build
running build_py
creating build/lib.macosx-10.12-x86_64-3.7
creating build/lib.macosx-10.12-x86_64-3.7/dukpy
...
building 'dukpy._dukpy' extension
creating build/temp.macosx-10.12-x86_64-3.7
creating build/temp.macosx-10.12-x86_64-3.7/src
creating build/temp.macosx-10.12-x86_64-3.7/src/duktape
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I./src/duktape -I/Users/amol/.pyenv/versions/3.7-dev/include/python3.7m -c src/duktape/duktape.c -o build/temp.macosx-10.12-x86_64-3.7/src/duktape/duktape.o
warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option]
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I./src/duktape -I/Users/amol/.pyenv/versions/3.7-dev/include/python3.7m -c src/_support.c -o build/temp.macosx-10.12-x86_64-3.7/src/_support.o
warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option]
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DDUK_OPT_DEEP_C_STACK=1 -DDUK_OPT_NONSTD_REGEXP_DOLLAR_ESCAPE=1 -DDUK_OPT_OCTAL_SUPPORT=1 -I./src/duktape -I/Users/amol/.pyenv/versions/3.7-dev/include/python3.7m -c src/pyduktape.c -o build/temp.macosx-10.12-x86_64-3.7/src/pyduktape.o
warning: unknown warning option '-Werror=unused-command-line-argument-hard-error-in-future'; did you mean '-Werror=unused-command-line-argument'? [-Wunknown-warning-option]
1 warning generated.
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/Users/amol/.pyenv/versions/3.7-dev/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl/lib -L/Users/amol/.pyenv/versions/3.7-dev/lib -Wno-error=unused-command-line-argument-hard-error-in-future build/temp.macosx-10.12-x86_64-3.7/src/duktape/duktape.o build/temp.macosx-10.12-x86_64-3.7/src/_support.o build/temp.macosx-10.12-x86_64-3.7/src/pyduktape.o -o build/lib.macosx-10.12-x86_64-3.7/dukpy/_dukpy.cpython-37m-darwin.so
(venv37) Pulsar:dukpy amol$

Probably something to do with the OS configuration or version.

@webknjaz
Copy link
Contributor

Wrong compile time dependency?

@webknjaz
Copy link
Contributor

Still, having this in CI won't hurt.

@amol-
Copy link
Owner

amol- commented Sep 20, 2018

I'm not against it, just didn't have time to :D

@webknjaz
Copy link
Contributor

Leave it to me. I've got some good experience with various CI stuff :)

@HughesLou
Copy link
Author

@HughesLou what was the last one not failing?

I haven't installed dukpy with any previous Python version. it's the first time on my Mac with Python 3.7

@HughesLou
Copy link
Author

build/lib.macosx-

OS version is 10.13

running install
running build
running build_py
creating build
creating build/lib.macosx-10.13-x86_64-3.7
creating build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/run.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/init.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/lessc.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/evaljs.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/babel.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/install.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy
copying dukpy/coffee.py -> build/lib.macosx-10.13-x86_64-3.7/dukpy

@amol-
Copy link
Owner

amol- commented Dec 11, 2018

@webknjaz Are you still willing to experiment on this? I noticed there were a bunch of reports for people having problems installing dukpy on OSX. Even though I develop on OSX and thus I can confirm it works fine in a properly set environment, I'd say that it would be great to get rid of the problems those users are facing.

@webknjaz
Copy link
Contributor

webknjaz commented Feb 7, 2019

The last part in the puzzle is to ship wheels for macOS users: https://github.com/amol-/dukpy/pull/40#issuecomment-461389162

@amol-
Copy link
Owner

amol- commented Jun 9, 2020

closing as we now provide wheels for OSX

@amol- amol- closed this as completed Jun 9, 2020
@webknjaz
Copy link
Contributor

@amol- in fact, only tests run on macOS, jobs for publishing the wheels were never added and so they are not published to PyPI: https://pypi.org/project/dukpy/0.2.3/#files.

@amol-
Copy link
Owner

amol- commented Jun 10, 2020

oh you are right! I don't know why I was sure it was done.
Reopening!

@amol- amol- reopened this Jun 10, 2020
@webknjaz
Copy link
Contributor

I think I wanted to do this but never found the time.

@webknjaz
Copy link
Contributor

FTR I now have a state-of-the-art GitHub Actions workflow that implements build->test->publish stages with testing exactly the same artifacts that are being uploaded later: https://github.com/ansible/pylibssh/blob/devel/.github/workflows/build-test-n-publish.yml.

@amol-
Copy link
Owner

amol- commented Jun 10, 2020

@webknjaz have you ever tried https://github.com/joerick/cibuildwheel ?
It seems fairly easy to integrate in build pipelines

@webknjaz
Copy link
Contributor

I've been meaning to try it out for a while but haven't had time. Also, my case is a bit more complicated than that anyway.

In fact, I've participated in the review of one of their recent PRs where they've debated whether they should use my GHA in their example: https://github.com/joerick/cibuildwheel/pull/362/files#diff-b4971e357cad581b8716b72ee38f58a5R77-R81.

@BoboTiG
Copy link
Contributor

BoboTiG commented Nov 10, 2020

Wheels for macOS would be very great indeed 👍 :)

@webknjaz
Copy link
Contributor

FWIW with Travis bailing on FOSS it's recommended to migrate to GHA that would also unify the build workflows

@amol-
Copy link
Owner

amol- commented Jun 3, 2022

Wheels for OSX are now provided at release time, see https://github.com/amol-/dukpy/releases/tag/wheels-test
M1 wheels are not yet available but I plan to implement them in the next few weeks

@amol- amol- closed this as completed Jun 3, 2022
@webknjaz
Copy link
Contributor

M1 wheels are not yet available but I plan to implement them in the next few weeks

I'm hearing that Macstadium can give a free VM for FOSS, wonder if it's hard to plug it into GHA...

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

No branches or pull requests

4 participants