Skip to content

Conversation

PetarKirov
Copy link
Owner

  • config(git): Ignore ci-matrix artifacts
  • refactor(pkgs/*/): Delete obsolete files

Copy link
Collaborator

@dukc dukc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good refactoring, although it unfortunately will have some merge conflicts with my LDC bootstrap PR. Apart from the question of merge conflicts, LGTM.

@dukc
Copy link
Collaborator

dukc commented Mar 14, 2024

ping @PetarKirov what's the status on this?

PetarKirov added 5 commits May 4, 2024 18:48
Given a D compiler derivation it returns attrset with information about it:

```nix
getDCInfo flake.packages.x86_64-linux.ldc-binary-1_19_0
=> {
  dmdWrapper = "/nix/store/r5lgfqaizak29kqdyqm0xswwh4v6c5pi-ldc-binary-1.19.0/bin/ldmd2";
  dmdWrapperName = "ldmd2";
  frontendVersion = "2.089.1";
  name = "ldc";
}

getDCInfo flake.packages.x86_64-linux.ldc-binary-1_34_0
=> {
  dmdWrapper = "/nix/store/5yzmbwpcp3pdyjpixa4bf6m19xwqr22i-ldc-binary-1.34.0/bin/ldmd2";
  dmdWrapperName = "ldmd2";
  frontendVersion = "2.104.1";
  name = "ldc";
}
```
The repl command starts `nix repl` with some variable bindings pre-loaded:
* `flake` - this repo's flake
* `pkgs` - the Nixpkgs instance used by the `flake`
* `lib` - `pkgs.lib`
* `utils` - this `flake`'s `lib` output

Example usage:

```
$ repl                                                                                                                                                       23.3s  15:20:19 2024-04-21 (Sun)
Welcome to Nix 2.18.1. Type :? for help.

Loading installable ''...
Added 4 variables.
utils.dc.getDCInfo p.dmd-binary-2_081_2
{
  name = "dmd";
  dmdWrapperName = "dmd";
  frontendVersion = "2.081.2";
  dmdWrapper = "/nix/store/0by13q5vp3gzahksy49f0ig3l0pphm0m-dmd-binary-2.081.2/bin/dmd";
  frontendVersionBetween = «lambda @ /nix/store/xpkyz8lw4wd7463jaqslz5lklga5y858-source/lib/dc.nix:136:9»;
}

nix-repl> utils.dc.getDCInfo p.ldc-binary-1_19_0
{
  name = "ldc";
  dmdWrapperName = "ldmd2";
  frontendVersion = "2.089.1";
  dmdWrapper = "/nix/store/r5lgfqaizak29kqdyqm0xswwh4v6c5pi-ldc-binary-1.19.0/bin/ldmd2";
  frontendVersionBetween = «lambda @ /nix/store/shpq48gdw7aadf0cz76vd8zi32dhsmj9-source/lib/dc.nix:136:9»;
}

nix-repl> utils.dc.getDCInfo p.ldc-binary-1_34_0
{
  name = "ldc";
  dmdWrapperName = "ldmd2";
  frontendVersion = "2.104.1";
  dmdWrapper = "/nix/store/5yzmbwpcp3pdyjpixa4bf6m19xwqr22i-ldc-binary-1.34.0/bin/ldmd2";
  frontendVersionBetween = «lambda @ /nix/store/qdxyn4gasfwh5i6fhi9pr8z4i8h1kg8l-source/lib/dc.nix:136:9»;
}
```
@PetarKirov PetarKirov force-pushed the refactor/pkgs branch 3 times, most recently from bccb5f7 to 8922054 Compare May 4, 2024 20:35
PetarKirov added 2 commits May 4, 2024 23:40
… versions

Fixes the following errors:

dmd> src/dmd/backend/cg.d(58): Error: delegate `dmd.backend.cg.__lambda20` cannot return type `bool[37]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/cg.d(74): Error: delegate `dmd.backend.cg.__lambda21` cannot return type `bool[37]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/cg.d(88): Error: delegate `dmd.backend.cg.__lambda22` cannot return type `ubyte[37]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/cg.d(150): Error: delegate `dmd.backend.cg.__lambda23` cannot return type `bool[37]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/var.d(269): Error: delegate `dmd.backend.var.__lambda92` cannot return type `uint[256]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/var.d(471): Error: delegate `dmd.backend.var.__lambda94` cannot return type `uint[256]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/var.d(514): Error: delegate `dmd.backend.var.__lambda95` cannot return type `ubyte[97]` because its linkage is `extern(C++)`
dmd> src/dmd/backend/var.d(550): Error: delegate `dmd.backend.var.__lambda96` cannot return type `ubyte[97]` because its linkage is `extern(C++)`
Copy link

github-actions bot commented May 5, 2024

Thanks for your Pull Request!

Below you will find a summary of the cachix status of each package, for each supported platform.

package x86_64-linux x86_64-darwin aarch64-darwin
dmd ✅ cached ✅ cached 🚫 not supported
dmd-2_092_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_096_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_098_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_100_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_102_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_103_1 ✅ cached ✅ cached 🚫 not supported
dmd-2_104_2 ✅ cached ✅ cached 🚫 not supported
dmd-2_105_2 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_079_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_080_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_081_2 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_082_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_083_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_084_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_085_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_086_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_087_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_088_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_089_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_090_1 ✅ cached ✅ cached 🚫 not supported
dmd-binary-2_098_0 ✅ cached ✅ cached 🚫 not supported
dmd-bootstrap ✅ cached ✅ cached 🚫 not supported
dub ✅ cached ✅ cached ✅ cached
dub-1_30_0 ✅ cached ✅ cached ✅ cached
ldc ✅ cached 🚧 known to fail (disabled) 🚧 known to fail (disabled)
ldc-1_30_0 ✅ cached 🚧 known to fail (disabled) 🚧 known to fail (disabled)
ldc-binary-1_19_0 ✅ cached ✅ cached 🚫 not supported
ldc-binary-1_25_0 ✅ cached ✅ cached ✅ cached
ldc-binary-1_28_0 ✅ cached ✅ cached ✅ cached
ldc-binary-1_32_1 ✅ cached ✅ cached ✅ cached
ldc-binary-1_34_0 ✅ cached ✅ cached ✅ cached
ldc-bootstrap ✅ cached ✅ cached ✅ cached

@PetarKirov
Copy link
Owner Author

PetarKirov commented May 5, 2024

ping @PetarKirov what's the status on this?

@dukc

It turns out that using a newer version of LDC to compile older versions of DMD is way harder than I imagined. There were some things that are expected, like older DMD versions using deprecated features (classes + alias this, warnings for unreachable code or delegates returning static arrays in extern (C++): blocks), which I was able to fix by:

With these changes, I was able to successfully build with LDC 1.34.0 binary the following versions:

  • dmd-2_100_2
  • dmd-2_102_2
  • dmd-2_103_1
  • dmd-2_104_2
  • dmd-2_105_2

However dmd-2_092_1, dmd-2_096_1, dmd-2_098_1 fail to build with some extremely cryptic errors... dmd does compile, however druntime fails to build with errors like

src/core/time.d(1882): Error: incompatible types for array comparison: string and string

CI link.

In the end, I got tired of making LDC 1.34.0 work as bootstrap compiler and reverter to 1.25.0, which is what your PR used.

I also tried using other LDC version I got the following results:

  • 1.25.0 ✔️
  • 1.28.0 ✔️
  • 1.32.1 ❌
  • 1.34.0 ❌

@PetarKirov PetarKirov enabled auto-merge (rebase) May 5, 2024 14:00
@PetarKirov
Copy link
Owner Author

I'm going ahead with merging this PR as I'd also like to take care of #66 and #55.
That said, I'd appreciate if you have time to review this PR after that - I'll try to address your comments in a future PR.

@PetarKirov PetarKirov merged commit b1c852e into main May 5, 2024
@PetarKirov PetarKirov deleted the refactor/pkgs branch May 5, 2024 14:19
PetarKirov added a commit that referenced this pull request May 5, 2024
PetarKirov added a commit that referenced this pull request May 5, 2024
PetarKirov added a commit that referenced this pull request May 5, 2024
PetarKirov added a commit that referenced this pull request May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants