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

Make demos build-able from top level makefile and add them to CI #24047

Closed
wants to merge 11 commits into from

Conversation

nhorman
Copy link
Contributor

@nhorman nhorman commented Apr 5, 2024

We should be ensuring our demos in the source tree are buildable on a regular basis. Add a target to build them from the top level makefile and add a step to the appropriate CI jobs to check that

@nhorman nhorman self-assigned this Apr 5, 2024
@nhorman nhorman force-pushed the 351 branch 4 times, most recently from 6f7e707 to 7248b99 Compare April 5, 2024 17:45
@nhorman nhorman marked this pull request as draft April 5, 2024 21:35
@nhorman nhorman force-pushed the 351 branch 3 times, most recently from 420dd08 to 09a17ec Compare April 6, 2024 02:54
Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

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

Looks good, at least superficially.

@nhorman
Copy link
Contributor Author

nhorman commented Apr 6, 2024

@paulidale thanks, not done yet of course, need to fix up all the build errors, and figure out how to link to external libraries using our build system for the http3 demo

@romen
Copy link
Member

romen commented Apr 6, 2024

I like what I see, and it makes sense, but I am wondering if you thought of a way to do this without removing the Make files that end users could use in the "here is a simple self-contained demo openssl application that you can try to get started" setting.
I don't have solutions to propose at this time, but I would like a solution that allows both self-contained demo apps and testing them in our integrated build system so they stay current!

@nhorman nhorman force-pushed the 351 branch 9 times, most recently from 6ce1eb0 to d8050ed Compare April 7, 2024 01:39
@nhorman
Copy link
Contributor Author

nhorman commented Apr 7, 2024

@romen this big issue I've run into there is the makefiles themselves. The makefiles currently use several features that POSIX/GNUmake only. Windows uses nmake in our build environment, which is, to say the least, limited. There is no good way I can find to write a Makefile that is compatible with both, that doesn't amount to just writing two parallel makefiles (one for windows, one for Gnu Make), which to me doesn't seem like a much better solution.

I think, given that we only distribute our demos with our source tree, and the current build (which only works on unix systems at the moment), explicitly link with the libraries that are built from the same source tree, I feel like using the standard build system to enable windows compatibility is a step forward.

I'm open to suggestions of course. One possibility might be to augment the readme file in each demo directory with instructions on how to build these demos (i.e. what include/library paths are required), to guide users in writing their own independent makefiles specific to their platform. Would that be sufficient to enable independent builds?

@nhorman nhorman marked this pull request as ready for review April 7, 2024 13:43
@slontis
Copy link
Member

slontis commented Apr 8, 2024

Maybe an OTC discussion?
The makefiles arent ideal, but I assume they existed in that form for a reason...
Integrating into the build system, doesnt seem to make it easier for a user to pull out the demo code and try it for themselves.

@nhorman
Copy link
Contributor Author

nhorman commented Apr 8, 2024

I can't speak to the history of how/why they were created, but I can say they currently only work on unix systems (i.e. windows users are left writing their own name files for these demos at the moment). But yeah, we can discuss on OTC

@nhorman nhorman added branch: master Merge to master branch approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member labels Apr 8, 2024
Windows doesn't support getline, so we need to use fgets here
cygwin caught a signedness difference in this pointer.
@nhorman
Copy link
Contributor Author

nhorman commented Apr 11, 2024

Ok, still working on getting the windows builds solid, but I've restored all the makefiles. They are currently unused in our build system (we use the perl build system for that), but they exist as examples for guidance

@tom-cosgrove-arm
Copy link
Contributor

I've restored all the makefiles

Thanks. We should add something in demos/README.txt (and should that become a .md like all the others?) saying how to build them (the comment in Configure is useful, but not where people are likely to look) and also setting expectations about the Makefiles (maybe along the lines of "Makefiles are provided for Unix-like systems, but are only infrequently checked")

The external nghttp3 library seems to have a linking issue on windows
(several missing symbols).  Disable that build in windows for now until
its fixed
Note that they are available but only meant as a guide to self building,
and are not used expressly to build as part of the overall openssl build
@paulidale
Copy link
Contributor

I like the final suggestion 👍

@t-j-h t-j-h removed the approval: otc review pending This pull request needs review by an OTC member label Apr 12, 2024
Copy link
Member

@romen romen left a comment

Choose a reason for hiding this comment

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

LVGTM! Thanks @nhorman for the work, and everyone for the discussion!

Copy link
Contributor

@paulidale paulidale left a comment

Choose a reason for hiding this comment

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

Great outcome.

@t8m t8m added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Apr 12, 2024
Copy link
Contributor

@tom-cosgrove-arm tom-cosgrove-arm left a comment

Choose a reason for hiding this comment

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

Thanks @nhorman - nice work

@nhorman
Copy link
Contributor Author

nhorman commented Apr 12, 2024

merged

@nhorman nhorman closed this Apr 12, 2024
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Fix up the warnings in the demos and make them configurable with
enable-demos

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
The platform doesn't support it

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Windows doesn't support getline, so we need to use fgets here

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
cygwin caught a signedness difference in this pointer.

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
The external nghttp3 library seems to have a linking issue on windows
(several missing symbols).  Disable that build in windows for now until
its fixed

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
openssl-machine pushed a commit that referenced this pull request Apr 12, 2024
Note that they are available but only meant as a guide to self building,
and are not used expressly to build as part of the overall openssl build

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #24047)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: done This pull request has the required number of approvals branch: master Merge to master branch tests: exempted The PR is exempt from requirements for testing triaged: feature The issue/pr requests/adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create target for building Demos. Set up CI to ensure demos are buildable.
9 participants