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

Build update #796

Merged
merged 5 commits into from
Nov 22, 2023
Merged

Build update #796

merged 5 commits into from
Nov 22, 2023

Conversation

aprsa
Copy link
Contributor

@aprsa aprsa commented Nov 20, 2023

This is an upgrade from @Raindogjones' previous PR to replace distutils; this one goes farther by switching to pyproject.toml, using setuptools as backend and build/pip as frontend.

Note that C/C++ compiler versions/flags have not been ported (yet); the only currently supported way to do that is clunky (it goes back to setup.py with custom functions) but there's a PEP 725 under consideration that would streamline this significantly. @horvatm should weigh in on this whether we should re-add the tests into setup.py or await PEP 725.

Closes #644

The original distutils-based system has been replaced with setuptools and pyproject.toml. C/C++ compiler version and flags are currently not checked; we should either re-implement the checks in setup.py or wait for PEP 725 (https://discuss.python.org/t/pep-725-specifying-external-dependencies-in-pyproject-toml/31888?page=1) to see the light of day.
This includes CI updates (adding optional modules) and renaming nosetests to tests.
@Raindogjones
Copy link
Contributor

As of right now, the C/C++ stuff looks like a show-stopper for my system.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang++' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for phoebe

@aprsa
Copy link
Contributor Author

aprsa commented Nov 20, 2023

Can you please share your system details? Also, how are you trying to install it? pip with or without -e?

@Raindogjones
Copy link
Contributor

Raindogjones commented Nov 20, 2023

Tried both with and without -e, still fails (albeit with a different error: using -e tells me to try not using -e).

I'm on OS X 13.6.1 on a 2018 intel Mac
Python 3.11.4
Apple clang version 15.0.0 (clang-1500.0.40.1)
gcc version 12.3.0 (Homebrew GCC 12.3.0)

I'm a bit confused about the error it throws (that could be because it's late and I'm tired though). Looks to me like it should be gcc-12 but then complains about a clang error - see attached
output.txt

@aprsa
Copy link
Contributor Author

aprsa commented Nov 21, 2023

The latest macos runner that github actions support is macos-12. Thus, I don't know how to test/troubleshoot macos-13 without having my hands on one. Does building sdist/wheel work? python -m build, probably after pip install build.

@Raindogjones
Copy link
Contributor

Nope, looks a lot like the same error.
output.txt

@aprsa
Copy link
Contributor Author

aprsa commented Nov 21, 2023

I think it might be your system, not phoebe. Can you link any c/c++ executables?

@aprsa
Copy link
Contributor Author

aprsa commented Nov 21, 2023

A possible CXXFLAGS='-Wl,-ld_classic' workaround is mentioned; does that help?

@Raindogjones
Copy link
Contributor

Yeah, this is weird. Can't link with g++-12 or g++13 but clang++ is working. So setting CC=clang worked. Problem was definitely on my end.

Copy link
Member

@horvatm horvatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything problematic.

@kecnry
Copy link
Member

kecnry commented Nov 21, 2023

So setting CC=clang worked.

@Raindogjones - is this something that you didn't need to do manually before though? And if it is just a weird setup, should we provide some advice somewhere on the install page for how to handle these cases?

When we release this, I can also update the install page to suggest pip install -e . in the Installing from Source instructions. Anything else I should add either there or elsewhere on that page?

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all the renaming from "nosetests" to "tests" to actually migrate to pytest or is it required for the rest of the changes?

I am just worried about dealing with conflicts in feature branches as we try to propagate this there. If we don't need to do it now, maybe we add it to the list of changes to make once we can close out those feature branches?

@Raindogjones
Copy link
Contributor

@kecnry I don't think any of that is necessary. Seems this is a common problem of apple's xcode 15 not playing well with homebrew's gcc. I hadn't realised before because I only updated xcode ~a month ago and haven't done much coding since. Easy workarounds are to build gcc from source or to stick to clang. I also read somewhere that this is fixed in the current xcode beta so will go away soon.

Copy link
Contributor

@Raindogjones Raindogjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long story short, I can now install easily with either clang or gcc on my mac. So, I see no reason to hold this.

do = ['tutorials', 'doctests', 'nosetests', 'pylint', 'benchmark']
do = ['tutorials', 'doctests', 'tests', 'pylint', 'benchmark']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will also need a change to website instructions

@aprsa
Copy link
Contributor Author

aprsa commented Nov 21, 2023

Is all the renaming from "nosetests" to "tests" to actually migrate to pytest or is it required for the rest of the changes?

It is not required for the build system switch, I just seized the opportunity since I was updating the CI action that runs the tests. Keeping it labeled as nosetests is confusing and might make people want to run nose instead of pytest.

@aprsa aprsa merged commit 0164d7d into phoebe-project:bugfix-2.4.12 Nov 22, 2023
10 checks passed
@aprsa aprsa deleted the build_update branch November 22, 2023 18:39
'phoebe.solverbackends.knn': ['*.knn']
},
ext_modules = ext_modules,
scripts=None if _env_variable_bool('PHOEBE_SKIP_SCRIPTS', False) else ['client-server/phoebe-server', 'client-server/phoebe-autofig'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this - but it seems this removed support for installing these scripts... can this be reintroduced in the current setup?

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

Successfully merging this pull request may close these issues.

4 participants