-
Notifications
You must be signed in to change notification settings - Fork 9
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
[WIP] Document/Examples on Relocatable Software #5
Open
drbenmorgan
wants to merge
36
commits into
HSF:master
Choose a base branch
from
drbenmorgan:dbm-relocatable-notes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hegner
changed the title
Document/Examples on Relocatable Software
[WIP] Document/Examples on Relocatable Software
Apr 19, 2016
drbenmorgan
force-pushed
the
dbm-relocatable-notes
branch
from
March 21, 2018 11:39
248f06c
to
5d18013
Compare
drbenmorgan
force-pushed
the
dbm-relocatable-notes
branch
from
May 15, 2018 11:50
524a386
to
0c9a040
Compare
Define relocatibility at start and show minimal layout example. Provide basic sections on dynamic linking, self-location and support tools. Add section on relocatability with other languages and give minimal self-location examples for Python and Ruby.
Use info from Brett Viren and Sebastien Binet on self location for Bash and Go languages.
Implement basic C/C++ w/CMake project to demonstrate relocatable programs. Create basic structure plus programs demoing self-location with - binreloc - Qt5 QApplication - Poco Application Provide very basic docs for these and link main README to the project. Move python and ruby example into project for coherence
TODO: Add example project to demonstrate this link vs runtime behaviour. It's important for packager and end-user interaction as it: - Can be solved by absolute RPATHs, but then requires care in binary packaging/deployment - Can add needed link flags in package manager compiler wrapper, but what about end users that link to the installed software?
To match docs on relocatability with example code, organise code following structure in current README - Code for exes in `programs`, build/install to bin/ - Resources in `resources`, build/install to share/HFRelocatable.resources Do not add install steps just yet.
Provide function giving direct path to resource directory, using relative path from bindir -> resourcedir known from installation paths. This is quick and dirty - in particular, cpp file is generated directly, but probably better to create private header file with constexpr literal strings.
Use project layout/naming in examples as per that in the actual "HSFReloc" example. Start reordering docs per use-case rather than by language.
Draft section based on notes from Brett Viren on the use case of scripts with shebang lines. Use, as per notes, Python as the main example.
drbenmorgan
force-pushed
the
dbm-relocatable-notes
branch
from
May 18, 2018 09:19
0c9a040
to
e9b5463
Compare
Original binreloc interfaces to return "bindir" etc assume a pure posix style installation hierarchy. This may not be the case, and want to leave interpretation of paths from exe to other locations up to developer. Copy original binreloc files to "binreloc.EXT" for reference. Strip down hsf_binreloc copies to minimum interface needed to initialize and return the full path to the exe.
In preparation for creating dedicated binreloc interface target, separate out binreloc and frontend to it out. This helps later when we'll have both an executable and a library. Each will need their own binreloc code.
So that we can generate binreloc code per binary (if required), factor creation of binreloc header, source file into a function that generates an INTERFACE target that clients can consume. Rewrite build of hsfreloc program to generate and use this interface target "hsf_binreloc".
To make top level README clearer and separate concerns, factor out CMake/pkg-config use/creation stuff to subdirectory. This has README to cover topics/issues, then will add example code.
Simplicity and separation of concerns.
"Trivial" rename, but better fits the task of the subproject, which is to illustrate how binaries can self-locate themselves, nothing more or less.
Keep programs together, whether they are compiled or interpreted. Do the same for libraries later.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per Liz's suggestion, I'm opening this PR for comments/requests/things to add on the notes/examples on Relocatable Software I'm writing. This is very much a work in progress, so not for merging at this point!
I'll add commits as I continue to edit together with any of your suggestions.