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

Examples only work for last target built #32

Open
dhickin opened this issue Mar 3, 2016 · 4 comments
Open

Examples only work for last target built #32

dhickin opened this issue Mar 3, 2016 · 4 comments

Comments

@dhickin
Copy link
Contributor

dhickin commented Mar 3, 2016

If I build a copy of pvaSrv then directories in testTop/iocBoot and exampleTop/iocBoot will contain a file envPaths with environmental variables needed to run the test/examples in these directories.

If I build for two targets, say Linux then Windows, the envPaths from the first build will be overwritten by the one from the second and the examples won't work for the first target.

So if I set

SUPPORT=/dls_sw/prod/R3.14.12.3/support

in RELEASE.linux-x86_64[.*]

and

SUPPORT=W:/prod/R3.14.12.3/support

in RELEASE.windows-64[.*] then the line

epicsEnvSet("PVASRV","/dls_sw/prod/R3.14.12.3/support/pvaSrv/0-10-5/testTop/..")

will be overwritten by

epicsEnvSet("PVASRV","W:/prod/R3.14.12.3/support/pvaSrv/0-10-5/testTop/..")

At Diamond all production software is run from a production area which we only have read-access which we release to through scripts. Therefore if I tag the release and then run scripts (which do a "make") for Linux and then Windows, only the Windows example will work. I can't resolve this after the running the scripts as I don't have write access. This is what happened when I released the 4.4.0 modules.

It would be nice if the examples in our production area actually worked. So I'd like a fix to go into pvaSrv so that the examples all run.

Given we want to deploy 4.5.0.1 I'd also like to apply the patch to the 4.5.0.1.

As we want to start deploying 4.5.0.1 this shutdown (starting March 11) I could do with a fix in the next working day or 2.

I tried coming up with a fix. The following change worked, except that it amake clean in testTop doesn't remove the envPaths.*:

--- a/testTop/iocBoot/testDbPv/Makefile
+++ b/testTop/iocBoot/testDbPv/Makefile
@@ -1,5 +1,7 @@
 TOP = ../..
 include $(TOP)/configure/CONFIG
 ARCH = $(EPICS_HOST_ARCH)
-TARGETS = envPaths
+envPaths.$(EPICS_HOST_ARCH) : envPaths
+       cp envPaths envPaths.$(EPICS_HOST_ARCH)
+TARGETS = envPaths.$(EPICS_HOST_ARCH)
 include $(TOP)/configure/RULES.ioc
diff --git a/testTop/iocBoot/testDbPv/st.cmd b/testTop/iocBoot/testDbPv/st.cmd
index 8dd5590..7ab060c 100644
--- a/testTop/iocBoot/testDbPv/st.cmd
+++ b/testTop/iocBoot/testDbPv/st.cmd
@@ -1,4 +1,4 @@
-< envPaths
+< envPaths.${EPICS_HOST_ARCH}

How is this as a fix? Is $(EPICS_HOST_ARCH) the right choice or would a different variable be better. Is there a way of cleaning the envPaths.*s.

I'm sure there are EPICS build experts who can suggest a better fix though.

@anjohnson
Copy link
Contributor

In an iocBoot/ioc/Makefile the ARCH variable should NEVER be set to $(EPICS_HOST_ARCH) for exactly this reason. The design of the current build system was based on the idea that iocBoot/ioc directories would always be architecture-specific. There have been alternative application development environments where that was not the case, but we're not there at the moment.

@anjohnson
Copy link
Contributor

Sorry, s/iocBoot/$(EPICS_HOST_ARCH)/ for those reading the email version of the previous comment.

@anjohnson
Copy link
Contributor

Dave, I'll try to take a closer look at your suggestion and comment further after I've finished publishing the Base-3.16.0.1 release tomorrow.

@ralphlange
Copy link
Contributor

Pointer to the LaunchPad bug where the issue is being covered (hopefully, eventually) in EPICS Base:
https://bugs.launchpad.net/epics-base/+bug/1553304

You may want to cherry-pick from there, or (as a temporary workaround) add a compile line "-D" definition and a few lines to the IOC's main() routine that puts the macro into the EPICS_TARGET_ARCH environment variable.

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

No branches or pull requests

3 participants