-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any idea how to integrate GDC? #35
Comments
The main blocker is having prebuilt GDC packages, like LDC and DMD provide. IMO this should be done upstream either by the @D-Programming-GDC or @dlang organizations. That said, technically nothing prevents someone for setting up a GitHub Action pipeline here that would do the same. Here's a starting point for a CI pipeline: https://github.com/D-Programming-GDC/gcc/blob/5ff6ab4f88164b4c8939a8780da42dc39bd2a7ff/.semaphore/semaphore.yml#L1 |
Thanks. Maybe I'm being stupid: is there maybe a way to just invocate |
If you are fine with any version and only interested in Linux, literally running For setup-dlang there both needs to be some way to switch between version and support for all of Win-Linux-MacOS triplet. It should be possible to do, probably with some enhancements to GDC own CI, but it is a fair bit of work, much more than was needed for dmd/ldc, so it was not originally implemented. |
Fine! Thanks :) |
I think it would be better to keep this ticket open - both because it is a necessary feature request and because the same question is likely to come up again. I can create a new one if you prefer of course. |
We could just mention in the README how to use GDC. |
Do you have any best practice suggestions? (other than |
But installing dub or ldc removes GDC: So I haven't found a way to support GDC properly... Any idea? Would need both DUB and GDC ideally. |
It may be a time to ask @ibuclaw for suggestions :) |
Mmmm, I follow the suggestions in the debian thread and install DUB from Github instead. This file allows to name: gdc
on: [push, pull_request]
jobs:
test:
name: Dub Tests
strategy:
matrix:
os: [ubuntu-20.04]
dc:
- ldc-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}
- name: Install DUB
run: |
wget https://github.com/dlang/dub/releases/download/v1.23.0/dub-v1.23.0-linux-x86_64.tar.gz
tar xvf dub-v1.23.0-linux-x86_64.tar.gz
- name: Install libcurl
run: sudo apt install libcurl4-gnutls-dev
- name: Install GDC
run: sudo apt install gdc
- name: Vanilla unittest
run: ./dub test -a x86_64 --compiler gdc -v Not optimal but works for this single purpose. |
I only see that the package maintainers have shot themselves in both feet.
|
I was able to use gdc on ubuntu-latest with this change: mbierlee/poodinis@6e25ca7 essentially you need something like: jobs:
# On Ubuntu we can use GDC (so keep working for D version 2.076)
gdc-latest:
name: GDC on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install DMD (so dub is available)
uses: dlang-community/setup-dlang@v1
with:
compiler: dmd-latest
- name: Install GDC
run: |
sudo apt-get update
sudo apt-get install gdc -y
gdc --version
- name: Build library
env:
DC: gdc
run: dub build --compiler=gdc --build=release |
FWIW I can test both GDC 10 and GDC 12 in GH actions: https://github.com/AuburnSounds/intel-intrinsics/tree/master/.github/workflows |
Likewise: dlang/dub#2324 |
Can it be as simple as this? - name: Install D compiler
uses: dlang-community/setup-dlang@v1
with:
compiler: gdc-latest |
This won't work currently. But yes, it would be good to make it work. |
Unrelated? The godbolt DMD compiler are a bit old. I don't think you can test on the newest DMD. |
As I see in compiler.ts, it's a matter of figuring out the URL for a specific GDC version, isn't it?. Is there an issue with this? |
updated example for multiple gdc versions:
|
Just ran into this... Any help would be appreciated: dlang/undeaD#56 |
SingingBush's example is the current way how to do it. We don't have it in setup-dlang yet because it isn't supported on platforms other than ubuntu-2022. What we could do is just running |
OK, so given that I already have a matrix of oses and compilers, how do I skip the invalid combinations? Or do I just make a new yml file? |
you can use |
What's about adding configuration? matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dc: [dmd-latest, ldc-latest]
include:
- os: ubuntu-latest
dc: gdc-latest |
you need to separate the installation step like for example D-Scanner does it then: https://github.com/dlang-community/D-Scanner/blob/5a53c538d0aa832f03840840271b6631fbbfc53d/.github/workflows/default.yml#L78-L89 |
where does DC get defined? I got the workflow running, it installs gdc (and dub from dmd), and then runs dub with dmd, because apparently DC is set to dmd. |
oh yeah setup-dlang sets DC - you can manually set it (it's just an environment variable) - or use it to only install dub. |
will setup-dlang set DC if I set it first? (hoping it doesn't) |
yes, it does so here: Line 64 in 43589c2
|
Can setup-dlang take care of this? Even if it's restricted to ubuntu only, this would be very helpful. |
So the way I had to do this kinda sucks: https://github.com/dlang/undeaD/blob/d9a6eaad18e5c64bf36609158f1c257f1162c071/.github/workflows/main.yml I'd like to do it better, or have some of this taken care of without so many manual if conditions. Almost think it would have been better to run a separate task. But it did work! |
I think this was the original reasoning: I wanted to be able to just specify platform/compiler/version matrix and have things "just work". As GDC was (and looks like still is) only available through a distro package install, it was not fitting that pattern. What if you want to test a different GDC version? So I ended up embracing laziness as a virtue and just ignored the whole thing in a hope things will become more obvious to some point. Which clearly has not happened :) Saved me from a headache though. tl; dr is "yes, setup-dlang absolutely can take care of this but maybe it can also do better and the right thing is not 100% obvious for GDC". |
Yeah, we really should make this work seamlessly. Especially as gdc has now joined the other compilers into the post-2.076 front end realm. People will expect to be able to test against various gdc releases. What pre-built artifacts are there for gdc? Is there a way we can host them? I know windows is a specific problem, as there is no pre-built binaries that people maintain. downloads.dlang.org should probably be doing it. @ibuclaw is there a way we can fit this into the release process for gdc/dmd? |
https://gdcproject.org/downloads#binary-releases implies this was an intentional decision to stop providing binaries, although it is not clear if motivation was to reduce CI load or @ibuclaw simply wanted it to be this way. |
let's just implement it internally by doing |
Using a recent GDC would be a boon to our linux testing. Any idea how to do it?
The text was updated successfully, but these errors were encountered: