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

changed the sanity check for 2016b since the directory structure has … #1096

Merged
merged 6 commits into from Feb 16, 2017

Conversation

mboisson
Copy link
Contributor

@mboisson mboisson commented Feb 2, 2017

MCR R2016b fails to build only because the sanity checks are no longer valid. I added a condition to have the right sanity checks for this version specifically.

custom_paths = {
'files': [],
'dirs': [os.path.join(self.subdir, x, 'glnxa64') for x in ['runtime', 'bin', 'sys/os']],
}
Copy link
Member

Choose a reason for hiding this comment

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

@mboisson it's cleaner to only include the version-specific stuff in the if/else bodies:

custom_paths = {
    'files': [],
    'dirs': [os.path.join(self.subdir, 'bin', 'glnxa64')],
}
if LooseVersion(self.version) >= LooseVersion('2016b'):
    custom_paths.append(os.path.join(self.subdir, 'cefclient', 'sys', 'os', 'glnxa64'))
else:
    custom_paths.extend([
        os.path.join(self.subdir, 'runtime, 'glnxa64'),
        os.path.join(self.subdir, 'sys', 'os', 'glnxa64'),
    ])

'files': [],
'dirs': [os.path.join(self.subdir, x, 'glnxa64') for x in ['runtime', 'bin', 'sys/os']],
}
if self.version == "2016b":
Copy link
Member

Choose a reason for hiding this comment

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

better make this future proof, with:

if LooseVersion(self.version) >= LooseVersion('2016b'):

@boegel boegel added this to the 3.2.0 milestone Feb 2, 2017
@boegel
Copy link
Member

boegel commented Feb 2, 2017

@mboisson please change the target branch to develop (you can do this for open PRs now via the 'Edit' button)

@mboisson mboisson changed the base branch from master to develop February 2, 2017 21:08
@mboisson
Copy link
Contributor Author

mboisson commented Feb 2, 2017

I think I updated the pull request correctly (although I'm not sure how it happened) ? The new commit shows in the history in any case.

@boegel
Copy link
Member

boegel commented Feb 3, 2017

@mboisson looks good, thanks; you did the right thing, i.e. add a new commit to the branch you used for the PR and then push it to GitHub, which updates the PR

Can you also open a PR for an MCR easyconfig that requires this change?

@mboisson
Copy link
Contributor Author

mboisson commented Feb 3, 2017

Done. I included a couple more MCR easyconfig files as well as one Java, since MCR depends on Java and we installed an up-to-date version of Java in our software stack.

@bartoldeman
Copy link
Contributor

This change is buggy. Instead of custom_paths.append it should use custom_paths['dirs'].append.
Maxime, can you push a change? I am changing it for ComputeCanada now.

@boegel
Copy link
Member

boegel commented Feb 15, 2017

Urgh, that's my bad, serves me right for making suggestions without actually testing it myself... :)

Thanks for the notification @bartoldeman, I knew I did the right thing by not merging this into EB v3.1.0 last-minute ;)

@bartoldeman
Copy link
Contributor

There is another issue with the LooseVersion check. It should check for R2015a etc. instead of 2015a. I am debugging that now, as the code for < 2015a seems not to work.

@mboisson
Copy link
Contributor Author

Done, I think.

@mboisson
Copy link
Contributor Author

On a side note, I really should have made this PR from a custom branch....

@bartoldeman
Copy link
Contributor

I fixed the LooseVersion and regexp stuff in the top 2 commits here:
https://github.com/ComputeCanada/easybuild-easyblocks/commits/computecanada-master

re.M cannot be used directly in re.sub
(only in Python 2.7+, but only using flags=re.M there)
@mboisson
Copy link
Contributor Author

I added Bart's changes to this pull request.


config = regdest.sub("destinationFolder=%s" % self.installdir, config)
config = regagree.sub("agreeToLicense=Yes", config)
config = regmode.sub("mode=silent", config)
Copy link
Member

Choose a reason for hiding this comment

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

@bartoldeman why was this changed? compiling a regex first before using it only makes sense if you reuse the compiled regex's multiple times, which is not the case here?

Copy link
Contributor

Choose a reason for hiding this comment

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

because of re.M (=re.MULTILINE)
In python2.7 you can do re.sub(regexp,subst,string,flags=re.M) but this is impossible in python2.6. The 4th argument of re.sub is a count so for that re.M is bogus.

Copy link
Member

Choose a reason for hiding this comment

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

Hah, OK, I wasn't aware of that...

We should include a comment to clarify that, can you add something like this @mboisson?

# compile regex first since re.sub doesn't accept re.M flag for multiline regex in Python 2.6

@boegel
Copy link
Member

boegel commented Feb 16, 2017

I tested this updated MCR easyblock with all existing MCR easyconfigs, and the ones in easybuilders/easybuild-easyconfigs#4098, so good to go when the clarifying comment is included.

@mboisson
Copy link
Contributor Author

Done

@boegel
Copy link
Member

boegel commented Feb 16, 2017

Good to go, thanks @mboisson and @bartoldeman!

@boegel boegel merged commit 312aa3a into easybuilders:develop Feb 16, 2017
@boegel boegel modified the milestones: 3.2.0, 3.1.1 Feb 28, 2017
@boegel boegel removed this from the 3.2.0 milestone Feb 28, 2017
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.

None yet

3 participants