25077667 / standalone-python

A portable standalone python for all Linux platform
Other
28 stars 9 forks source link

find: invalid predicate `-executable #4

Closed MrSlimbrowser closed 1 month ago

MrSlimbrowser commented 3 months ago

Running release-3.12-x86_64.tar.gz on some older systems (or systems running old find versions) I get the error "find: invalid predicate `-executable". Is there anything you or I can do about it?

OS: SLES 9 and 10 Find: GNU find Version 4.2.27, 4.2.23 and 4.2.19

Let me know if you need any more information :)

25077667 commented 3 months ago

@MrSlimbrowser Hi, thanks for your report. Could you give me more information about how would you trigger the error?

thank you!

MrSlimbrowser commented 3 months ago

All I do is extracting and starting it

# tar xzf 3.12.3.tar.gz
# cd opt/python/bin
# ./python3 --version

I get the same error when executing anything like find -executable, so it probably comes from the find call in your finc_real_python function in the python3 wrapper script

find_real_python() {
    find "$INSTALL_PREFIX/bin" -type f -executable -name 'python*-real' | head -n 1
}
25077667 commented 3 months ago

@MrSlimbrowser It seems we can use -perm -400 -or -perm -040 -or -perm -040 instead.

MrSlimbrowser commented 3 months ago

Doesn't work, but I tried some versions and -perm -444 seems to work best.

Only the host running v4.2.23 of find has issues with that change, but I think it might be a different reason: Running find "/opt/its/programs/portable/python/current/python/bin" -type f -perm -444 -name 'python*-real' | head -n 1 on each of my hosts gives the same result /opt/its/programs/portable/python/current/python/bin/python3.12-real, but that one host later on seems to craft a wrong path somehow

$ cd /opt/its/programs/portable/python/current/python/bin
$ ./python --version
$ ./python: line 47: /opt/its/programs/portable/python/current/python/bin/..//bin/python3.12-real: cannot execute binary file
MrSlimbrowser commented 3 months ago

Only the host running v4.2.23 of find has issues with that change

Nevermind, that one is on me. I didn't notice that host is one of the few x86 systems we still have... The same change using the x86 version of your latest python package works like a charm.

25077667 commented 3 months ago

@pisces860225 Could you help me to apply this change? Thank you!

25077667 commented 2 months ago

@pisces860225 What's the current status?

pisces860225 commented 1 month ago

@25077667 Forgot about this haha I'll find time to correct this in the next two days. After the correction is completed, we will send a PR again and inform you.