Skip to content

Conversation

@WalterBright
Copy link
Member

first one in the back end!

@WalterBright WalterBright force-pushed the divcoeff.d branch 5 times, most recently from d95376b to 20e5971 Compare June 15, 2017 08:20
@jacob-carlborg
Copy link
Contributor

There's a Visual Stdio project file as well.

@WalterBright
Copy link
Member Author

I'm having enough trouble getting these makefiles to work.

@WalterBright
Copy link
Member Author

It looks like circleci is using an older dmd to compile. It needs to be upgraded to 2.074.1

@wilzbach
Copy link
Contributor

It looks like circleci is using an older dmd to compile. It needs to be upgraded to 2.074.1

Simply bump it here:

https://github.com/dlang/dmd/blob/master/circleci.sh#L5

@WalterBright WalterBright force-pushed the divcoeff.d branch 2 times, most recently from 11f956e to 1e5c9ba Compare June 15, 2017 10:25
@WalterBright
Copy link
Member Author

Thanks! That did the trick on circleci.

@MartinNowak
Copy link
Member

As said per mail, neither gdc nor ldc support anything like -mv which would restrict us to dmd to build releases. Looking at ~30% speedup for dmd using a better optimizing compiler, that doesn't seem like a smart move.

@MartinNowak
Copy link
Member

Sorry, doesn't look like this is using -mv at all. For what would that be needed?

@MartinNowak
Copy link
Member

Some info on why you need to update the required compiler would be helpful!
Also need to bump the auto_bootstrap version in posix.mak.

* License: Distributed under the Boost Software License, Version 1.0.
* http://www.boost.org/LICENSE_1_0.txt
* Source: https://github.com/dlang/dmd/blob/master/src/ddmd/backend/divcoeff.c
* Source: https://github.com/dlang/dmd/blob/master/src/ddmd/backend/divcoeff.d
Copy link
Contributor

Choose a reason for hiding this comment

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

How about?

$(DMDSRC backend/_divcoeff.d)

Copy link
Member

Choose a reason for hiding this comment

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

yes please

@ibuclaw
Copy link
Member

ibuclaw commented Jun 15, 2017

My guess is that some compilers (or ancient perl wrappers) don't understand -betterC.

@MartinNowak
Copy link
Member

My guess is that some compilers (or ancient perl wrappers) don't understand -betterC.

Ah yes, that's another problem. Why do we need -betterC for the backend? Is this some dmc tribute?

@ibuclaw
Copy link
Member

ibuclaw commented Jun 15, 2017

Ah yes, that's another problem. Why do we need -betterC for the backend? Is this some dmc tribute?

Well, it looks like -betterC is the reason why jenkins fails.

https://ci.dlang.io/blue/organizations/jenkins/dlang-org%2Fdmd/detail/PR-6907/9/pipeline#step-74-log-128

You could workaround by building with -release, but I already am not a fan of the travisci tests doing that.

@WalterBright
Copy link
Member Author

WalterBright commented Jun 15, 2017

Some info on why you need to update the required compiler would be helpful!

The older compiler generated code that was looking for the module assert() function in -betterC mode, which had been removed.

-mv

I picked this module because it didn't require -mv

-betterC

The backend doesn't use any D features that require druntime, so I wanted to dogfood and get -betterC working better for such applications.

jenkins failures

This is the same thing that was causing the circleci failures. The solution is to move to a newer D compiler.

@WalterBright
Copy link
Member Author

WalterBright commented Jun 15, 2017

Essentially, it's time to move forward with converting the backend to D. To that end, gdc, ldc, and the build process needs to support:

  1. -mv switch
  2. removal of the generated assert helper functions
  3. fix Issue 17499 - with -betterC switch, call C's assert failure function rather than druntime's #6901

None of these are tricky or difficult. To that end, divcoeff.d is a trial run to see where the issues are in the toolchain for doing this. Looks like it's doing its job :-)

@ibuclaw
Copy link
Member

ibuclaw commented Jun 15, 2017

#6901

Making compilers support features that have not made it to stable (or even in a release) is probably asking for a bit too much.

@WalterBright
Copy link
Member Author

Making compilers support features that have not made it to stable (or even in a release) is probably asking for a bit too much.

These changes are simple and not controversial. Let's move forward with them.

@andralex
Copy link
Member

OK I'll pull the switch on this to get in once it passes tests.

@wilzbach
Copy link
Contributor

CC @CyberShadow for updating DAutoTest

@CyberShadow
Copy link
Member

@WalterBright Just so we're on the same page, please describe the procedure for building DMD master (incl. this pull request) from scratch without a host DMD compiler (C++ only).

@MartinNowak
Copy link
Member

MartinNowak commented Jun 16, 2017

Didn't we just agree that 30% speedup from building dmd with gdc is worthwhile for an upcoming release? This would block this option for quite a while. Also jumping ahead with using latest edge features sets quite a bad precedence for dmd/gdc/ldc compatibility.
Most important though, it's still unclear why we even need -betterC here.

@ibuclaw
Copy link
Member

ibuclaw commented Jun 16, 2017

Consider that the oldest compiler building DMD IIRC is using v2.066 of the front-end. I think it's safe to do a leap to 2.068, possibly 2.070 at latest, but I don't really want to break builds when using a release that is not strictly that old.

@dlang dlang deleted a comment from dlang-bot Dec 10, 2017
@dlang dlang deleted a comment from dlang-bot Dec 10, 2017
@dlang dlang deleted a comment from dlang-bot Dec 10, 2017
@wilzbach
Copy link
Contributor

Regarding the current failure: I think you need to add G_DOBJS to the new unittest target in the posix.mak or probably better: add it to D_SRCS.

@JackStouffer
Copy link
Contributor

Walter, the bot comment is going to keep coming back every time there's a new commit. If it doesn't see it's own comment to update, it makes a new one.

@WalterBright
Copy link
Member Author

If it doesn't see it's own comment to update, it makes a new one.

That's not working, then, because I'd delete 10 of them in a row, not one at a time.

@andralex
Copy link
Member

so... pull?

@wilzbach
Copy link
Contributor

so... pull?

AFAICT we are still waiting for GDC to catch up or someone to fork the gdmd script and make -betterC a noop:

Wouldn't want to give a precise date, but gcc-8 is first this would land in. As @MartinNowak said, you are free to make -betterC a noop for the dmd-script wrapper.

@WalterBright
Copy link
Member Author

Rebooted as #7714 because I could not get git rebase to work with renamed files (it kept insisting I had not merged them).

@wilzbach
Copy link
Contributor

I could not get git rebase to work with renamed files (it kept insisting I had not merged them).

Not sure what you did, but it works fine for me:

> go pr/6907
> git rebase upstream/master
First, rewinding head to replay your work on top of it...
Applying: convert divcoeff.c to D
Using index info to reconstruct a base tree...
A	circleci.sh
A	src/ddmd/backend/cod2.c
A	src/ddmd/backend/divcoeff.c
M	src/posix.mak
M	src/win32.mak
Falling back to patching base and 3-way merge...
Auto-merging src/win32.mak
Auto-merging src/posix.mak
CONFLICT (content): Merge conflict in src/posix.mak
CONFLICT (rename/rename): Rename "src/ddmd/backend/divcoeff.c"->"src/dmd/backend/divcoeff.c" in branch "HEAD" rename "src/ddmd/backend/divcoeff.c"->"src/ddmd/backend/divcoeff.d" in "convert divcoeff.c to D"
Auto-merging src/dmd/backend/cod2.c
Auto-merging .circleci/run.sh
error: Failed to merge in the changes.
Patch failed at 0001 convert divcoeff.c to D
The copy of the patch that failed is found in: .git/rebase-apply/patch

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".

> git mergetool

Merging:
src/ddmd/backend/divcoeff.c
src/ddmd/backend/divcoeff.d
src/dmd/backend/divcoeff.c
src/posix.mak

Deleted merge conflict for 'src/ddmd/backend/divcoeff.c':
  {local}: deleted
  {remote}: deleted
Use (m)odified or (d)eleted file, or (a)bort? d

Deleted merge conflict for 'src/ddmd/backend/divcoeff.d':
  {local}: deleted
  {remote}: created file
Use (c)reated or (d)eleted file, or (a)bort? c

Deleted merge conflict for 'src/dmd/backend/divcoeff.c':
  {local}: created file
  {remote}: deleted
Use (c)reated or (d)eleted file, or (a)bort? d

Normal merge conflict for 'src/posix.mak':
  {local}: modified file
  {remote}: modified file
Hit return to start merge resolution tool (kdiff3): 

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.