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

Use symlink for consistent path to unstable/ headers #4826

Closed
wants to merge 2 commits into from

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Oct 7, 2024

Issue:

External projects can always do:
#include <s2n.h>

But, for the unstable headers the path is either
#include <s2n/unstable/cleanup.h>
or
#include <unstable/cleanup.h>

...depending on whether s2n was installed before your project, or built at the same time as your project via CMake's add_subdirectory(s2n). CRT language bindings like aws-crt-python build s2n via add_subdirectory.

Description of changes:

Add symlink, from api/s2n -> api/unstable.

This way, external code can always do #include <s2n/unstable/cleanup.h>, and it works whether s2n was pre-installed, or is being built simultaneously.

This symlink is not installed. It only affects builds that use s2n's source code directly.

Call-outs:

An alternate fix is here: #4825
This simply moves the files, instead of relying on symlinks, and fixes up all local code to use the new paths. It's a lot more changes, but feels to me like a simpler long term fix.

I'm not sure how 100% portable symlinks are. For example, zip requires a --symlink flag to handle them properly.

Testing:

  • Ensured unstable headers still install to same location
  • Ensured code still built when using old unstable/*.h paths
  • Ensured code built when using new s2n/unstable/*.h paths

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@graebm
Copy link
Contributor Author

graebm commented Oct 7, 2024

symlinks are too weird to rely on

@graebm graebm closed this Oct 7, 2024
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.

1 participant