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.

Checking out custom libraries

See original GitHub issue

Motivation

All too often, I copy my code to Compiler Explorer, only to realise I’m not compiling with Standard headers. I often end up with dummy code like this:

namespace ranges {
   using std::move;
} // namespace ranges

This works for simple things, but full libraries are quite difficult to import. Consider Asio, Boost, Ranges TS, etc.

Proposal

It’d be great if we could checkout our own libraries via a textbox. Here’s what I envision:

git https://github.com/Microsoft/GSL # master branch checked out by default
git https://github.com/cjdb/cmcstl2 numerics # numeric branch checked out

It’d then be possible to compile with GSL and Ranges TS without needing to make a feature request for library X, every time something novel comes around.

How it’d work (if it is local)

for each url:
   git clone $url
   git checkout $branch
<compile line> -I <dir1> -I <dir2> ...
for each url
   sudo rm -rf <end of url>

Concerns

Obviously, this is a terrible idea for anyone that’s remote. The input needs to be sanitised, and we’d need to make sure that it isn’t abused (e.g. if someone decided to checkout GCC or LLVM, the amount of space required would be enormous).

I also don’t (yet) have a solid grasp for how Compiler Explorer actually works on a technical level, so the above functionality is all speculative.

Extensions

  1. For now, I think Git would be a good starting point to see if and how it works, but I’d like to see support for Subversion and Mercurial at some point.
  2. Caching would be a good idea for the most popular repositories and branches: something that’s frequently used (e.g. Boost, GSL, etc.) might benefit from being stored permanently to reduce system load with respect to downloads and removal. This is purely speculation at this point.

Contacts

@mattjegan is a developer with a keen interest in security. Perhaps you might like to follow this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
mattgodboltcommented, May 19, 2017

Hi @simonvpe that’s already possible… sort of ( https://godbolt.org/g/dDKkA5 ) . CE supports #include-ing github permalink URLs. But the issue is following the include that the GH link brings in: I don’t want to implement a full preprocessor which is what would be needed in order to resolve those.

1reaction
sivaraamcommented, Sep 13, 2017

@mattgodbolt I addded information about the ability to #include a GH permalink on the wiki page. If my guess is correct you can #include any URL that points to a header file. I wasn’t sure of that though. If that’s the case the Wiki page should be updated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checking out custom libraries · Issue #421 · compiler-explorer ...
This works for simple things, but full libraries are quite difficult to import. Consider Asio, Boost, Ranges TS, etc.
Read more >
Rethinking Your Classroom Library: A Checkout System Worth ...
Organize your classroom library with this free classroom library checkout system! No more missing books in your 3rd, 4th, or 5th grade classroom....
Read more >
Meescan – Library Self-Checkout
Meescan self-checkout. Frees up space in your library. Frees up time in your day. · Who uses Meescan? · What libraries are saying...
Read more >
Self Servicing Library & Book Kiosks | imageHOLDERS
Make book borrowing simple with imageHOLDERS library and book kiosks. Find out more about our time and cost-saving library self-checkout kiosk solutions.
Read more >
Check out or check in files in a document library
Open the library with the file you want to check out, select the file, click the ellipses (...) in the tool bar, and...
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