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

win32_deps_build: avoid pip #50916

Merged
merged 1 commit into from
Apr 18, 2023
Merged

win32_deps_build: avoid pip #50916

merged 1 commit into from
Apr 18, 2023

Conversation

petrutlucian94
Copy link
Contributor

@petrutlucian94 petrutlucian94 commented Apr 6, 2023

We're currently installing cython with pip when using Ubuntu to cross compile Ceph for Windows. This can fail with recent Python versions if attempting to use the global env:

  error: externally-managed-environment

  × This environment is externally managed
  ╰─> To install Python packages system-wide, try apt install
      python3-xyz, where xyz is the package you are trying to
      install.

Cython isn't really needed by the Windows build so we can go ahead and drop it. We were hoping to use the Python bindings on Windows, however Python extensions can't be cross compiled.

While at it, we'll also ensure that git is installed.

Fixes: https://tracker.ceph.com/issues/59354

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@petrutlucian94 petrutlucian94 added the win32 Specifix changes for the windows platform label Apr 6, 2023
@idryomov
Copy link
Contributor

idryomov commented Apr 7, 2023

  • Can you link where this popped up?
  • Would installing Cython from the distro repo work for Focal or is this specific to Jammy?

@petrutlucian94
Copy link
Contributor Author

petrutlucian94 commented Apr 7, 2023

  • Can you link where this popped up?
  • Would installing Cython from the distro repo work for Focal or is this specific to Jammy?

This error showed up while cross compiling using an Ubuntu 23.04 container. The cython3 package is also available for Focal: https://launchpad.net/ubuntu/focal/+package/cython3

More details about the updated pip behaviour:

@idryomov
Copy link
Contributor

jenkins test windows

@idryomov
Copy link
Contributor

The cython3 package is also available for Focal: https://launchpad.net/ubuntu/focal/+package/cython3

It's also available for Bionic, but an older version (0.26 vs 0.29): https://packages.ubuntu.com/bionic/cython3. Was that why you went with pip initially?

@petrutlucian94
Copy link
Contributor Author

petrutlucian94 commented Apr 11, 2023

On a second thought, we can actually drop the Cython dependency. We were trying to port the python bindings to Windows, however python extensions can't be cross compiled due to ABI incompatibilities.

About recent CI failures, I noticed that some tests occasionally time out. I think we're hitting winpthreads mutex issues again:

I've tried switching to mingw/llvm and it seems to fix the issue. libc++ doesn't use winpthreads, unlike libstdc++ with mingw/gcc.

LE: apart from the winpthreads issue, I think a regression was introduced last week. Windows clients are no longer able to connect to Ceph services. Looking into it.

@idryomov
Copy link
Contributor

LE: apart from the winpthreads issue, I think a regression was introduced last week. Windows clients are no longer able to connect to Ceph services. Looking into it.

On top of that ceph windows tests is impacted by an unrelated build failure:

Building boost.
Downloading boost.
Patching boost.
patching file boost/thread/pthread/thread_data.hpp

Could not find a suitable toolset.

You can specify the toolset as the argument, i.e.:
    ./build.sh [options] gcc

Toolsets supported by this script are:
    acc, clang, como, gcc, intel-darwin, intel-linux, kcc, kylix, mipspro,
    pathscale, pgi, qcc, sun, sunpro, tru64cxx, vacpp

For any toolset you can override the path to the compiler with the '--cxx'
option. You can also use additional flags for the compiler with the
'--cxxflags' option.

A special toolset; cxx, is available which is used as a fallback when a more
specific toolset is not found and the cxx command is detected. The 'cxx'
toolset will use the '--cxx' and '--cxxflags' options, if present.

Options:
    --help                  Show this help message.
    --verbose               Show messages about what this script is doing.
    --debug                 Build b2 with debug information, and no
                            optimizations.
    --guess-toolset         Print the toolset we can detect for building.
    --cxx=CXX               The compiler exec to use instead of the detected
                            compiler exec.
    --cxxflags=CXXFLAGS     The compiler flags to use in addition to the
                            flags for the detected compiler.


Building B2 engine..

Could not find a suitable toolset.

You can specify the toolset as the argument, i.e.:
    ./build.sh [options] gcc

Toolsets supported by this script are:
    acc, clang, como, gcc, intel-darwin, intel-linux, kcc, kylix, mipspro,
    pathscale, pgi, qcc, sun, sunpro, tru64cxx, vacpp

For any toolset you can override the path to the compiler with the '--cxx'
option. You can also use additional flags for the compiler with the
'--cxxflags' option.

A special toolset; cxx, is available which is used as a fallback when a more
specific toolset is not found and the cxx command is detected. The 'cxx'
toolset will use the '--cxx' and '--cxxflags' options, if present.

Options:
    --help                  Show this help message.
    --verbose               Show messages about what this script is doing.
    --debug                 Build b2 with debug information, and no
                            optimizations.
    --guess-toolset         Print the toolset we can detect for building.
    --cxx=CXX               The compiler exec to use instead of the detected
                            compiler exec.
    --cxxflags=CXXFLAGS     The compiler flags to use in addition to the
                            flags for the detected compiler.



Failed to build B2 build engine
+ EXIT_CODE=1
+ [[ 1 -eq 124 ]]
+ return 1

@petrutlucian94
Copy link
Contributor Author

petrutlucian94 commented Apr 12, 2023

Reverting this PR fixes the connection issue: #47457. I'll need to figure out the exact cause.

LE: some decoding failures on the osd side:

client:
2023-04-12T08:46:56.152Coordinated Universal Time 3  1 -- 13.13.13.10:0/721620687 >> [v2:13.13.13.13:6818/985688,v1:13.13.13.13:6819/985688] conn(0x2872578e9c0 msgr2=0x28725bfcec0 crc :-1 s=STATE_CONNECTION_ESTABLISHED l=1).read_until read failed
2023-04-12T08:46:56.152Coordinated Universal Time 3  1 --2- 13.13.13.10:0/721620687 >> [v2:13.13.13.13:6818/985688,v1:13.13.13.13:6819/985688] conn(0x2872578e9c0 0x28725bfcec0 crc :-1 s=READY pgs=139073 cs=0 l=1 rev1=1 crypto rx=0 tx=0 comp rx=0 tx=0).handle_read_frame_preamble_main read frame preamble failed r=-1

osd:
2023-04-12T08:46:56.182+0000 7fce68a4f640 -1 failed to decode message of type 42 v9: void tracing::decode(jspan_context&, ceph::buffer::v15_2_0::list::const_iterator&) decode past end of struct encoding: Malformed input [buffer:3]
2023-04-12T08:46:56.162+0000 7fce68a4f640  1 --2- [v2:13.13.13.13:6818/985688,v1:13.13.13.13:6819/985688] >> 13.13.13.10:0/721620687 conn(0x556e00704800 0x556dfdb4db80 crc :-1 s=THROTTLE_DONE pgs=284 cs=0 l=1 rev1=1 crypto rx=0 tx=0 comp rx=0 tx=0).handle_message decode message failed

@idryomov
Copy link
Contributor

Reverting this PR fixes the connection issue: #47457.

... and it didn't pass the Windows check, of course. I'll push for making it required once this latest set of issues/regressions is resolved.

@petrutlucian94
Copy link
Contributor Author

Reverting this PR fixes the connection issue: #47457.

... and it didn't pass the Windows check, of course. I'll push for making it required once this latest set of issues/regressions is resolved.

That would be extremely helpful, I'll try to address the issues today.

@petrutlucian94
Copy link
Contributor Author

I've submitted a patch: #51043.

@idryomov
Copy link
Contributor

jenkins test windows

@idryomov
Copy link
Contributor

idryomov commented Apr 17, 2023

The build failure #50916 (comment) still persists.

@petrutlucian94
Copy link
Contributor Author

The build failure #50916 (comment) still persists.

Fixed it, thanks. g++ was getting installed as a pip dependency and now has to be specified explicitly. It's used when building the boost b2 tool.

We're currently installing cython with pip when using Ubuntu
to cross compile Ceph for Windows. This can fail with recent
Python versions if attempting to use the global env:

  error: externally-managed-environment

  × This environment is externally managed
  ╰─> To install Python packages system-wide, try apt install
      python3-xyz, where xyz is the package you are trying to
      install.

Cython isn't really needed by the Windows build so we can go
ahead and drop it. We were hoping to use the Python bindings
on Windows, however Python extensions can't be cross compiled.

We're no longer using pip either, so we're dropping the dependency.
g++ was getting installed as a pip dependency, so we'll have to
include that instead. Note that g++ is used when building the boost
b2 tool.

While at it, we'll also ensure that git is installed.

Fixes: https://tracker.ceph.com/issues/59354

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
@idryomov idryomov merged commit af9762e into ceph:main Apr 18, 2023
3 checks passed
yuvalif pushed a commit to yuvalif/ceph that referenced this pull request Apr 30, 2023
win32_deps_build: avoid pip

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/ops win32 Specifix changes for the windows platform
Projects
None yet
2 participants