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

libtorrent 1.2 + boost 1.70 or libtorrent 2.0 + boost 1.78 #5202

Merged
merged 18 commits into from
May 20, 2022

Conversation

th0ma7
Copy link
Contributor

@th0ma7 th0ma7 commented Apr 7, 2022

Description

Demonstrate feasibility to build build libtorrent using crossenv, part 2. The following uses only supported version:

  • libtorrent 2.0.5 (using boost 1.78) - DSM7 except comcerto2k-7.0
  • libtorrent 1.2.16 (using boost 1.70) - DSM6 + DSM7
  • rencode 1.0.7 (from a fork of the project as no-longer maintained)
  • deluge 2.0.5

Follows-up #5180
Parallel work to #4153

libtorrent bug with DSM6/comcerto2k-7.0 using gcc-4.9.x compiler: arvidn/libtorrent#6868

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Bug fix
  • New Package
  • Package update
  • Includes small framework changes
  • This change requires a documentation update (e.g. Wiki)

Comment on lines 123 to 124
# GCC version
version_gcc = $(shell $$(sed -n -e '/TC_ENV += TC_GCC/ s/.*= *//p' $(PWD)/$(subst arch,work,$(MAKECMDGOALS))/tc_vars.mk))
Copy link
Contributor Author

@th0ma7 th0ma7 May 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hgy59 I'd like to bring your attention to this function helper so we can finally make usage of the GCC version from any spk. See use-case in python310 Makefile which allows to capture comcerto2k-7.0 exception cleanly.

Comments welcomed :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My findings so far:

  • you don't have TC_ENV nor TC_GCC available before the target $(TC_VARS_MK) is built.
  • you can modify makefile variables in a custom PRE_DEPEND_TARGET that depends on $(TC_VARS_MK) with $(eval )
.PHONY: python310_pre_depend
python310_pre_depend: $(TC_VARS_MK)
	@$(MSG) "Evaluate dependencies for GCC version $(TC_GCC)"
	$(eval WHEELS_BUILD_ARGS += $(shell if "$(TC_GCC)" != "5.0" && printf '%s\n' "$(TC_GCC)" "5.0" | sort -VC ; then echo --b2-args=cxxstd=11 ; fi))
	@$(MSG) "WHEELS_BUILD_ARGS=$(WHEELS_BUILD_ARGS)"
  • ensure the $(TC_VARS_MK) is built before
  • version comparision migth be improved (but version_lt is not ment for shell environment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your findings where pretty much the route I was originally leaning towards but the relatively simplistic method I've moved to uses the TC_GCC version variable from the tc_vars.mk and works quite well.

It actually solves a long-standing issue I had with:

ifeq ($(call version_ge, ${TCVERSION}, 7.0),1)
# fix compilation with newer compilers
ADDITIONAL_CXXFLAGS += -D_GLIBCXX_USE_C99_MATH -D_GLIBCXX_HAVE_OBSOLETE_ISNAN -D_GLIBCXX_HAVE_OBSOLETE_ISINF
endif

That can then be converted into (and takes into consideration comcerto2k-7.0):

ifeq ($(call version_ge, $(call version_gcc), 7.5),1)
# fix compilation with newer compilers
ADDITIONAL_CXXFLAGS += -D_GLIBCXX_USE_C99_MATH -D_GLIBCXX_HAVE_OBSOLETE_ISNAN -D_GLIBCXX_HAVE_OBSOLETE_ISINF
endif

@th0ma7
Copy link
Contributor Author

th0ma7 commented May 20, 2022

@hgy59 I think I'm up to a working solution using libtorrent 1.2.16 + boost 1.70 which I got to build properly using crossenv on both DSM6+7 with exception of ARMv5 and ARMv7L due to GCC being too old (GCC < 4.9, even using c++1x).

I may even be inches away from a success with libtorrent 2.0.6 + boost 1.78 but I'm lacking a fix for using c++1y with GCC < 4.9 (bug opened upstream arvidn/libtorrent#6868).

Next would be to move the code out from python310 and back to deluge and initiate actual testing.

@th0ma7 th0ma7 changed the title libtorrent: Working version using boost 1.76 and libtorrent 2.0.5 libtorrent 1.2 + boost 1.70 or libtorrent 2.0 + boost 1.78 May 20, 2022
@hgy59
Copy link
Contributor

hgy59 commented May 20, 2022

@th0ma7 we probably sould first merge this for libtorrent 1.2 to create packages for DSM 6 and DSM 7?

@th0ma7
Copy link
Contributor Author

th0ma7 commented May 20, 2022

we probably sould first merge this for libtorrent 1.2 to create packages for DSM 6 and DSM 7?

@hgy59 it's exacltly where I was heading this morning. I was planning to clean-up slightly the code and re-comment python310 test/demo of libtorrent 1.2/2.0 wheels and then switch to @Strangelovian branch to include the various bits needed.

@th0ma7 th0ma7 requested a review from hgy59 May 20, 2022 12:13
@th0ma7
Copy link
Contributor Author

th0ma7 commented May 20, 2022

@hgy59 if you're OK with the proposed changes I'd move ahead and merge. I already have changes pending for @Strangelovian PR to re-adjust accordingly.

Copy link
Contributor

@hgy59 hgy59 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if version _gcc really works, we should introduce REQUIRED_MIN_GCC some time.
So far it looks good to me for merging.

@th0ma7
Copy link
Contributor Author

th0ma7 commented May 20, 2022

if version _gcc really works, we should introduce REQUIRED_MIN_GCC some time.

That's an awesome idea :)

@th0ma7 th0ma7 merged commit d430e2d into SynoCommunity:master May 20, 2022
@th0ma7 th0ma7 deleted the libtorrent-2.0.x branch May 20, 2022 20:18
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.

None yet

2 participants