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

AIX 7.1: unable to make uninstall result from errno EEXIST not ENOTEMPTY or ENOENT #55437

Closed
cloorc opened this issue Oct 18, 2024 · 0 comments · Fixed by #55438
Closed

AIX 7.1: unable to make uninstall result from errno EEXIST not ENOTEMPTY or ENOENT #55437

cloorc opened this issue Oct 18, 2024 · 0 comments · Fixed by #55438
Labels
aix Issues and PRs related to the AIX platform.

Comments

@cloorc
Copy link
Contributor

cloorc commented Oct 18, 2024

Version

20.18.0

Platform

AIX hostname 1 7 00********00

Subsystem

No response

What steps will reproduce the bug?

  1. Login to AIX and download node-v20.18.0 source code, decompress and enter the folder
  2. Using gcc 11 to build : CC=gcc-11 CXX=g++-11 MAKE=gmake ./configure --prefix=$HOME/local --shared --libdir=$HOME/local
  3. Build node v20.18.0 with : gmake && gmake install
  4. Uninstall the binaries as gmake uninstall

How often does it reproduce? Is there a required condition?

Must appear

What is the expected behavior? Why is that the expected behavior?

Can be uninstalled as expected

What do you see instead?

From tools/install.py, contains following source code:

 26 def try_symlink(options, source_path, link_path):
 27   if not options.silent:
 28     print('symlinking %s -> %s' % (source_path, link_path))
 29   try_unlink(link_path)
 30   try_mkdir_r(os.path.dirname(link_path))
 31   os.symlink(source_path, link_path)
 32
 33 def try_mkdir_r(path):
 34   try:
 35     os.makedirs(path)
 36   except OSError as e:
 37     if e.errno != errno.EEXIST: raise
 38
 39 def try_rmdir_r(options, path):
 40   path = abspath(path)
 41   while is_child_dir(path, options.install_path):
 42     try:
 43       os.rmdir(path)
 44     except OSError as e:
 45       if e.errno == errno.ENOTEMPTY: return
 46       if e.errno == errno.ENOENT: return
 47       raise
 48     path = abspath(path, '..')
 49

As coded in line 45-46, only ENOTEMPTY and ENOENT error will be treated as normal. However, in AIX 7.1, if the target file or folder doesn't exist, the error is EEXIST.

From /usr/include/errno.h in AIX 7.1, we got following comment:

193 /*
194  * AIX returns EEXIST where 4.3BSD used ENOTEMPTY;
195  * but, the standards insist on unique errno values for each errno.
196  * A unique value is reserved for users that want to code case
197  * statements for systems that return either EEXIST or ENOTEMPTY.
198  */

As described in include/uapi/asm-generic/errno-base.h, EEXIST is 17, which is referred by python/cpython.

Additional information

No response

@richardlau richardlau added the aix Issues and PRs related to the AIX platform. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aix Issues and PRs related to the AIX platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants