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 start_dir easyconfig template #4035

Closed

Conversation

jfgrimm
Copy link
Member

@jfgrimm jfgrimm commented Jun 29, 2022

(created using eb --new-pr)

@ocaisa
Copy link
Member

ocaisa commented Jun 29, 2022

This looks ok but can you please add a test, for example in https://github.com/easybuilders/easybuild-framework/blob/develop/test/framework/easyconfig.py#L508

@jfgrimm
Copy link
Member Author

jfgrimm commented Jun 29, 2022

@ocaisa I'll take a look
trying it out atm, and it %(srcdir)s seems to always be None, even in CMakeMake easyconfigs

@ocaisa
Copy link
Member

ocaisa commented Jun 29, 2022

Actually yeah, that makes sense, for each source you would have a diffent source directory so there's no unique property that you can reference there (https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/framework/easyblock.py#L2434)

Co-authored-by: ocaisa <alan.ocais@cecam.org>
@jfgrimm jfgrimm changed the title add support for srcdir, start_dir easyconfig templates add support for start_dir easyconfig template Jun 29, 2022
@boegelbot
Copy link

@jfgrimm: Tests failed in GitHub Actions, see https://github.com/easybuilders/easybuild-framework/actions/runs/2584118547
Output from first failing test suite run:

FAIL: test_extensions_templates (test.framework.easyconfig.EasyConfigTest)
Test whether templates used in exts_list are resolved properly.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/runner/44f93df33480809f6490d71bb8106bdd7b7962d9/lib/python2.7/site-packages/test/framework/easyconfig.py", line 579, in test_extensions_templates
    self.assertEqual(toy_ext.options, expected)
  File "/tmp/runner/44f93df33480809f6490d71bb8106bdd7b7962d9/lib/python2.7/site-packages/easybuild/base/testing.py", line 116, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: {'prebuildopts': 'gcc -O2 toy.c -o toy-0.0 && mv toy-0.0 toy # echo installdir i [truncated]... != {'prebuildopts': 'gcc -O2 toy.c -o toy-0.0 && mv toy-0.0 toy # echo installdir i [truncated]...
  {'patches': ['toy-0.0_fix-silly-typo-in-printf-statement.patch'],
-  'prebuildopts': 'gcc -O2 toy.c -o toy-0.0 && mv toy-0.0 toy # echo installdir is /tmp/eb-SCg0vl/eb-1OLfmr/eb-MSDW6y/tmp3mLjlj/software/pi/3.14-test, start_dir is None #',
?                                                                                                                                                                    ^^^^

+  'prebuildopts': 'gcc -O2 toy.c -o toy-0.0 && mv toy-0.0 toy # echo installdir is /tmp/eb-SCg0vl/eb-1OLfmr/eb-MSDW6y/tmp3mLjlj/software/pi/3.14-test, start_dir is /tmp/eb-SCg0vl/eb-1OLfmr/eb-MSDW6y/tmpTRA26J #',
?                                                                                                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

   'source_tmpl': 'toy-0.0-py3-test.tar.gz',
   'source_urls': ['https://pypi.python.org/packages/source/t/toy']}:
DIFF:
  {'patches': ['toy-0.0_fix-silly-typo-in-printf-statement.patch'],
-  'prebuildopts': 'gcc -O2 toy.c -o toy-0.0 && mv toy-0.0 toy # echo installdir is /tmp/eb-SCg0vl/eb-1OLfmr/eb-MSDW6y/tmp3mLjlj/software/pi/3.14-test, start_dir is None #',
?                                                                                                                                                                    ^^^^
+  'prebuildopts': 'gcc -O2 toy.c -o toy-0.0 && mv toy-0.0 toy # echo installdir is /tmp/eb-SCg0vl/eb-1OLfmr/eb-MSDW6y/tmp3mLjlj/software/pi/3.14-test, start_dir is /tmp/eb-SCg0vl/eb-1OLfmr/eb-MSDW6y/tmpTRA26J #',
?                                                                                                                                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   'source_tmpl': 'toy-0.0-py3-test.tar.gz',


----------------------------------------------------------------------
Ran 811 tests in 918.175s

FAILED (failures=1)
ERROR: Not all tests were successful.

bleep, bloop, I'm just a bot (boegelbot v20200716.01)
Please talk to my owner @boegel if you notice you me acting stupid),
or submit a pull request to https://github.com/boegel/boegelbot fix the problem.

@ocaisa
Copy link
Member

ocaisa commented Jun 30, 2022

It looks like start_dir is not going to work either since that isn't typically known until the prepare_step (which calls https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/framework/easyblock.py#L1976)

@boegel
Copy link
Member

boegel commented Jul 4, 2022

It's OK if %(start_dir)s can only be resolved after some step (like prepare), since that's also the case of other templates like %(pyver)s

@boegel
Copy link
Member

boegel commented Apr 12, 2023

superseded by #4073, so closing...

@boegel boegel closed this Apr 12, 2023
@jfgrimm jfgrimm deleted the 20220629142306_new_pr_ERickCQyjp branch April 12, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants