Skip to content
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

ldc: 1.17.0 -> 1.20.1 #85488

Merged
merged 3 commits into from Apr 20, 2020
Merged

ldc: 1.17.0 -> 1.20.1 #85488

merged 3 commits into from Apr 20, 2020

Conversation

lionello
Copy link
Contributor

@lionello lionello commented Apr 18, 2020

Motivation for this change

Current ldc uses an extremely old version of ldc 0.x to bootstrap the latest ldc 1.x, causing more and more issues as the gap between the two versions widens.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@ThomasMader ThomasMader left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this!

pkgs/development/compilers/ldc/generic.nix Outdated Show resolved Hide resolved
@@ -0,0 +1,10 @@
{ callPackage }:
callPackage ./binary.nix {
version = "1.19.0";
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a specific reason why the previous version is used for bootstrapping?
I can think of no technical reason but it would make it even easier if the same version is used for bootstrapping.
This way only one version specifier needs to exist.

@@ -4554,6 +4554,7 @@ in

lalezar-fonts = callPackage ../data/fonts/lalezar-fonts { };

ldcBootstrap = callPackage ../development/compilers/ldc/bootstrap.nix { };
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if it is good to provide the bootstrap package this way.
It should not be available to the outside because it is not a "nice" package but a hackish one and is only needed for building the real package which provides the same functionality.
I can only imagine a testing scenario where having the bootstrap package available that way but this is highly speculative as I don't have a concrete example.
Even if such an example could be found it's for sure quite rare and can be added by a developer temporarily without polluting the namespace.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, ldcBootstrap is an implementation detail that shouldn't be exposed.

Copy link
Member

Choose a reason for hiding this comment

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

Could advertise it as ldc_bin or ldc.bootstrap, probably.

In any case, it should be exposed in some way, otherwise how one can override it.

Copy link
Contributor

Choose a reason for hiding this comment

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

@veprbl What do you mean?

It could simply be done by calling binary.nix directly from generic.nix like it was done in the previous solution [1].
This way bootstrap.nix and ldcBootstrap in all-packages.nix would not be necessary any more.

[1] https://github.com/NixOS/nixpkgs/blob/19.09/pkgs/development/compilers/ldc/default.nix#L13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

Copy link
Member

Choose a reason for hiding this comment

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

@ThomasMader If I need to override bootstrap ldc in an overlay, how do I do that?

Copy link
Contributor

Choose a reason for hiding this comment

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

@veprbl I see, @lionello already solved it by using callPackage as the default parameter like this -> ldcBootstrap ? callPackage ./bootstrap.nix { }

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this looks better. It would also help if the original bootstrap value was exposed. e.g. add passthru = { inherit ldcBootstrap; }.

@worldofpeace
Copy link
Contributor

@ThomasMader Feel free to ping me for merge on this PR and the dmd one.
(though I'm not sure because I see "WIP")

@lionello
Copy link
Contributor Author

@worldofpeace It's WIP because I'm getting a failure during check phase on my local MacBook. Need to dig in.

@ThomasMader
Copy link
Contributor

@lionello What failure? Can you elaborate? Mostly I can't help without digging in too but maybe we are lucky.

@lionello
Copy link
Contributor Author

lionello commented Apr 19, 2020

@lionello What failure? Can you elaborate? Mostly I can't help without digging in too but maybe we are lucky.

@ThomasMader Actually, it's dmd that still has a failure on macOS: #82694 (comment)

@lionello lionello changed the title [WIP] ldc: 1.17.0 -> 1.20.1 ldc: 1.17.0 -> 1.20.1 Apr 19, 2020
@lionello
Copy link
Contributor Author

@worldofpeace @ThomasMader Locally, this now builds successfully on macOS and NixOS with tests passing.

@ThomasMader
Copy link
Contributor

@GrahamcOfBorg build ldc

@ThomasMader
Copy link
Contributor

@worldofpeace would it be possible to get this into 20.03 or is the release already frozen?

@worldofpeace
Copy link
Contributor

@worldofpeace would it be possible to get this into 20.03 or is the release already frozen?

We've been go for the final release for a week https://discourse.nixos.org/t/go-no-go-meeting-nixos-20-03-markhor/, so we're very past the freeze.

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build ldc

@worldofpeace
Copy link
Contributor

I issued the build command @ThomasMader because I didn't see it build on macos for you. So I guess that means you aren't in "trusted users" in ofborg, which basically means you can build on darwin plus other minor stuff.

@worldofpeace worldofpeace merged commit 63bb75a into NixOS:master Apr 20, 2020
@ThomasMader
Copy link
Contributor

I used to be able to build on Darwin too. Never mind.

@lionello lionello deleted the ldc-bootstrap branch April 20, 2020 14:09
@lionello
Copy link
Contributor Author

lionello commented Apr 20, 2020

Thanks! Please check the dmd one as well: #82694

@andersk
Copy link
Contributor

andersk commented Apr 21, 2020

This broke dmd:
https://hydra.nixos.org/build/116952239

ldmd2 -of../generated/linux/release/64/dmd -m64 -vtls -J../generated/linux/release/64 -J../res  -version=MARS -fPIC -J../generated/linux/release/64 -w -de -O -release -inline -dip25 dmd/access.d dmd/aggregate.d dmd/aliasthis.d dmd/apply.d dmd/argtypes.d dmd/arrayop.d dmd/arraytypes.d dmd/astcodegen.d dmd/attrib.d dmd/builtin.d dmd/canthrow.d dmd/cli.d dmd/clone.d dmd/compiler.d dmd/complex.d dmd/cond.d dmd/constfold.d dmd/cppmangle.d dmd/cppmanglewin.d dmd/ctfeexpr.d dmd/ctorflow.d dmd/dcast.d dmd/dclass.d dmd/declaration.d dmd/delegatize.d dmd/denum.d dmd/dimport.d dmd/dinifile.d dmd/dinterpret.d dmd/dmacro.d dmd/dmangle.d dmd/dmodule.d dmd/doc.d dmd/dscope.d dmd/dstruct.d dmd/dsymbol.d dmd/dsymbolsem.d dmd/dtemplate.d dmd/dversion.d dmd/escape.d dmd/expression.d dmd/expressionsem.d dmd/func.d dmd/hdrgen.d dmd/id.d dmd/impcnvtab.d dmd/imphint.d dmd/init.d dmd/initsem.d dmd/inline.d dmd/inlinecost.d dmd/intrange.d dmd/json.d dmd/lambdacomp.d dmd/lib.d dmd/libelf.d dmd/libmach.d dmd/link.d dmd/mars.d dmd/mtype.d dmd/nogc.d dmd/nspace.d dmd/objc.d dmd/opover.d dmd/optimize.d dmd/parse.d dmd/permissivevisitor.d dmd/sapply.d dmd/templateparamsem.d dmd/sideeffect.d dmd/statement.d dmd/staticassert.d dmd/target.d dmd/typesem.d dmd/traits.d dmd/transitivevisitor.d dmd/parsetimevisitor.d dmd/visitor.d dmd/typinf.d dmd/utils.d dmd/scanelf.d dmd/scanmach.d dmd/statement_rewrite_walker.d dmd/statementsem.d dmd/staticcond.d dmd/safe.d dmd/blockexit.d dmd/printast.d dmd/semantic2.d dmd/semantic3.d dmd/irstate.d dmd/toctype.d dmd/glue.d dmd/gluelayer.d dmd/todt.d dmd/tocsym.d dmd/toir.d dmd/dmsc.d dmd/tocvdebug.d dmd/s2ir.d dmd/toobj.d dmd/e2ir.d dmd/eh.d dmd/iasm.d dmd/iasmdmd.d dmd/iasmgcc.d dmd/objc_glue.d dmd/backend/cc.d dmd/backend/cdef.d dmd/backend/cgcv.d dmd/backend/code.d dmd/backend/cv4.d dmd/backend/dt.d dmd/backend/el.d dmd/backend/global.d dmd/backend/obj.d dmd/backend/oper.d dmd/backend/outbuf.d dmd/backend/rtlsym.d dmd/backend/code_x86.d dmd/backend/iasm.d dmd/backend/codebuilder.d dmd/backend/ty.d dmd/backend/type.d dmd/backend/exh.d dmd/backend/mach.d dmd/backend/mscoff.d dmd/backend/dwarf.d dmd/backend/dwarf2.d dmd/backend/xmm.d dmd/backend/dlist.d dmd/backend/melf.d dmd/backend/varstats.di dmd/root/aav.d dmd/root/man.d dmd/root/response.d dmd/root/speller.d dmd/root/longdouble.d ../generated/linux/release/64/backend.a ../generated/linux/release/64/lexer.a
dmd/complex.d(57): Deprecation: `opMul` is deprecated.  Use `opBinary(string op)(...) if (op == "*")` instead.
dmd/complex.d(57): Deprecation: `opMul_r` is deprecated.  Use `opBinaryRight(string op)(...) if (op == "*")` instead.
dmd/complex.d(62): Deprecation: `opMul` is deprecated.  Use `opBinary(string op)(...) if (op == "*")` instead.
dmd/complex.d(62): Deprecation: `opMul_r` is deprecated.  Use `opBinaryRight(string op)(...) if (op == "*")` instead.
dmd/complex.d(67): Deprecation: `opDiv` is deprecated.  Use `opBinary(string op)(...) if (op == "/")` instead.
dmd/constfold.d(98): Deprecation: `opNeg` is deprecated.  Use `opUnary(string op)() if (op == "-")` instead.
dmd/constfold.d(214): Deprecation: `opAdd` is deprecated.  Use `opBinary(string op)(...) if (op == "+")` instead.
dmd/constfold.d(317): Deprecation: `opSub` is deprecated.  Use `opBinary(string op)(...) if (op == "-")` instead.
dmd/constfold.d(369): Deprecation: `opMul` is deprecated.  Use `opBinary(string op)(...) if (op == "*")` instead.
dmd/constfold.d(369): Deprecation: `opMul_r` is deprecated.  Use `opBinaryRight(string op)(...) if (op == "*")` instead.
dmd/constfold.d(411): Deprecation: `opDiv` is deprecated.  Use `opBinary(string op)(...) if (op == "/")` instead.
make[1]: *** [posix.mak:472: ../generated/linux/release/64/dmd] Error 1

@worldofpeace
Copy link
Contributor

Oh, did we need to merge dmd together?

@ThomasMader
Copy link
Contributor

Yes merging #82694 should fix those problems.
Nobody knew in advance, the version difference was just too big.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants