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

Enable custom autosave configuration #1

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DIRS += $(wildcard *Sup)
DIRS += $(wildcard *App)
DIRS += $(wildcard *Top)
DIRS += $(wildcard iocBoot)
DIRS += postinstall

# The build order is controlled by these dependency rules:

Expand All @@ -25,6 +26,7 @@ $(foreach dir, $(filter %Top, $(DIRS)), \

# iocBoot depends on all *App dirs
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))
postinstall_DEPEND_DIRS += iocBoot $(wildcard *App)
Comment on lines 28 to +29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it enough that we depend on iocBoot and it depends on all "App" directories? If not, wouldn't it be best to use the filter command from above, nonetheless?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it enough that we depend on iocBoot and it depends on all "App" directories?

Yes, it is enough, since iocBoot depends on App. I listed it explicitly because we depend directly on an artifact from the App directory.

It is okay to simplify this assuming that iocBoot dependencies will never change.

If not, wouldn't it be best to use the filter command from above, nonetheless?

Indeed. My mistake.


# Add any additional dependency rules here:

Expand Down
2 changes: 1 addition & 1 deletion iocBoot/iocCamera/st.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/opt/ad-aravis-epics-ioc/bin/linux-x86_64/Camera
#!/usr/bin/env Camera
# -*- container-image: ghcr.io/cnpem/ad-aravis-epics-ioc

cd /opt/ad-aravis-epics-ioc/iocBoot/iocCamera
Expand Down
7 changes: 7 additions & 0 deletions postinstall/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TOP=..
include $(TOP)/configure/CONFIG

install:
ln -s $(shell realpath $(INSTALL_HOST_BIN))/Camera /usr/local/bin/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use TOP instead of realpath?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw can you still run make clean with this simple makefile? Do the includes handle it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use TOP instead of realpath?

Yep. That seems better indeed.

Btw can you still run make clean with this simple makefile?

Hmm. I haven't analyzed it. I bet we would have broken links around. Probably it will require a clean target to unlink them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use TOP instead of realpath?

Yep. That seems better indeed.

Hmm. Actually, TOP and INSTALL_LOCATION are relative paths to the current folder when we reach this target (INSTALL_LOCATION becomes a copy of TOP as it is not defined in the CONFIG_SITE). Here are the available variables:

TOP = ..

INSTALL_LOCATION = ..
INSTALL_ABSOLUTE = /opt/ad-aravis-epics-ioc
FINAL_LOCATION = /opt/ad-aravis-epics-ioc
INSTALL_LOCATION_BIN = ../bin
EPICS_HOST_ARCH = linux-x86_64
INSTALL_HOST_BIN = ../bin/linux-x86_64

IOCS_APPL_TOP = /opt/ad-aravis-epics-ioc

I thought it would be okay to use FINAL_LOCATION (or INSTALL_ABSOLUTE), which are absolute and undocumented, along with INSTALL_HOST_BIN, but it turns out it does not work well due to INSTALL_HOST_BIN being defined based on the relative TOP. That is, $(INSTALL_ABSOLUTE)/$(INSTALL_HOST_BIN)/Camera does not point to the correct binary path.

For me, either we use my original suggestion or $(FINAL_LOCATION)/bin/$(EPICS_HOST_ARCH)/Camera. I think using FINAL_LOCATION might be more appropriate here, as this is really the place the build system expects the binary to go (even though it does not finish the job on its own).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using FINAL_LOCATION seems like a good choice.


include $(CONFIG)/RULES_DIRS