Re: [scl.org] ubi8/nodejs-16-minimal HOME env and PATH

2021-12-21 Thread Petr Kubat

Hi Jose,

thanks for the report! You are correct, the definitions should be in 
different ENV commands. I created a PR against sclorg repository:


https://github.com/sclorg/s2i-nodejs-container/pull/309

Petr

On 12/10/21 11:37 PM, Jose Gonzalez wrote:

Hi there!

I attempted to use the ubi8/nodejs-16-minimal image 
(https://catalog.redhat.com/software/containers/ubi8/nodejs-16-minimal/615aefd53f6014fa45ae1ae2 
) 
and couldn't seem to get the PATH to refer to the appropriate $HOME 
location. The result is that the node_modules paths are all relative 
to root ("/") instead of relative to the /opt/app-root/src path


$ docker run -it 
registry.access.redhat.com/ubi8/nodejs-16-minimal:latest 
 
printenv PATH

/node_modules/.bin/:/.npm-global/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

In testing on my machine, it seems to be because the HOME variable and 
the PATH variable are declared in the same ENV action. Separating them 
resolved this for me, though it seems like it should have worked as 
expected.


Either way, I wanted to report it to see if there was something that I 
could do to resolve this, or if there was simply an error in how I was 
using this image.


Regards,

José R. González
Red Hat | Partner Lifecycle Engineering


___
SCLorg mailing list
SCLorg@redhat.com
https://listman.redhat.com/mailman/listinfo/sclorg
___
SCLorg mailing list
SCLorg@redhat.com
https://listman.redhat.com/mailman/listinfo/sclorg


Re: [scl.org] scl bin path into package

2021-12-21 Thread Чернович Александр
Hi, thanks for your answer, my goal just to add snmp library and snmp perl 
module into rh-perl524 collection (not a separate one).
I realized my first mistake -- I was trying to build without specifying 
collection name, the correct commands to build seems to be  "scl enable 
rh-perl524 bash" then "rpmbuild -bb net-snmp.spec --define 'scl rh-perl524'"
I have corrected scl_prefix a you said, and additionally some small mistakes. I 
prepared my system in the way I could successfully compile any of rh-perl524 
SCL packages. Then I tried to compile net-snmp package agin,
now it seems that all path are correct and have valid collection prefix without 
hard-coding it. But compilation is falling on the last stage (Processing files: 
rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64) :
error: File not found: 
/home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/enable
error: File not found: 
/home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/etc/scl/prefixes/rh-perl524
error: File not found: 
/home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/bin
error: File not found: 
/home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/boot
error: File not found: 
/home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/dev
error: File not found: 
/home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/etc/opt/rh/rh-perl524/X11
etc...

It seems that rpmbuild is trying to build all system root directories structure 
an insert it into package. I understand that there is some error in my spec but 
I can't find it, could you, please, help?

Modified spec-file with needed patches for perl 5.24 in attachment.

--
Thanks to all for help,  especially Petr.
Best regards, 
Alexander

От: sclorg-boun...@redhat.com [sclorg-boun...@redhat.com]  
 Petr Pisar [ppi...@redhat.com]
Отправлено: 18 октября 2021 г. 15:52
Кому: sclorg@redhat.com
Тема: Re: [scl.org] scl bin path into package

V Fri, Oct 15, 2021 at 05:36:19PM +0300, Alexander Chernovich napsal(a):
> Hi all, I am trying to import net-snmp into rh-perl524 SCL(RHEL-7), I need
> perl SNMP module into SCL, but it need snmp-package recompilation, so I am
> trying to rewrite spec file, all seems to be OK, but no scl-based path both
> to bin and lib are used(only system path).
>
> I was trying to get path via `%{?scl:PREFIX=%{_scl_root}}`? but it is emty,
> what I am doing wrong? spec-file in attachment
>
Have you read
?
It describes how to create a new collection with depends on rh-perl524
collection. It's maybe too complicated for your use case, but it explains all
the macros and dependencies.

If you only want to add net-snmp package into rh-perl524 collection, then
I would recommend you first to find any existing source package from the
collection and then get your system to a state in which rebuilding that source
package will produce the same binary packages as provided by the collection.
Achieving that state usually means installing rh-perl524-build package
which you first need to build from rh-perl524 source package. Finally you can
edit net-snmp pakage in a similar way as the collection package you chose at
the beginning.

> %{?scl:Requires: %{scl}-runtime}
> %{?scl:BuildRequires: %{scl}-runtime}
> BuildRequires: openssl-devel, bzip2-devel, elfutils-devel
> BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel
> BuildRequires: %{?scl_prefix}perl-devel, perl(ExtUtils::Embed)%{?scl_prefix}, 
> gawk, procps

perl(ExtUtils::Embed) has bad prefix.

> %build
> %{?scl:scl enable %{scl} - << \EOF}
> %{?scl:PREFIX=%{_scl_root}}
> set -e
> MIBS="host agentx smux \
>  ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \
>  ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \
>  ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \
>  ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \
>  ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \
>  sctp-mib rmon-mib etherlike-mib"
>
> %ifnarch s390 s390x
> # there are no lm_sensors on s390
> MIBS="$MIBS ucd-snmp/lmsensorsMib"
> %endif
>
>
> %configure \
> --prefix="$PREFIX"

You don't need to change --prefix=%{__prefix}. %{__prefix} will be
automatically redefined if rh-perl524-build is installed.

However, if your goal is to build net-snmp while keeping it installed into
/usr prefix and only use rh-perl524 Perl for linking and installing its Perl
modules, then basically you need to prepend rh-perl524 to Perl dependencies,
change %files entries for Perl modules to point deep into /opt/rh/perl524/...,
do "scl enable rh-perl524", and then build the package. Crafting the spec file
have half of files and dependencies from system, and another half from
collection is 

Re: [scl.org] scl bin path into package

2021-12-21 Thread Чернович Александр
Thanks alot! 
It is compiling successfully now, the trouble was in  %scl_files macros, it was 
wrong to call it, thanks again!

The duplicated lines were because of incorrect copy-pasting, so I have fixed 
spec file (by direct file coping from SPECS directory),
 and attach it to this mail. May be it would could be helpful for someone who 
decide to recompile SNMP perl module for perl SCL.

Petr, many thanks again, and sorry for bothering. 

--
Best regards,
Alexander  

От: sclorg-boun...@redhat.com [sclorg-boun...@redhat.com]  
 Petr Pisar [ppi...@redhat.com]
Отправлено: 20 октября 2021 г. 11:28
Кому: sclorg@redhat.com
Тема: Re: [scl.org] scl bin path into package

V Tue, Oct 19, 2021 at 03:47:54PM +, Чернович Александр napsal(a):
> I have corrected scl_prefix a you said, and additionally some small
> mistakes. I prepared my system in the way I could successfully compile any
> of rh-perl524 SCL packages. Then I tried to compile net-snmp package agin,
> now it seems that all path are correct and have valid collection prefix
> without hard-coding it. But compilation is falling on the last stage
> (Processing files: rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64) :
> error: File not found: 
> /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/enable
> error: File not found: 
> /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/etc/scl/prefixes/rh-perl524
> error: File not found: 
> /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/bin
> error: File not found: 
> /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/boot
> error: File not found: 
> /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/opt/rh/rh-perl524/root/dev
> error: File not found: 
> /home/rpmbuild/rpmbuild/BUILDROOT/rh-perl524-net-snmp-5.7.2-49.el7.1.x86_64/etc/opt/rh/rh-perl524/X11
> etc...
>
That's because of "%{?scl: %scl_files}" you put in all %files sections.
%scl_files should only be used at runtime subpackages. See
"rpm -ql rh-perl524-runtime". The runtime package is a top-level package of
a collection and delivers basic definition of the collection. Becuase you are
not creating a new collection, you don't need to package that files.
I recommend you removing the "%{?scl: %scl_files}" lines from net-snmp.spec.

I also noticed that your spec file has duplicate content from line 646:

   641  %changelog
   642  * Mon Oct 18 2021 Alexander  - 1:5.7.2-49.2
   643  - add net-snmp to rh-perl524 SCL
   644
   645
   646  [rpmbuild@stand_vm SPECS]$ cat net-snmp.spec
   647  %{?scl:%scl_package net-snmp}
   648  %{!?scl:%global pkg_name %{name}}
   649


--- Petr


net-snmp-v2.tar.gz
Description: net-snmp-v2.tar.gz
___
SCLorg mailing list
SCLorg@redhat.com
https://listman.redhat.com/mailman/listinfo/sclorg


[scl.org] Need information regarding container image release.

2021-12-21 Thread Abey Jose
Hello Team,

On checking the rhel8/httpd-24 container image (1-156) [1], the httpd
package httpd-2.4.37-39.module+el8.4.0+9658+b87b2deb.x86_64 is  present.
But when we check the package details in Red Hat site [2], there is an
update available (from 2021-09-30) which fixes the original vulnerability
(CVE-2021-40438). The container image (1-156) [1] is affected, since it
contains a non-fixed version of httpd.

Do we have any idea when an updated container image for httpd24 will be
available, that contains a fixed version? Any inputs will be really
helpful. Thanks in advance.

[1]
https://catalog.redhat.com/software/containers/rhel8/httpd-24/5ba0addbbed8bd6ee819856a?container-tabs=packages=1-156_date=1632226439000
[2]
https://access.redhat.com/downloads/content/rhel---8/x86_64/7443/httpd/2.4.37-39.module+el8.4.0+12865+a7065a39.1/src/fd431d51/package-changelog
--
Regards,
*Abey Jose*
TSE, OpenShift Container Platform
 TRIED. TESTED. TRUSTED. 
___
SCLorg mailing list
SCLorg@redhat.com
https://listman.redhat.com/mailman/listinfo/sclorg


[scl.org] ubi8/nodejs-16-minimal HOME env and PATH

2021-12-21 Thread Jose Gonzalez
Hi there!

I attempted to use the ubi8/nodejs-16-minimal image (
https://catalog.redhat.com/software/containers/ubi8/nodejs-16-minimal/615aefd53f6014fa45ae1ae2)
and couldn't seem to get the PATH to refer to the appropriate $HOME
location. The result is that the node_modules paths are all relative to
root ("/") instead of relative to the /opt/app-root/src path

$ docker run -it registry.access.redhat.com/ubi8/nodejs-16-minimal:latest
printenv PATH
/node_modules/.bin/:/.npm-global/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

In testing on my machine, it seems to be because the HOME variable and the
PATH variable are declared in the same ENV action. Separating them resolved
this for me, though it seems like it should have worked as expected.

Either way, I wanted to report it to see if there was something that I
could do to resolve this, or if there was simply an error in how I was
using this image.

Regards,

José R. González
Red Hat | Partner Lifecycle Engineering
___
SCLorg mailing list
SCLorg@redhat.com
https://listman.redhat.com/mailman/listinfo/sclorg