Comments (6)
I was thinking on maybe making the crawler in a bash script and then integrating it into swiftenv, how does that sound?
That's what I meant. I am not sure if I want swiftenv to change my projects. It can do just one thing, but it does it incredibly well.
I think the best solutions are:
- ruby/python/swift script that genereates SPM compatible output on linux
- Fixing
Foundation.FileHandle
andFoundation.FileManager
OT: I don't like bash
programming for more advanced tasks either. That's why I usually write some Swift scripts using marathon and beak. I have used fish
, too. But I switched to zsh
as it is more compatible with bash
. And mostly because of oh-my-zsh
.
from awesome-system-swift.
I am not sure if I want swiftenv to change my projects. It can do just one thing, but it does it incredibly well.
That's a fair point. I think it's better to keep the functionalities separate, specially given how important is the work that swiftenv
already does (in Linux it has simplified my workflow by a huge amount).
ruby/python/swift script that genereates SPM compatible output on linux
I think I'm gonna finish my python script then and we'll see where do we go from there. I plan on having a working prototype tomorrow.
Fixing Foundation.FileHandle and Foundation.FileManager
Yeah, that'd be the best option long-term. I've sent a DM to Tony Parker from the corelibs team asking about how can I help. Specifically, what does one need in order to make an effective PR.
Since that part of Foundation provides OS level functionality, and the corelibs-foundation
isn't a SPM project, I've kept myself from trying to make a PR... it seems to be very non-trivial to me. Specially after seeing Ryan struggle with the one he's tried to make.
My fingers itch. I want to help but I don't know how.
I guess not seeing a roadmap only makes it worse š
But I switched to zsh as it is more compatible with bash. And mostly because of oh-my-zsh.
Oh, nice. I'll take a look :)
from awesome-system-swift.
I've also posted a new digging through SPM on the forums, asking for a community push on this issue.
I was wrong, I think. It's not corelibs-foundation
that's missing functionality, but something else. I don't know what it is, but I've pointed out what lines seem to be behind it.
My gut feeling is that those lines are using ObjC runtime tools or something like that. But I've also given arguments about why today you can add test discovery functionality to SPM without needing anything other than Swift and SourceKit. Let's hope it works.
from awesome-system-swift.
Ideally generating the LinuxMain.swift shall be possible on Linux directly as it makes a huge difference during development. Though Iād prefer Swift, especially as installing pip on macOS is a pain.
Generating the LinuxMain on macOS on CI and copying it over to the Linux build is not possible AFAIK. Some other ideas on this:
- macOS Build commits new LinuxMain when changed and pushes to the repo: highly CI specific and kind of hacky
- Test Linux on macOS using https://github.com/iainsmith/swift-docker. Wait. What? š
Regarding integrating this into different tools: swiftenv
is probably the wrong tool for this. Maybe this fits into jakeheis/ice or https://github.com/iainsmith/swift-docker.
from awesome-system-swift.
Ideally generating the LinuxMain.swift shall be possible on Linux directly as it makes a huge difference during development
Yes! According to my digging through SPM's source, the one and only thing that's stopping it from discovering tests automatically on Linux (and thus, the ability to generate something like the LinuxMain.swift
file) is unimplemented functionality in Foundation.FileHandle
and Foundation.FileManager
.
Generating the LinuxMain on macOS on CI and copying it over to the Linux build is not possible AFAIK
Dang it, I was hoping there was a way, but if you say it can't be done through CI then you're probably right.
swiftenv is probably the wrong tool for this
Sorry, I should've explained my idea before just posting it like that š
I was thinking on maybe making the crawler in a bash
script and then integrating it into swiftenv
, how does that sound?
Edit: I would also first try to make it work in Python, because bash
programming is a pain in the ass š (I use fish
because of that reason, among others š. Speaking of which, you use zsh
right? How is it?)
from awesome-system-swift.
I think I'm gonna finish my python script then and we'll see where do we go from there. I plan on having a working prototype tomorrow.
In the end, I'm going to try something more sophisticated. This is what happened:
- I was making the regex-based python crawler.
- Decided that SwiftSyntax was a better alternative
- Asked Harlan (Haskins) about it
- He convinced me that anything syntax-based (like regexes or SwiftSyntax) was too fragile, because of inheritance and inter-file interactions like extensions.
In the end, we need something that knows about semantics. So, I've changed my focus and now I'm learning how to use SourceKitten š
And indeed, you were right about Sourcery. A binary of Sourcery is all that we'd need, since they already have a stencil template that synthesizes the LinuxMain file. So an alternative is making Sourcery compile under Linux, even if that means restricting its runtime features, as mentioned here. As long as it can parse code and run Stencil templates, that's good enough.
I'm seeing how far can I go with SourceKitten; if it proves too complex I'll switch gears and try making Sourcery compile.
from awesome-system-swift.
Related Issues (11)
- Why a Table is a good idea HOT 3
- Thoughts on Workspace? HOT 2
- Checklist for new Projects HOT 5
- Good finds HOT 3
- New "why testing" explanation HOT 6
- Include GeoFeatures2 after Release
- Include StickyLocking after Release
- Does TraceLog belong to a specific category? HOT 4
- On Continuous Integration HOT 8
- On swiftenv and tools that help you setup your Swift environment HOT 3
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 awesome-system-swift.