[GSoC 2020]: Need help in writing sed alternative in Python for RSB recipes

Chris Johns chrisj at rtems.org
Mon Aug 24 00:55:51 UTC 2020


On 23/8/20 8:08 am, Mritunjay Sharma wrote:
> [Good news and Update]: 
> 
> Thank you so much Chris! Your advice to search for macros using --trace solved
> the problem of hard coding!
> It took two complete days to figure out this beautiful thing but it is every
> worth it. 

Well done, that looks like time worth spending given the results. The --trace is
not the most pleasant of output but it has all the detail.

> Now the user has to just enter the below command and it will make things work: 
> 
> `../source-builder/sb-builder --with-rtems-bsp="xilinx_zynq_a9_qemu"
> --log=log_epics epics-7-1  --trace --prefix=$HOME/development/rtems/5-arm`
> 
> Note: prefix will depend on the user. 
> 
> What made this possible? Your suggestion and the changes in code mentioned below:
> 
> ```diff --git a/rtems/config/epics/epics-7-1.cfg b/rtems/config/epics/epics-7-1.cfg
> index aeb39a9..4b20f82 100644
> --- a/rtems/config/epics/epics-7-1.cfg
> +++ b/rtems/config/epics/epics-7-1.cfg
> @@ -6,6 +6,8 @@
>   %define release 1
>  %endif
>  
> +%include %{_configdir}/rtems-bsp.cfg

Great.

> +
>  #
>  # EPICS Version
>  #
> diff --git a/source-builder/config/epics-7-1.cfg
> b/source-builder/config/epics-7-1.cfg
> index a9581a2..a47aecb 100644
> --- a/source-builder/config/epics-7-1.cfg
> +++ b/source-builder/config/epics-7-1.cfg
> @@ -40,7 +40,10 @@ URL:  https://epics.mpg.de/
>  
>    %{build_build_flags}
>  
> -  %{__make} PREFIX=%{_prefix} RTEMS_BASE=$HOME/development/rtems/5-arm
> RTEMS_VERSION=5 CROSS_COMPILER_TARGET_ARCHS=RTEMS-xilinx_zynq_a9_qemu
> +  #
> +  # Using macros to dynamically path to RTEMS_BASE and RTEMS_VERSION using
> --with-rtems-bsp
> +  #
> +  %{__make} PREFIX=%{_prefix} RTEMS_BASE=%{_exec_prefix}
> RTEMS_VERSION=%{rtems_version}
>  
>    cd ${build_top}
>  
> @@ -50,6 +53,5 @@ URL:  https://epics.mpg.de/
>    rm -rf $SB_BUILD_ROOT
>  
>    cd ${source_dir_epics}
> -  %{__make} DESTDIR=$SB_BUILD_ROOT PREFIX=%{_prefix}
> RTEMS_BASE=$HOME/development/rtems/5-arm RTEMS_VERSION=5
> CROSS_COMPILER_TARGET_ARCHS=RTEMS-xilinx_zynq_a9_qemu
> -
> +  %{__make} DESTDIR=$SB_BUILD_ROOT PREFIX=%{_prefix} RTEMS_BASE=%{_exec_prefix}
> RTEMS_VERSION=%{rtems_version}

Nice, this is along the lines of what I had hope at the start was possible.

>    cd ${build_top}
> ```
> 
> These couple of changes made this build successful using RSB recipe. The only
> problem remains 
> is that a warning of 'no hash found' is coming, even though I have added it. 

The config hash is for epics-%{epics_version}.tar.gz and %source is using
--rsb-file=epics-base-%{epics_version}.tar.gz. The names do not match. Is
--rsb-file needed? This is only added if the download file is some generated
name and not what we expect.

> The above changes can be found pushed
> here: https://github.com/RTEMS/rtems-source-builder/commit/a505877157f63f6ae17906276b3ffcb699ed1297

Can you please create a suitable patch against the RSB master repo?

Has your blog been kept updated?

> Please do give feedback and suggest improvements so that the recipe can become
> mergeable. 

I think it is time to expand the user base and to look at merging the script
into the RSB's master repo.

The next problem to solve is the EPICS's `make runtests`. This is gong to be
hard because it is a meeting of 2 different approaches and I suspect it will
require insight and imagination to find a workable solution.

A test run like `make runtest` is complicated to wrap because the test framework
in EPICS may be needed to support the tests. I do not think you can simply copy
and run a single executable. This is understandable and fine however it means
the way to invoke the tests for a specific RTEMS target needs to be embedded in
to EPICS and this may conflict with the RSB's ability to build EPICS for a range
of BSPs that EPICS has no direct support for. I am not asking you add the
support to EPICS, rather can we interface to EPICS so we can wrap and control
the pieces we need.

RTEMS has the `rtems-run` command. It is a way to run an executable on a target.
The `rtems-test` command internally wraps the `rtems-run` command to run an
RTEMS kernel test executable. The RTEMS User manual has more detail.

Is it possible to provide EPICS with a command, make variable or something that
lets us control how an EPICS test executable is executed? If we can join an
EPICS test run with `rtems-run` we make available the same hardware and process
we use to test the RTEMS kernel to EPICS

I am not sure `rtems-run` as it stands will work as EPICS may be running a
number of networked executables. I have no idea about this or any insight into
what EPICS is doing here so please have a look and report back.

Another piece of work is to have the RSB script point to EPCIS master repo. This
will mean working with Heinz to get changes in his repo into the upsream EPICS repo.

Chris


More information about the devel mailing list