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

add support for developer mode #4693

Draft
wants to merge 3 commits into
base: 5.0.x
Choose a base branch
from

Conversation

Crivella
Copy link
Contributor

Related to:

I am having a crack at implementing this feature.

Right now the user can specify a path using the --developer options (arguably would be better as --source(s)-from) taken as the current directory by default, to use with an already existing EC file.

The developer mode would append a -dev (maybe .dev could be better?) to the version originally found in the EC, and the EB will skip the fetch/patch/extension steps and, instead of extracting an existing source during the extract_step will copy the content of the specified source path to the build directory.
The name of the copied directory will be set to match cfg['start_dir'] if set, or will keep its original name and configure its own start directory

Tested by compiling the develop branch of the following code-bases using the respective 2023a EC file as a base

  • QuantumESPRESSO
  • zlib
  • HDF5

While implementing this, i had several reflections/ideas that will requires some design choices on what we would want this feature to enable and potential problems with the current implementation

  • EC with multiple sources
    • this could still work but it would require the user to have all projects in the directory pointed at with --developer (and possibly some minor changes to how start_dir is being handled.
  • Bundles
    • will not work without mocking self.src that should be set by the fetch_step
    • will also have similar problems as the EC with multiple sources

The -dev suffix to the version will make the version appear as greater then the modified one but lower then the next numerically higher one, so it should not screw up with version checks in the easyblock (and i think having the develop version appear as greater should be the default behavior for this scenario).

I was thinking the most general way to avoid this problem might be to:

  • Extend the EC source syntax to add a develop options to point to the dir to be copied
  • Run al step as normal up to the extract_step
  • Run the extraction (or implement a dryrun version) to get the name of the extracted folder and than remove/replace it with a copy of the folder pointed by develop
  • Would also remove the need to handle the -dev prefix as the developer could just set his own versionsuffix

The current implementation is probably the easiest for the developer perspective (they would only need to add --developer to the command, but this might be limited and not work in many scenario.

The more complete approach might add a level of difficulty in that the developer will need to understand the EC file and add the relevant parts.
There is also the fact that this build process would need to download some existing sources without using them just to get the information to reproduce the expected builddir layout (not sure if there is a way around this).

An intermediate approach could be to allow --developer to define a list of paths and each of them would replace one source in the same order as they are defined in the EC (would act at the level of the fetch_step.
The downside would be that the developer would need to be careful about the order of the specified sources

I am not sure which would be the best way to move forward (or if there is some other solution I have not tried/thought of) so I am leaving this as a draft for discussion

@boegel boegel changed the title Feature developer mode add support for developer mode Nov 6, 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