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

Supporting statically linked IOCs #75

Merged
merged 6 commits into from
Oct 3, 2024
Merged

Supporting statically linked IOCs #75

merged 6 commits into from
Oct 3, 2024

Conversation

ericonr
Copy link
Collaborator

@ericonr ericonr commented Aug 28, 2024

No description provided.

@ericonr ericonr requested review from henriquesimoes and gustavosr8 and removed request for henriquesimoes August 28, 2024 16:19
version=$(git describe)

echo $version > $IOC-version
echo ".git/" > /tmp/globs
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The necessary globs for building afc-epics-ioc correctly are still going to be determined.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Has this been resolved?

Copy link
Contributor

@gustavosr8 gustavosr8 left a comment

Choose a reason for hiding this comment

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

Isn't better to squash this commit with the previous, keeping the changes tracking with the change itself?

@ericonr
Copy link
Collaborator Author

ericonr commented Aug 29, 2024

Isn't better to squash this commit with the previous, keeping the changes tracking with the change itself?

I'm not sure. The change is a combination of all the other commits in the PR, IMO. Even if the last commit was the one to tie everything together 🤔

README.md Outdated Show resolved Hide resolved
base/build-static-ioc.sh Outdated Show resolved Hide resolved
base/build-static-ioc.sh Outdated Show resolved Hide resolved
base/musl/Dockerfile Outdated Show resolved Hide resolved
@ericonr ericonr force-pushed the static-link branch 2 times, most recently from f9093d6 to 2f2713b Compare August 29, 2024 14:40
@henriquesimoes
Copy link
Collaborator

Isn't better to squash this commit with the previous, keeping the changes tracking with the change itself?

I'm not sure. The change is a combination of all the other commits in the PR, IMO. Even if the last commit was the one to tie everything together 🤔

There is one thing that I don't like about letting them in the same commit: when reverting a commit, you need to be careful not to revert the changelog. Thus, this is necessarily partial revert. But you should probably also specify in the log that you did this, so not a big deal.

On the other hand, it is pretty handy for blaming changes.

For this case, I also understand this a whole PR change that is being described. So I'm okay with it as is.

@ericonr
Copy link
Collaborator Author

ericonr commented Sep 4, 2024

@henriquesimoes I didn't copy the directory inside the container as we had discussed, for the reasons laid out in the commit message. Let me know what you think.

README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@henriquesimoes henriquesimoes left a comment

Choose a reason for hiding this comment

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

I didn't copy the directory inside the container as we had discussed, for the reasons laid out in the commit message. Let me know what you think.

That's fine. It would be easier if EPICS supported out-of-tree compilation.

@ericonr
Copy link
Collaborator Author

ericonr commented Sep 12, 2024

Assuming we merge #75 , this will require an update :)

@henriquesimoes
Copy link
Collaborator

Assuming we merge #75 , this will require an update :)

You mean #77, right? We may do the other way around if you prefer.

@ericonr
Copy link
Collaborator Author

ericonr commented Sep 12, 2024

Assuming we merge #75 , this will require an update :)

You mean #77, right? We may do the other way around if you prefer.

Oops, yeah. Thanks :)

I've already rebased #77 locally on top of this, so I'm pending towards merging this one first.

@ericonr ericonr force-pushed the static-link branch 2 times, most recently from c62312d to b27a3b0 Compare October 1, 2024 20:02
@gustavosr8
Copy link
Contributor

WDYT about adding bash to the following in e7eeebc?

```
$ git submodule add -b release https://github.com/cnpem/epics-in-docker.git docker/
```

Copy link
Collaborator

@henriquesimoes henriquesimoes left a comment

Choose a reason for hiding this comment

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

Well, changes look right to me. Nice to know that the build system keeps everything inside O.*. It is good to merge for me.

WDYT about adding bash to the following in e7eeebc?

I have been disappointed by the syntax highlight for bash in GitHub. Not sure if shell behaves differently or if all of them are not properly rendered.

This makes it possible to build fully statically linked IOCs easily.
Git is likely to be useful for build steps and should be included in the
image by default.
When building statically linked binaries, it is necessary to link them
to all libraries, so it becomes necessary for COMMANDLINE_LIBRARY to
point to libreadline and its dependency, ncurses. The static version of
said dependency was also missing from the container.

We are repurposing a mechanism intended to support older Linux distros,
not static linking, and care should be taken to make sure it keeps
working when base is updated.
This script automates building fully statically linked IOCs using the
musl image, and includes documentation for how to use it in the README.

It was decided to use the mount point directory directly for builds
instead of copying the source into a different directory in the
container, even though it would remove the need to overwrite and then
restore configure/ files. Doing otherwise would require the container to
stay up for SKIP_CLEAN=1 to be relevant, and it would still require
additional complexity in lnls-build-static-ioc, in order to copy the
source into the right place, which would also require rsync in the build
image to work properly.

Using "O.*" in the tar glob file allows us to avoid calling "make clean"
at any stage, and therefore calling "make -C iocBoot" is also
unnecessary.
@ericonr ericonr merged commit 4dbf358 into main Oct 3, 2024
2 checks passed
@ericonr ericonr deleted the static-link branch October 3, 2024 18:29
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

Successfully merging this pull request may close these issues.

3 participants