question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Easy file-tests macros

See original GitHub issue

Some ideas for easier writing tests. Currently people do stuff like

- test -f $PREFIX/include/mamba/test.hpp  # [unix]
- if not %LIBRARY_PREFIX%\include\mamba\test.hpp exit 1 # [win]

which is super error prone and hard to get right.

Ideas for “files” macros:

  • site-packages("mamba") -> checks that pythonX.X/site-packages/<mamba> exists and has contents (at least one init.py)
  • pymodule("mamba") -> checks that pythonX.X/site-packages/<mamba> exists and has contents (at least one init.py)
  • lib("libmamba", soversion="...") -> check that at least libmamba.so / libamamba.dylib is found in lib/, additionally check for so-versions that link to that, or for windows, check that bin/libmamba.dll and lib/libmamba.lib are there
  • include("mamba") -> check that include folder include/mamba/ exists
  • include("mamba/test.hpp") -> check that file include/mamba/test.hpp` exists in package
  • `bin(“mamba”)

I am unsure about the following ones:

  • cmake_find("mamba") -> make sure that find_package(“mamba”) would work
  • pkgconfig("mamba") -> make sure that pkgconfig mamba works

There are probably some good ideas to support other languages and their install prefixes. I don’t know where R installs to?!

We can also use qualifiers to disallow any files outside those matched by the macros, except maybe files in /share or some other data-centric directory. That would give pretty strict control over the package content.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
mariusvniekerkcommented, Nov 20, 2020

We probably want to express this as something like

- exists:
    site-packages: 
      - mamba
    pymodule:
      - mamba
    file:
       - $LIBRARY_PREFIX/some/file
    glob:
      - "**/another/file"

This has the nice advantage that we can include it easily in our json schema and get completions / validations at the json schema level for correctness of the specifiction

1reaction
wolfvcommented, Nov 21, 2020

One other lint we could do when we have a more semantic way of testing for a shared library is to automatically strongly warn if there is no run-exports.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simply Macros - Moxie by Lindsey
The ingredient list is broken down into four categories: carbs, protein, fat, and FLAVOR! And each recipe is complete with tips, tricks, and...
Read more >
Nine Rules for Creating Procedural Macros in Rust
While creating anyinput , I learned nine rules that can help you easily create procedure macros in Rust. The rules are:.
Read more >
Read a file and store its contents in a variable - TeX
I'm not sure what the right way to do this with the LaTeX macros like \IfFileExists , but using the low-level TeX primitives...
Read more >
Laravel Tip: 5 examples of why you should be using Macros
Then in the new macro file tests/macros.php file we can add the following. Now we can use it our tests. It's a very...
Read more >
Load macro with TWIG - php - Stack Overflow
I installed TWIG in my project but I can't load my macro, I would like to create a file tests (For example testmacro.twig)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found