New issue
Advanced search Search tips

Issue 916403 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature

Blocked on:
issue 874977
issue 917949



Sign in to add a comment

Upgrade OpenSC to upstream

Project Member Reported by menghuan@chromium.org, Dec 19

Issue description

Current opensc (https://chromium.googlesource.com/chromiumos/overlays/portage-stable/) in our codebase is opensc-0.12.2-r1 which is upgraded at 2012. The upstream is now at 0.19.0-r2 (https://packages.gentoo.org/packages/dev-libs/opensc).

I'm not sure whether it is used in production. It isn't deployed on soraka and eve that I've worked on.

Given there is some known bug for testing purpose like --test-ec. I think it is good to upgrade to upstream.
 
Description: Show this description
Cc: apronin@chromium.org
+apronin

Andrey, I am planning to do this when I have free time.

Do you know who's using opensc package? and how to build/test them? and anything I need to take care?

For now, I only know using `emerge-$BOARD opensc` to build the package. It seems in in the previous update, they use the old building command to test.
https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/8a4fc70b88c3a674c19584d728437fa1f1e1a607
and 
https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/a6a49b47e768b8f8cd5c61699a7b6cdc19d51ce0
> Do you know who's using opensc package? and how to build/test them? and anything I need to take care?

Hm, given that I have to build & deploy it manually, opensc is not included even in test images, so I doubt anybody uses it.

For my purposes I just build it and deploy to a DUT using
USE=-pcsc-lite emerge-$BOARD opensc
cros deploy $dut opensc
In y experience, at least for some boards, it doesn't build w/o USE=-pcsc-lite. Never tried to include it in an image, have experience building it only for a handful of models. So, other build issues are possible. Similarly, no experience with testing the opensc package.

If some of our autotests start using opensc utilities like pkcs11-tool, we need to add an appropriate dependency to the appropriate ebuild.

Status: Assigned (was: Available)
It seems that for opensc>=0.13, it should at least enable one of pcsc-lite, openct or ctapi. Currently, I plan to install sys-apps/pcsc-lite but it is only available after upgrade to EAPI=7 (now is 6).

I saw someone is working on  bug 874977 . It upgrades portage to newer version which supports EAPI=7.
yes, Allen is working on upreving portage, which turned out to be not exactly trivial. shall we set dependency on that bug?
Blockedon: 874977
You can try manually setting the EAPI to 6 and see if the ebuild emerges.
NVM, the portage uprev finally made it through the CQ. I am going to leave that other bug open until I am confident those CLs won't be reverted.
Thanks allenwebb@.
I tried, the EAPI 7 works.

----

It seems pcsc-lite requires add some user and group. Prefer to install with USE='-pcsc-lite ctapi' instead.

Tried but got weird compile error, it seems it is broken at the build-in header <string.h>, need more investigation.

Making all in ui
make[3]: Entering directory '/build/soraka/tmp/portage/dev-libs/opensc-0.19.0-r2/work/opensc-0.19.0/src/ui'
/bin/sh ../../libtool  --tag=CC   --mode=compile x86_64-cros-linux-gnu-clang -DHAVE_CONFIG_H -I. -I../..  -I../../src    -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -Wno-u
nused-parameter -Werror -c -o strings.lo strings.c
/bin/sh ../../libtool  --tag=CC   --mode=compile x86_64-cros-linux-gnu-clang -DHAVE_CONFIG_H -I. -I../..  -I../../src    -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -Wno-u
nused-parameter -Werror -c -o notify.lo notify.c
libtool: compile:  x86_64-cros-linux-gnu-clang -DHAVE_CONFIG_H -I. -I../.. -I../../src -O2 -pipe -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -Wno-unused-parameter -Werror -c strings.
c  -fPIC -DPIC -o .libs/strings.o
libtool: compile:  x86_64-cros-linux-gnu-clang -DHAVE_CONFIG_H -I. -I../.. -I../../src -O2 -pipe -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -Wno-unused-parameter -Werror -c notify.c
  -fPIC -DPIC -o .libs/notify.o
/bin/sh ../../libtool  --tag=CC   --mode=link x86_64-cros-linux-gnu-clang   -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wextra -Wno-unused-parameter -Werror  -Wl,-O2 -Wl,--as-nee
ded  -o libnotify.la  notify.lo  -ldl
In file included from strings.c:25:
In file included from ../../../../../../../../usr/include/string.h:494:
../../../../../../../../usr/include/bits/string_fortified.h:116:6: error: use of undeclared identifier '__bos'
     __warn_if_src_too_large (__dest, __src)
     ^
../../../../../../../../usr/include/bits/string_fortified.h:40:41: note: expanded from macro '__warn_if_src_too_large'
  __clang_warning_if (__size_too_small (__bos, dest, __builtin_strlen (src) + 1), \
                                        ^
../../../../../../../../usr/include/bits/string_fortified.h:136:6: error: use of undeclared identifier '__bos'
     __warn_if_dest_too_small (__dest, __len)
     ^
../../../../../../../../usr/include/bits/string_fortified.h:31:41: note: expanded from macro '__warn_if_dest_too_small'
  __clang_warning_if (__size_too_small (__bos, dest, len), \
                                        ^
../../../../../../../../usr/include/bits/string_fortified.h:150:6: error: use of undeclared identifier '__bos'
     __warn_if_dest_too_small (__dest, __n)
     ^
../../../../../../../../usr/include/bits/string_fortified.h:31:41: note: expanded from macro '__warn_if_dest_too_small'
  __clang_warning_if (__size_too_small (__bos, dest, len), \
                                        ^
../../../../../../../../usr/include/bits/string_fortified.h:160:6: error: use of undeclared identifier '__bos'
     __warn_if_src_too_large (__dest, __src)
     ^
../../../../../../../../usr/include/bits/string_fortified.h:40:41: note: expanded from macro '__warn_if_src_too_large'
  __clang_warning_if (__size_too_small (__bos, dest, __builtin_strlen (src) + 1), \
                                        ^
../../../../../../../../usr/include/bits/string_fortified.h:168:6: error: use of undeclared identifier '__bos'
     __warn_if_src_too_large (__dest, __src)
     ^
../../../../../../../../usr/include/bits/string_fortified.h:40:41: note: expanded from macro '__warn_if_src_too_large'
  __clang_warning_if (__size_too_small (__bos, dest, __builtin_strlen (src) + 1), \
                                        ^
5 errors generated.
make[3]: *** [Makefile:486: strings.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
libtool: link: x86_64-cros-linux-gnu-ar cru .libs/libnotify.a .libs/notify.o
libtool: link: x86_64-cros-linux-gnu-ranlib .libs/libnotify.a
libtool: link: ( cd ".libs" && rm -f "libnotify.la" && ln -s "../libnotify.la" "libnotify.la" )
make[3]: Leaving directory '/build/soraka/tmp/portage/dev-libs/opensc-0.19.0-r2/work/opensc-0.19.0/src/ui'

file a new bug please for the toolchain team to look at.  it's a bug in the glibc clang fortify patch we carrry.
Move the comment in my workaround CL (http://crrev.com/c/1390025) back to this bug.

The root cause it that including string.h will result in including strings.h in /usr/include/string.h:431 (board: soraka). I don't know what __USE_MISC is for, but it seems it is defined (I manually add something in that block will be processed).

  #ifdef __USE_MISC
  # include <strings.h>


Blockedon: 917949
Project Member

Comment 13 by bugdroid1@chromium.org, Jan 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/a8427de22e8a7a2cbe611e3ebd6063c10a10b9bc

commit a8427de22e8a7a2cbe611e3ebd6063c10a10b9bc
Author: Meng-Huan Yu <menghuan@chromium.org>
Date: Wed Jan 09 14:26:06 2019

bash-completion-r1.eclass: Upgrade to upstream

Upgrade this eclass for supporting EAPI 7.

Used in dev-libs/opensc package.

BUG= chromium:916403 
TEST=build package with EAPI7 which inherit this eclass

Change-Id: I7bede97892b1be23e03e0da2d428261444dcd690
Reviewed-on: https://chromium-review.googlesource.com/1397100
Commit-Ready: Meng-Huan Yu <menghuan@chromium.org>
Tested-by: Meng-Huan Yu <menghuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/a8427de22e8a7a2cbe611e3ebd6063c10a10b9bc/eclass/bash-completion-r1.eclass

Project Member

Comment 14 by bugdroid1@chromium.org, Jan 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/portage-stable/+/71580df1c60b7a44ad1a57c098731a88309a19f8

commit 71580df1c60b7a44ad1a57c098731a88309a19f8
Author: Meng-Huan Yu <menghuan@chromium.org>
Date: Wed Jan 09 23:46:58 2019

opensc: upgraded package to upstream unstable (0.19.0-r2)

Upgraded dev-libs/opensc to version 0.19.0-r2 on amd64, arm

Use the following command to upgrade:
  USE='-pcsc-lite ctapi' cros_portage_upgrade --upgrade \
    --unstable-ok
    --board=arm-generic:amd64-generic opensc

BUG= chromium:916403 
TEST=build package
  USE='-pcsc-lite ctapi' emerge-soraka opensc

Change-Id: I6e24a0164becebc75173f5735c6a605df22bfe36
Reviewed-on: https://chromium-review.googlesource.com/1390024
Commit-Ready: Meng-Huan Yu <menghuan@chromium.org>
Tested-by: Meng-Huan Yu <menghuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[add] https://crrev.com/71580df1c60b7a44ad1a57c098731a88309a19f8/dev-libs/opensc/opensc-0.19.0-r2.ebuild
[delete] https://crrev.com/fbd076d3096d063dd0bad7ff86d77684a8608ffb/dev-libs/opensc/files/opensc-0.12.2-dl.patch
[delete] https://crrev.com/fbd076d3096d063dd0bad7ff86d77684a8608ffb/dev-libs/opensc/opensc-0.12.2-r1.ebuild
[delete] https://crrev.com/fbd076d3096d063dd0bad7ff86d77684a8608ffb/metadata/md5-cache/dev-libs/opensc-0.12.2-r1
[add] https://crrev.com/71580df1c60b7a44ad1a57c098731a88309a19f8/metadata/md5-cache/dev-libs/opensc-0.19.0-r2
[delete] https://crrev.com/fbd076d3096d063dd0bad7ff86d77684a8608ffb/dev-libs/opensc/files/opensc-0.12.2-parallelinstall.patch
[delete] https://crrev.com/fbd076d3096d063dd0bad7ff86d77684a8608ffb/dev-libs/opensc/files/opensc-0.12.1-crossbuild.patch
[modify] https://crrev.com/71580df1c60b7a44ad1a57c098731a88309a19f8/dev-libs/opensc/Manifest
[add] https://crrev.com/71580df1c60b7a44ad1a57c098731a88309a19f8/dev-libs/opensc/files/opensc-0.19.0-p11test_common.h.patch
[modify] https://crrev.com/71580df1c60b7a44ad1a57c098731a88309a19f8/dev-libs/opensc/metadata.xml

Project Member

Comment 15 by bugdroid1@chromium.org, Jan 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/de2cefbe07e08dc4ad6048729a2f2701d30e5bac

commit de2cefbe07e08dc4ad6048729a2f2701d30e5bac
Author: Meng-Huan Yu <menghuan@chromium.org>
Date: Wed Jan 09 23:46:58 2019

opensc: Use '-pcsc-lite +ctapi' as default

For 0.18.0+ version of opensc, it is better to build with this
setting without additional dependency.

Opensc package only used for manually testing during the
developing.

BUG= chromium:916403 
TEST=build opensc package
  emerge-soraka opensc
CQ-DEPEND=CL:1390024

Change-Id: I9b2379ed37b1eb84136a2e5422ab478585de5caf
Reviewed-on: https://chromium-review.googlesource.com/1400336
Commit-Ready: Meng-Huan Yu <menghuan@chromium.org>
Tested-by: Meng-Huan Yu <menghuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/de2cefbe07e08dc4ad6048729a2f2701d30e5bac/profiles/targets/chromeos/package.use

Status: Fixed (was: Assigned)

Sign in to add a comment