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

Are FMUs with symlinks in binaries allowed? #1638

Closed
chrbertsch opened this issue Jan 21, 2022 · 6 comments · Fixed by #1662
Closed

Are FMUs with symlinks in binaries allowed? #1638

chrbertsch opened this issue Jan 21, 2022 · 6 comments · Fixed by #1662
Assignees
Labels
PR_needed A pull request has to be crearted
Milestone

Comments

@chrbertsch
Copy link
Collaborator

see modelica-tools/FMUComplianceChecker#66

@andreas-junghanns andreas-junghanns added this to the v3.0 milestone Jan 21, 2022
@andreas-junghanns
Copy link
Contributor

I think we need to clarify this issue at least in 3.0, somewhere in "2.5. FMU Distribution", I think.

I just searched through https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT and there symbolic links are only mentioned in "4.5.7 -UNIX Extra Field (0x000d):".
If I read and interpret this correctly, then our platform independence requires that we should not allow it.
Furthermore, this sounds like a feature some zip implementations might not implement or not implement correctly when applied to file systems with varying support of symbol links - anyone with more than my guesswork please report (however subjective).

@pmai : Any wise words to enlighten us mere mortals?

@ven-k
Copy link
Member

ven-k commented Jan 24, 2022

Adding a rule that The actual file pointed by the included symlinks should also be bundled in the `binaries/linux<32/64> would allow symlinks while ensuring that the FMUs with are relocatable.

To clarify on zip:

  • zip in its default zip -rq dest.zip src replaces the symlinks with the actual files.
  • In upcoming FMI standards, if the symlinks are allowed and src contains symlinks, zip -rq --symlink dest.zip src would keep the symlinks as it is.
    However, one should note that, if a user doesn't specify --symlink, the .fmu file would still be valid as all required files are bundled; it will only be bigger than it has to be. In other words while this allows those who want ship symlinks, does not affecting those who don't mind about multiple copies of the file.

The changes would be required on the unzipping-end. A sanity check on included symlinks must be run, to ensure they point to a valid file that is bundled in the .fmu's binaries/linux directory.

One might ask- why include additional symlinks when a copy of actual file exists in the binaries. This is to accommodate usage of versioned shared objects where libFoo.so links to libFoo.so.MAJOR links to libFoo.so.MAJOR.MINOR
A practical example is here
The compressed file size compares 250 MB without symlinks to 150 MB with symlinks

@andreas-junghanns
Copy link
Contributor

@pmai : Any comment you want to share here?

@t-sommer t-sommer modified the milestones: v3.0, v3.0-rc.1 Jan 31, 2022
@andreas-junghanns
Copy link
Contributor

Web design meeting: We reject support for symlinks in FMUs because:

  • The use case is not convincing - why should an FMU have different versions of a library inside that do not exactly use a specific version?
  • We believe this is too complicated and will create a lot of importers that will fail to handle symlinks inside the FMUs correctly on their platform/filesystem combination.

We will add a clarification in the standard that symlinks inside FMUs are not allowed - thank you for pointing this out, @ven-k.

@andreas-junghanns andreas-junghanns added the PR_needed A pull request has to be crearted label Feb 2, 2022
@andreas-junghanns andreas-junghanns linked a pull request Feb 2, 2022 that will close this issue
@ven-k
Copy link
Member

ven-k commented Feb 3, 2022

why should an FMU have different versions of a library inside

Versioned shared objects (.so libraries) are used so that whenever there is a newer release libFoo.so.MAJOR.MINOR, you can modify the symlink libFoo.so to link to this newer library and existing code that uses libFoo.so would still work and use the newest version.
It is not for bundling multiple version of the same library inside FMU

Referring to the

A practical example is here

It bundles in libjulia.so which is a symlink to libjulia.so.1.6 and as the newer Julia gets released, a new generated FMU would have libjulia.so.1.7

We believe this is too complicated

Ok

We will add a clarification

Sure. Thanks

@andreas-junghanns
Copy link
Contributor

@ven-k : we know Unix enough to know the mechanisms for "latest" links. However, an FMU must be complete: all needed libraries must be bundled - later changes cannot be made, a new export is needed and then the old library can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR_needed A pull request has to be crearted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants