Comments (3)
Looks great, thanks @EvanCarroll! I was looking into something similar for Docker. I recently got the following gist from @tyrrminal https://gist.github.com/tyrrminal/ca546fd61bf8414dbeb3b49fbc0ed881 . He used a shell script as the perlNavigator.perlPath
with a pre-constructed docker command to enable use in a container. It doesn't mount the paths from %INC as yours does, but I think the purpose was slightly different. @tyrrminal develops using a standardized container from $work with his dependencies and wanted to use that container with the Navigator (and possibly varying per workspace). The container-perl seems like it allows the recreation of a local environment in a container for the purposes of secure compilation. Both are cool usages of containers; it could be worth supporting all the different cases.
Thinking out loud here, perhaps the settings are something like:
containerName: foo
: "exec" perl -c in pre-existing and currently running container foo (easiest option to support).
containerImage: bar
: "run" perl -c in new temporary container built from image Bar. Option is mutually exclusive with containerName
containerEngine: <str: docker or podman>
:
containerIncreplace: <boolean: default False>
: Map all of %INC into container using libReplace
containerMapIncPaths: <boolean: default True>
: Mount all paths from perlNavigator.incPaths into container.
containerMountPaths: <array>
: Additional paths to mount in container (but not added to %INC).
from perlnavigator.
Well, the idea here is for the purpose of syntax checking and less XS-incompatibilities you shouldn't /need/ a custom container. That is to say,
- if you have dependencies on your development machine, you should be able to just map them in. There is nothing that I can think of that wouldn't work with this method less XS-dependencies which shouldn't make a difference for the purposes of
perl -c
. - if you don't have the dependencies on your development machine, I think that's a different problem entirely. The obvious solution there is simply to install them. I agree we can support this, but it's not really the job of the LSP-client to support this. While it's normal to distribute an application to end user in an image for launch in a container, if a developer asks for your dependencies and you ask them to develop in a container that's a bit awkward. Normally containerization isn't used like that. I would want to know more about the use case here. What kind of dependencies does your code place on perl such that
perl -c
will execute different in one environment without them.
Also from that script above, it seems they still do what I'm doing except they're a bit less rigorous,
-v "${HOME}/srv/perl5/lib/perl5:/development/perl5/linting" `# Link local::lib with just Perl::Tidy and Perl::Critic into container` \
The container-perl
method will catch everything in @inc. Not just local::lib
under that configuration.
As for docker
and podman
, they're fully API compliant. We can replace podman
with docker
, if you don't have podman
. But it's fully available for Windows. On Linux however, it's just a superior piece of technology with full rootless support (so nothing has to run as root).
from perlnavigator.
Thanks! Personally, I don't use containers much, but I've seen the request before for developing in them. For example, in the other Perl Language Servers, there have been a few people asking for similar functionality: https://github.com/richterger/Perl-LanguageServer/search?q=docker&type=issues
https://github.com/FractalBoy/perl-language-server/search?q=docker&type=issues
vscode provides some support for developing inside containers (including using podman): https://code.visualstudio.com/docs/remote/containers , and this will run a vscode server within the container. Perl Navigator should work automatically in this scenario, as it gets installed inside the container. However, this is pretty heavy-handed, and only applies to vscode, not any other editors.
Overall I agree with you that container-perl
would cover a much broader set of applications for all editors. I'm happy to help out if you want to bounce ideas off anyone, but you're already off to a great start. Thanks again!
from perlnavigator.
Related Issues (20)
- Provide Error Message on Settings Configuration
- Attempted to run perlimports lint: Error: Command failed HOT 6
- Outline does not work in some cases
- Add $workspaceFolder variable expansion to perltidyProfile setting HOT 1
- Object recognition, Autocomplete, and subroutine navigation not working HOT 11
- Automatically detect additional workspace HOT 4
- Instructions for use in Emacs Eglot HOT 4
- Add ability to set perlcritic --theme EXPRESSION HOT 3
- Ease support of remote environments HOT 6
- Just a hint: Changelog HOT 1
- Neovim configuration problem with includePaths HOT 1
- Using Object::Pad and perlcritic HOT 11
- How to display debug output from navigator? HOT 2
- How to add unit tests for criticWrapperl.pl ? HOT 2
- help at getting perlnavigator working HOT 11
- navigator fails to find modules in lib/perl5/x86_64-linux/ HOT 3
- Add find references
- TPRC 2023 Hackathon HOT 2
- More Sublime Text experience from anyone? HOT 8
- Errors contain aboslute path to affected file HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perlnavigator.