Re: [gentoo-dev] Re: [PATCH v6 2/2] profiles/desc: add amdgpu_targets.desc for USE_EXPAND

2022-08-31 Thread wuyy
On Wed, Aug 31, 2022 at 10:59:41PM -, Duncan wrote:
> Yiyang Wu posted on Thu,  1 Sep 2022 00:40:34 +0800 as excerpted:
> 
> > +# Referene:
> 
> Non-ASCII unicode mangled "Reference:"??
> 
> Looks like "Referene here.  kcharselect says U+ff1a is unicode 
> category "punctuation, other", block "half-width and full-width forms", 
> approximate equivalent U+003a, colon (presumably what you intended).
> 
> Looks like the "c" is missing as well, but that could be my client's 
> display indigestion on the unicode.

Sorry for the mess. It should be ":" but my input method gives a
full-width unicode character. I'll fix that. The Github PR is now
updated.

-- 
Yiyang Wu



Re: [gentoo-dev] [PATCH v5 2/2] profiles/desc: add amdgpu_targets.desc for USE_EXPAND

2022-08-29 Thread wuyy
On Sun, Aug 28, 2022 at 07:34:57AM -0500, Gordon Pettey wrote:
> IMHO... much preferable to align these with names, i.e. vega10, vega20,
> rather than some ID number. USE should be self-explanatory wherever
> possible.
> 
> On Sun, Aug 28, 2022 at 6:01 AM Yiyang Wu 
> wrote:
> 

Thanks for the suggestion. However, the gfx*** can be directly used in
compilation flags and src_configure (just like LLVM_TARGETS); changing
the USE flag name means extra lines of translation codes in the eclass. 

Also, I turned on the "professional" cards officially supported by AMD,
so the support is out of box for "enterprise" users.  For normal ROCm
users in Gentoo, I believe they will have a look of the use flag
description.

-- 
Yiyang Wu



Re: [gentoo-dev] [PATCH v2 1/2] rocm.eclass: new eclass

2022-08-16 Thread wuyy
Thank you very much for pointing out so much problems I missed!

On Tue, Aug 16, 2022 at 12:41:47AM +0200, Ulrich Mueller wrote:
> Please wrap lines at below 80 character positions. (This applies both to
> documentation and to code.)
> 

Thanks. Seems that I forgot yo run re-wrapping in a final round. I don't
see any `pkgcheck scan` complains about this, maybe such check can be
added?

Also, I have some long sentences in code, for throwing information. How
do I nicely wrap such long strings in bash? By incremental assigning it
to variables I guess?

> @EXAMPLE is read as a paragraph, i.e. lines will be wrapped and this is
> how it will look when rendered as eclass manpage:
> 
>#  Example for ROCm packages in https://github.com/ROCmSoftwarePlatform
>inherit   cmake   rocmSRC_URI="https://github.com/ROCmSoftwarePlat‐
>form/${PN}/archive/rocm-${PV}.tar.gz  -> ${P}.tar.gz" SLOT="0/$(ver_cut
>1-2)" IUSE="test" REQUIRED_USE="${ROCM_REQUIRED_USE}"  RESTRICT="!test?
>( test )"
> 
>[...]
> 
> So, you may want to include the whole example in a pair of @CODE tokens.
> 

Thanks for pointing out. This is my first eclass and I didn't know how
documents are rendered before.

> > +
> > +if [[ ! ${_ROCM_ECLASS} ]]; then
> > +
> > +case "${EAPI:-0}" in
> 
> This should be just ${EAPI} without a fallback to 0. Also, the
> quotation marks are not necessary.
> 
> > +   7|8)
> > +   ;;
> > +   *)
> > +   die "Unsupported EAPI=${EAPI} for ${ECLASS}"
> 
> Whereas here it should be ${EAPI:-0}.
> 
> > +   ;;
> > +esac
> 
> Or even better, follow standard usage as it can be found in
> multilib-minimal or toolchain-funcs:
> 
> case ${EAPI} in
>   7|8) ;;
>   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
> esac
> 

I'll take the suggestion. Thanks!

> > +
> > +inherit edo
> > +
> > +
> 
> No double empty lines please. (Pkgcheck should have complained about
> this.)

OK. But `pkgcheck scan rocm.eclass` (version 0.10.12) does not
complains. A missing feature maybe?

> > +# @DESCRIPTION:
> > +# The list of USE flags corresponding to all officlially supported AMDGPU
> 
> "officially"
> 
> > +   ROCM_REQUIRED_USE+=" || ("
> > +   for gpu_target in ${ALL_AMDGPU_TARGETS[@]}; do
> 
> Add a pair of double quotes here.

OK, I'll polish here in v2.

> > +   if [[ " ${OFFICIAL_AMDGPU_TARGETS[*]} " =~ " ${gpu_target} " 
> > ]]; then
> So OFFICIAL_AMDGPU_TARGETS is an array, but then it's flattened to a
> string for the test? Either use "has" for the test, or don't use an
> array in the first place.

Yes, I should have used a better approach.

> > +get_amdgpu_flags() {
> > +   local AMDGPU_TARGET_FLAGS
> > +   for gpu_target in ${ALL_AMDGPU_TARGETS[@]}; do
> 
> Double quotes please.
> 

Thanks for finding such problem once again.

> > +# @FUNCTION: check_rw_permission
> > +# @USAGE: check_rw_permission 
> > +# @DESCRIPTION:
> > +# check read and write permissions on specific files.
> > +# allow using wildcard, for example check_rw_permission /dev/dri/render*
> > +check_rw_permission() {
> > +   [[ -r "$1" ]] && [[ -w "$1" ]] || die \
> 
> Quotation marks aren't necessary here.

Yes, and after I perform another check, this function is implemented
incorrectly -- it is designed to accept wildcards (later in
rocm_src_test, there is check_rw_permission /dev/dri/render*) but when
bash pass the expanded argument to list, $1 is only the first matching
file. So I should think of a correct implementation, or stop using
wildcards. This is a bug (rare to encounter however), and I need to fix
it in v2.

> 
> > +   "${PORTAGE_USERNAME} do not have read or write permissions on 
> > $1! \n Make sure ${PORTAGE_USERNAME} is in render group and check the 
> > permissions."
> 
> Please don't use internal Portage variables.
OK, although I can't find such warnings on
https://devmanual.gentoo.org/eclass-writing. Maybe an entry should be
added?

> > +   elif [[ -d "${BUILD_DIR}"/clients/staging ]]; then
> 
> Quotation marks aren't necessary here.

What if BUILD_DIR contains spaces?

> > +   cd "${BUILD_DIR}/clients/staging" || die "Test directory not 
> > found!"
> > +   for test_program in "${PN,,}-"*test; do
> > +   if [[ -x ${test_program} ]]; then
> > +   edob ./${test_program}
> > +   else
> > +   die "The test program ${test_program} does not 
> > exist or cannot be excuted!"
> > +   fi
> > +   done
> > +   elif [[ ! -z "${ROCM_TESTS}" ]]; then
> 
> Again, no quotation marks.
> 
> Also, why the double negation? IMHO "-n" would be better readable.

Yeah, I don't understand myself either.

> 
> > +   for test_program in "${ROCM_TESTS}"; do
> 
> What is this supposed to do? The loop will be executed exactly once,
> whatever ROCM_TESTS contains.

Well, I hope ROCM_TESTS can have multiple executables, so that's why
it have the trail

[gentoo-dev] Re: [PATCH 0/2] rocm.eclass for ROCm packages written in HIP

2022-08-08 Thread wuyy
On Mon, Aug 08, 2022 at 10:15:25PM +0800, Yiyang Wu wrote:
> This eclass provides utilities for ROCm libraries in
> https://github.com/ROCmSoftwarePlatform, e.g. rocBLAS, rocFFT.
> It contains a USE_EXPAND, amdgpu_targets_*, which handles the GPU
> architecture to compile, and keep targets coherent among dependencies.
> Packages that depend on ROCm libraries, like cupy, can also make use of
> this eclass, mainly specify GPU architecture and it's corresponding
> dependencies via USE_EXPAND.
> 
> This is the core delivery in GSoC 2022 project "Refining ROCm Packages
> in Gentoo"
> 
> Yiyang Wu (2):
>   rocm.eclass: new eclass
>   profiles/desc: add amdgpu_targets.desc for USE_EXPAND
> 
>  eclass/rocm.eclass| 278 ++
>  profiles/base/make.defaults   |   2 +-
>  profiles/desc/amdgpu_targets.desc |  15 ++
>  3 files changed, 294 insertions(+), 1 deletion(-)
>  create mode 100644 eclass/rocm.eclass
>  create mode 100644 profiles/desc/amdgpu_targets.desc
> 
> -- 
> 2.34.1
> 
I have created a PR of this patch at 
https://github.com/gentoo/gentoo/pull/26784.
-- 
Yiyang Wu



Re: [gentoo-dev] last rites: dev-python/thrift

2022-04-01 Thread wuyy
On Fri, Apr 01, 2022 at 01:53:24PM +0200, Fabian Groffen wrote:
> # Fabian Groffen  (2022-04-01)
> # unused package, not enabling tests, bug #796830
> # Removal in 30 days
> dev-python/thrift
> 
> -- 
> Fabian Groffen
> Gentoo on a different level

Please also consider retain this package as a reverse dependency for 
https://github.com/ktrueda/parquet-tools. It is a commandline util to read 
parquet data, so I prepare to package in the future along with spark, 
apache-arrow and other big data infrastructure components in Spark-overlay 
where parquet data format is popular.

-- 


signature.asc
Description: PGP signature