Since my post on creating separate EasyBuild development environments I have encountered a piece of software I need to develop some custom EasyBlocks for. My scripts allow this, however my magic module does not initialise the platform-specific installs using a custom EasyBlock source. In order to retain the convenience of architecture-local initialisation on each architecture I modified part of my module.

To do this, I replaced the portion that initialised the platform (this is the original):

            -- Always use the sources folder in the main branch
            if suffix then
                platform_init_args=platform_init_args .. ' "--easybuild-source-path=' .. eb_base_path .. suffix_base .. '/sources"'
                platform_init_args=platform_init_args .. ' "--install-easyconfigs-source=' .. eb_base_path .. toolchain_ver .. '"'
            else
                platform_init_args=platform_init_args .. ' "--easybuild-source-path=' .. eb_base_path .. toolchain_ver .. '/sources"'
            end
            -- Initialise the platform
            os.execute("bash -c 'eb-platform-init " .. platform_init_args .. " " .. eb_this_toolchain_plat_path .. " > /tmp/module-eb-platform-init ; mv /tmp/module-eb-platform-init \"" .. eb_this_toolchain_plat_path .. "/init.log\"'")

Instead of having a hard-coded --install-easyconfig-source setting if there is a suffix (i.e. a branch off the main), I replaced this with global detection of a separate easyconfig/easyblock/framework directory and use them if they exist. This means that in order to create a new branch with custom easyblocks, the platform-agnostic bootstrap script can be used (e.g. with --clone-easyconfigs --clone-easyblocks) to pre-create it in place of the default (easyconfig-only for a branch) option.

The new section looks like this, the scripts remain the same:

            -- Always use the sources folder in the main branch
            if suffix then
                platform_init_args=platform_init_args .. ' "--easybuild-source-path=' .. eb_base_path .. suffix_base .. '/sources"'
            else
                platform_init_args=platform_init_args .. ' "--easybuild-source-path=' .. eb_base_path .. toolchain_ver .. '/sources"'
            end

            if isDir(eb_base_path .. toolchain_ver .. '/easybuild-easyconfigs') then
                platform_init_args=platform_init_args .. ' "--install-easyconfigs-source=' .. eb_base_path .. toolchain_ver .. '"'
            end
            if isDir(eb_base_path .. toolchain_ver .. '/easybuild-easyblocks') then
                platform_init_args=platform_init_args .. ' "--install-easyblocks-source=' .. eb_base_path .. toolchain_ver .. '"'
            end
            if isDir(eb_base_path .. toolchain_ver .. '/easybuild-framework') then
                platform_init_args=platform_init_args .. ' "--install-framework-source=' .. eb_base_path .. toolchain_ver .. '"'
            end
            -- Initialise the platform
            os.execute("bash -c 'eb-platform-init " .. platform_init_args .. " " .. eb_this_toolchain_plat_path .. " > /tmp/module-eb-platform-init ; mv /tmp/module-eb-platform-init \"" .. eb_this_toolchain_plat_path .. "/init.log\"'")