R Package Pdf Tools

0 views
Skip to first unread message

Derrick Drescher

unread,
Aug 5, 2024, 1:29:39 AM8/5/24
to tabwaiclutan
AlertOn Sat., August 28th from 8 PM to 1 AM ET on Sun., August 29th, we will perform routine maintenance on USPS Tracking. During this time, you will not be able to opt in to email or text notifications. We apologize for any inconvenience.

Alert: From midnight to 3 AM ET on Friday, July 2nd, we will perform routine maintenance on USPS Tracking. During this time, you will not be able to opt in to email or text notifications. We apologize for any inconvenience.


Get the free Informed Delivery feature to track all your incoming packages automatically with email alerts. You can also add and manage packages you've shipped using the online dashboard or app. Learn more about Informed Delivery


A future proposal should add specific support for code linters. In particular, there should be a way for build tools to convey fixits and other mechanical editing instructions to SwiftPM or to an IDE that uses libSwiftPM.


One approach would be to use the existing Clang diagnostics file format, possibly together with a library making it easy to generate such files, and to extend the PackagePlugin API to allow the plugin to configure commands to emit this information in a way that SwiftPM and IDEs can apply it. Such a capability could also be useful for build tools such as source translators, if they want to be able to apply fixits to their input files.


Code formatters (which typically modify the source code directly) should probably be supported using a new plugin capability that allows some specific action that a package author can take to run the formatter on their code, since it seems a bit subtle to allow source code to be modified as a side effect of a regular build action.


What does the process look like to get that moving? Is that something only Apple can drive, or could the community help out? These are both important tools to my team's workflow, and right now we're resorting to manual processes or relying on things being caught by CI (which has a really high latency).


I think it is just a matter of adding a plugin product to the official swift-format package (or some custom equivalent), and then reporting back to SwiftPM if you find things that you think could interact better.


Thanks for that advice. I'll follow through on it, but it doesn't really answer the original question: these were acknowledged limitations of the initial implementation of build tool plugins. I'd really like to know how I can help get the next phase of that implementation off the ground so that support for these tools can be added.


Command plugins appear to be useful for extraneous steps like packaging. You could certainly run formatting and linting outside of a build, but the linting in particular becomes a lot less useful if it's not happening (and being reported) during the build (or pre-build).


New capabilities may focus on specific areas of functionality, such as source code formatters or linters, new types of unit tests, or actions that can be invoked on-demand to perform particular tasks.


I did try creating a lint plugin as a build tool, but due to some bugs with the plugin implementation in Xcode 13.3 beta 1 I couldn't get it working (it may have been fixed since then). I think build tool output also isn't displayed in Xcode which is another roadblock (especially for linters).


I did however manage to get SwiftLint working as a basic command plugin for now as a compromise (swift-lint-plugin). Which is definitely still useful because it doesn't require contributors to have SwiftLint installed and allows it to easily be added as a pre-commit hook.


I couldn't get either of them working as build tools (I couldn't even get a simple hello world build tool plugin working in the Swift version that shipped with Xcode 13.3 beta 1, I'll try updating to beta 3 because iirc the Swift version it has fixes a few plugin issues).


I can, but that's not the point of my post. The lacking implementation right now seems to only be that there's no way to report messages, warnings and errors back from a build/prebuild step to SwiftPM (or Xcode) from a called tool like SwiftLint. I've filed that as FB9937439, and this was proposed as a future direction in SE-0303: Specific Support for Code Linters and Formatters.


Thanks for following up on the issues you found and getting SR's for them. Hopefully they get fixed soon . I'll get the latest Swift snapshot and see whether I can find any more issues preventing a basic build tool from being built on my end.


It would definitely be very nice to have a mechanism for linters/formatters to emit fixits that IDEs can display and action. I agree that the current plugin API doesn't have the right functionality to create a linter/formatter plugin. Is the main issue (other than bugs) not being able to emit diagnostics and fixits? If so, do you want to create a specific pre-pitch for that? I'd be happy to if you don't want to/don't have time or something


Yes, that's the functionality I'd most like to see added. I really need to work on my communication skills, because all I wanted was advice on how to get the process started (with some understandable rationalisation of my understanding) - sounds like a pre-pitch is the right way?


I recommend building SwiftPM from source instead when you tinker. (See my earlier comment for instructions.) There have been a lot of relevant patches lately, including for some of the SRs that have been mentioned here. You might also consider looking at the open PRs and merging any relevant ones into your working branch, even if they are still on their way through review.


You can make it Now that I think about it, it might even make sense to just start it as a regular pitch because it doesn't seem like a super contentious issue, and it's a very specific and achievable feature/goal.


I think the diagnostics reporting is exactly what's missing as far as linting is concerned. The initial support for build plugins focused on generating source code (and resources, though there seem to be a bug with output file handling which Tony referenced). At the time of the plugin proposal there was good discussion about how to represent diagnostics but to get a start at this and keep things somewhat bounded, that had to be deferred. So the main thing preventing good support for linting should be reporting of errors and especially fixits. As a next step, a pitch with ideas about the best way for the plugin to convey that to the plugin host (SwiftPM or an IDE) would be great. The structured-diagnostics file that the Swift compiler generates already has that information, but the missing piece is conveying that to the host.


Separately: with SwiftLint in particular there seems to be an issue with sandboxing that causes an error even when trying to run it, but this seems to be a bug and not something that would require additional API. It looks like SwiftLint is doing XPC calls that are getting blocked.


I think it is just a matter of adding a plugin product to the official swift-format package (or some custom equivalent), and then reporting back to SwiftPM if you find things that you think could interact better.

I suspect the only reason no one has done so yet is that the plugin feature is newer than the latest stable release of the toolchain. For now you would have to use a snapshot instead of a release.


given that swift 5.10 has not been released yet, i found it odd that this package no longer supports any extant versions of swift. what was the rationale behind dropping support for 5.9?


That's an excellent question. swift-testing is an experimental package that relies on language and toolchain features that aren't available in Swift 5.9. The changes that we've made to Swift Package Manager to experimentally support swift-testing are not available in Swift 5.10 or earlier.


We use semantic versioning with our releases. Releases prior to 1.0 should be considered "unstable" with all aspects subject to change. In the case of swift-testing, this includes the minimum Swift version needed to use it.


We continue to include basic support for Swift 5.10 at this time because we recognize that not all developers are able to switch to Swift's unstable main branch just to use swift-testing. There are features in Swift 5.11 such as SwiftPM's GitInformation structure and the proposed low-level linkage control that we are adopting or looking to adopt. Because we'll be relying on these features, a minimum Swift version of 5.11 will be necessary in the near future.


We're aware SPI (and Swiftinit!) isn't able to produce documentation for swift-testing 0.4.0 right now. We view this as a temporary issue: the Swift project has branched for 5.10 and once the 5.10 toolchain is officially released, it's fair to expect Swift Package Index to start supporting it in short order.


To work with NuGet as a package consumer or creator, you can use command-line interface (CLI) tools and NuGet features in Visual Studio. This article briefly outlines the capabilities of the different tools, how to install them, and their comparative feature availability.


The most recent version of NuGet.exe is fully supported and can be relied on for bug fixes, updates, and enhancements.For more information on NuGet.exe's support policy, see the Microsoft Modern Lifecycle Policy.


You can also install the Package Manager separately or verify your installation. Run the Visual Studio installer and check the option setting under Individual Components > Code tools > NuGet package manager. For more information, see Install and manage packages in Visual Studio by using the NuGet Package Manager.


You can use either the dotnet CLI or the nuget.exe CLI to support NuGet features in the Visual Studio IDE. The dotnet CLI is installed with some Visual Studio workloads, such as .NET Core. The nuget.exe CLI must be installed separately as described earlier. For a feature comparison of the tools, see the feature availability section.

3a8082e126
Reply all
Reply to author
Forward
0 new messages