Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

make oss is broken with python 3.12+ #1032

Open
stepancheg opened this issue Feb 25, 2025 · 2 comments
Open

make oss is broken with python 3.12+ #1032

stepancheg opened this issue Feb 25, 2025 · 2 comments

Comments

@stepancheg
Copy link
Contributor

$ make oss
SAPLING_OSS_BUILD=true HGNAME=sl \
	  /Users/xxx/homebrew/bin/python3.12 setup.py  \
	  build_interactive_smartlog \
	  build_clib  \
	  build_rust_ext -i -l  \
	  build_mo
Traceback (most recent call last):
  File "/Users/xxx/yyy/sapling/eden/scm/setup.py", line 83, in <module>
    from distutils import file_util
ModuleNotFoundError: No module named 'distutils'

distutils was removed in Python 3.12.

@quark-zju
Copy link
Contributor

Could this be resolved by installing setuptools?

@stepancheg
Copy link
Contributor Author

stepancheg commented Feb 25, 2025

This seems to be against best practices, but technically yes.

Compiling sl is quite hard already, for example, provided deb packages are not installable on Ubuntu 22.04

$ sudo apt install -y ./sapling_0.2.20241203-120811+a2174689_amd64.Ubuntu22.04.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'sapling' instead of './sapling_0.2.20241203-120811+a2174689_amd64.Ubuntu22.04.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 sapling : Depends: libpython3.10 (>= 3.10.0) but it is not installable
           Recommends: nodejs but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

and I could not compile it from source on Ubuntu 22.04:

$ make oss
SAPLING_OSS_BUILD=true HGNAME=sl \
  /bin/python3.12 setup.py  \
  build_interactive_smartlog \
  build_clib  \
  build_rust_ext -i -l  \
  build_mo
  $ yarn --cwd . install --prefer-offline
Usage: yarn [options]

yarn: error: no such option: --cwd
Traceback (most recent call last):
  File "/home/st/devel/left/sapling/addons/build-tar.py", line 200, in <module>
    main()
  File "/home/st/devel/left/sapling/addons/build-tar.py", line 172, in main
    run(yarn + ["--cwd", src_join(), "install", "--prefer-offline"])
  File "/home/st/devel/left/sapling/addons/build-tar.py", line 66, in run
    subprocess.run(command, shell=(os.name == "nt"), check=True, cwd=cwd, env=env)
  File "/usr/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['yarn', '--cwd', '.', 'install', '--prefer-offline']' returned non-zero exit status 2.
Traceback (most recent call last):
  File "/home/st/devel/left/sapling/eden/scm/setup.py", line 1189, in <module>
    setup(
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1233, in run_command
    super().run_command(command)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/st/devel/left/sapling/eden/scm/setup.py", line 738, in run
    subprocess.run(
  File "/usr/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/bin/python3.12', 'build-tar.py', '-o', '/home/st/devel/left/sapling/eden/scm/isl-dist.tar.xz']' returned non-zero exit status 1.
make: *** [Makefile:109: local] Error 1

Adding another undocumented external dependency would make it one bit harder.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants