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

[ci] Appveyor builds failing #5507

Closed
jameslamb opened this issue Sep 25, 2022 · 5 comments · Fixed by #5510
Closed

[ci] Appveyor builds failing #5507

jameslamb opened this issue Sep 25, 2022 · 5 comments · Fixed by #5510

Comments

@jameslamb
Copy link
Collaborator

Description

For the last 2 days, Appveyor CI jobs have been failing, blocking development on this project.
I've seen these changes on several, totally-unrelated PRs (e.g. #5503, #5504, #5505, #5506), so I'm fairly sure it's related to that job's configuration and not breaking changes on PRs.

Reproducible example

See any recent appveyor jobs, for example this one from #5506: https://ci.appveyor.com/project/guolinke/lightgbm/builds/44872180/job/sxsvo19536lcd058.

Additional Comments

LightGBM is compiling successfully, but with several errors in the Python unit tests.

C:\Miniconda3-x64\envs\test-env\lib_pypy\_functools.py:80: in __call__
    return self._func(*(self._args + fargs), **fkeywords)
C:\Miniconda3-x64\envs\test-env\lib\site-packages\sklearn\utils\estimator_checks.py:3489: in check_fit_idempotent
    estimator.fit(X_train, y_train)
C:\Miniconda3-x64\envs\test-env\lib\site-packages\lightgbm\sklearn.py:1011: in fit
    init_model=init_model
C:\Miniconda3-x64\envs\test-env\lib\site-packages\lightgbm\sklearn.py:806: in fit
    callbacks=callbacks
C:\Miniconda3-x64\envs\test-env\lib\site-packages\lightgbm\engine.py:223: in train
    booster = Booster(params=params, train_set=train_set)
C:\Miniconda3-x64\envs\test-env\lib\site-packages\lightgbm\basic.py:2775: in __init__
    train_set.construct()
C:\Miniconda3-x64\envs\test-env\lib\site-packages\lightgbm\basic.py:1929: in construct
    self.feature_name = self.get_feature_name()
C:\Miniconda3-x64\envs\test-env\lib\site-packages\lightgbm\basic.py:2380: in get_feature_name
    ptr_string_buffers = (ctypes.c_char_p * num_feature)(*map(ctypes.addressof, string_buffers))
C:\Miniconda3-x64\envs\test-env\lib_pypy\_ctypes\array.py:203: in __init__
    self[i] = arg
C:\Miniconda3-x64\envs\test-env\lib_pypy\_ctypes\array.py:229: in __setitem__
    cobj = self._type_.from_param(value)
C:\Miniconda3-x64\envs\test-env\lib_pypy\_ctypes\primitive.py:382: in from_param
    return super(SimpleType, self).from_param(value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <class 'ctypes.c_char_p'>, value = 547343581888
    def from_param(self, value):
        if isinstance(value, self):
            return value
        try:
            as_parameter = value._as_parameter_
        except AttributeError:
            raise TypeError("expected %s instance instead of %s" % (
>               self.__name__, type(value).__name__))
E           TypeError: expected c_char_p instance instead of int
C:\Miniconda3-x64\envs\test-env\lib_pypy\_ctypes\basics.py:59: TypeError
_____ test_sklearn_integration[LGBMRegressor()-check_fit_check_is_fitted] _____
self = <class 'ctypes.c_char_p'>, value = 547343579440
    def from_param(self, value):
        if isinstance(value, self):
            return value
        try:
>           as_parameter = value._as_parameter_
E           AttributeError: 'int' object has no attribute '_as_parameter_'
C:\Miniconda3-x64\envs\test-env\lib_pypy\_ctypes\basics.py:56: AttributeError

Haven't investigated much yet, just opening this to track.

@jameslamb
Copy link
Collaborator Author

I suspect this is relevant... it looks like these builds are now getting a PyPy version of Python, instead of CPython.

From the full logs (link), it seems that the step installing graphviz and matplotlib

# matplotlib and python-graphviz have to be installed separately to prevent conda from downgrading to pypy
conda install -q -y -n $env:CONDA_ENV matplotlib python-graphviz ; Check-Output $?

is once again causing Python to be "downgraded" from a CPython-based build to a PyPy one 🙃

## Package Plan ##
  environment location: C:\Miniconda3-x64\envs\test-env
  added / updated specs:
    - matplotlib
    - python-graphviz
The following packages will be downloaded:
    package                    |            build
    ---------------------------|-----------------
    ...
    pypy3.7-7.3.7              |       h4094faa_3        26.2 MB  conda-forge
    pytest-7.1.1               |   py37h4c0cbd9_0         501 KB  conda-forge
    python-3.7.12              |        0_73_pypy           5 KB  conda-forge
    python-graphviz-0.20.1     |     pyh22cad53_0          35 KB  conda-forge
    python_abi-3.7             |    2_pypy37_pp73           4 KB  conda-forge
    ...
    ------------------------------------------------------------
                                           Total:       179.8 MB
The following NEW packages will be INSTALLED:
  ...
  pypy3.7            conda-forge/win-64::pypy3.7-7.3.7-h4094faa_3
  ...
The following packages will be DOWNGRADED:
  ...
  python                        3.7.12-h900ac77_100_cpython --> 3.7.12-0_73_pypy
  python_abi                                    3.7-2_cp37m --> 3.7-2_pypy37_pp73
  ...

This is not the first time this has happened. See #5197, #5198.

@shiyu1994
Copy link
Collaborator

shiyu1994 commented Sep 26, 2022

@jameslamb Thanks for opening this issue. Is it possible to resolve this issue for example by installing these two packages with pip instead of conda?

@jameslamb
Copy link
Collaborator Author

Maybe! Although that might bring its own environment-resolution issues. I'm not certain how to solve this, haven't had time to investigate it yet.

@jameslamb
Copy link
Collaborator Author

This was fixed in #5510.

I just accidentally put (fixes #5509) (wrong issue number) in the title.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot removed the blocking label Aug 19, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants