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

Archimage 4.3 #34

Merged
merged 10 commits into from
Jan 18, 2025
Merged

Archimage 4.3 #34

merged 10 commits into from
Jan 18, 2025

Conversation

ivan-hc
Copy link
Owner

@ivan-hc ivan-hc commented Jan 17, 2025

  • select only needed dependencies and libraries
  • restarting process does not bloats the AppDir
  • JuNest will be keept as is in a dedicated directory, while the AppDir will be another directory
  • workflow lasts less
  • less resource intensive
  • reduced functions to check libraries
  • AppImages will be cleaner, without empty directories under /usr (eccept mountpoints)
  • message to advertice the user that the script is saved in the current directory, in case there is no XDG Desktop directory
  • add new options --devmode-enable and --devmode-disable to use the "dev" branch
  • add message about "Developer Mode" if enabled
  • if "AM" is installed, use bash-completion / zsh-completion

- removed references to old lib* functions of the script
- if no XDG Desktop directory, show a message, fix #33
- Add developer mode
- If "AM" exists, use bash-completion / zsh-completion
@ivan-hc
Copy link
Owner Author

ivan-hc commented Jan 18, 2025

This release has a regression: levels 2, 3 or 4 of extraction just made the apps bloated, but the core libraries to launch the app (that were enough with a level 2 in the version 4.2) have not been included. In that case, the app can also run with a default level 1, but you have to add manually in LIBSAVED the needed keywords for dependencies.

I have merged a lot of functions for libraries into one

_savelibs() {
	echo "◆ Detect libraries related to /usr/bin files"
	readelf -d ./"$APP".AppDir/.junest/usr/bin/* 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so" | uniq >> ./list

	echo "◆ Detect libraries of the main package"
	base_libs=$(find ./base -type f | uniq)
	for b in $base_libs; do
		readelf -d "$b" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so" | uniq >> ./list &
	done
	wait

	echo "◆ Detect libraries of the dependencies"
	dep_libs=$(find ./deps -executable -type f | uniq)
	for d in $dep_libs; do
		readelf -d "$d" 2>/dev/null | grep NEEDED | tr '[] ' '\n' | grep ".so" | uniq >> ./list &
	done
	wait

	echo "◆ Saving libraries"
	cp -r ./archlinux/.junest/usr/lib/ld-linux-x86-64.so* ./"$APP".AppDir/.junest/usr/lib/
	lib_preset="$APP $BIN libdw libelf $(sort -u ./list)"
	LIBSAVED="$lib_preset $LIBSAVED $SHARESAVED"
	for arg in $LIBSAVED; do
		LIBPATHS="$LIBPATHS $(find ./archlinux/.junest/usr/lib -maxdepth 20 -wholename "*$arg*" | sed 's/\.\/archlinux\///g')"
	done
	for arg in $LIBPATHS; do
		cp -r ./archlinux/"$arg" "$APP".AppDir/"$arg" 2>/dev/null &
	done
	wait
	rm list
}

libraries are added directly to the AppDir.

I'll be honest, I don't want to spit the libraries part to several functions again... but also I don't want this regression.

To do an example, for Archimage 4.2 and without including all dependencies, this was LIBSAVED in Abiword

LIBSAVED="gconv db Graphics libical libxslt libXt $lib_audio_keywords $lib_browser_launcher"

and this is it now

LIBSAVED="gconv db Graphics libical libxslt libXt libsqlite libijs- libjbig libidn libpaper.so libopenjp libnghttp libssh \
libpsl.so libssl.so libcrypto.so libgssapi_krb5 libbrotlicommon.so libSM.so libICE.so libunistring.so libkrb libk5crypto libcom_err.so \
libkeyutils.so libtasn libhogweed.so libnettle.so $lib_audio_keywords $lib_browser_launcher"

...and yes, the AppImage is 2 MB smaller... but I worked a lot of time to reach this result, by analyzing the breaks at each launch, library by library, using LD_DEBUG

I need to fix this regression asap.

- the ultimate function to detect all libraries needed
@ivan-hc
Copy link
Owner Author

ivan-hc commented Jan 18, 2025

I have solved!

Now the whole process is faster and less resource-intensive!

I'm experimenting this on some of my repos, and workflows last 1 minute less if compared with Archimage 4.2!

@ivan-hc ivan-hc merged commit 81ae4c5 into main Jan 18, 2025
@ivan-hc ivan-hc deleted the dev branch January 18, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant