Skip to content

Comments

Move man to build.d#10581

Merged
dlang-bot merged 1 commit intodlang:masterfrom
marler8997:moveMan
Nov 28, 2019
Merged

Move man to build.d#10581
dlang-bot merged 1 commit intodlang:masterfrom
marler8997:moveMan

Conversation

@marler8997
Copy link
Contributor

No description provided.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @marler8997! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + dmd#10581"

@marler8997 marler8997 force-pushed the moveMan branch 8 times, most recently from aebcefe to 99faa4d Compare November 17, 2019 20:22
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel left a comment

Choose a reason for hiding this comment

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

Some suggestions to improve readability and plattform independency

.deps([mkdirDep(manFileDep.target.dirName)])
.command(["cp", manFileDep.sources[0], manFileDep.target])
.msg(manFileDep.command.join(" "))
))
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably better as a local function/lambda before man. That would clearly seperate these dependencies and will probably be easier when using buildPath

Copy link
Contributor

Choose a reason for hiding this comment

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

(Comment is referring to the entire map-lambda. Apparently GitHub does not handle multiline review comments - or i messed up)

src/build.d Outdated
.target(genManDir.buildPath(e))
.sources([dmdRepo.buildPath("docs/man", e)])
.deps([mkdirDep(manFileDep.target.dirName)])
.command(["cp", manFileDep.sources[0], manFileDep.target])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.command(["cp", manFileDep.sources[0], manFileDep.target])
.commandFunction(() { copy(manFileDep.sources[0], manFileDep.target); })

Copy link
Contributor Author

@marler8997 marler8997 Nov 21, 2019

Choose a reason for hiding this comment

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

I've done this, but now when the copy occurs the timestamps aren't updated. So on my machine, these dependencies will get executed every time I build the "man" target...

Copy link
Contributor Author

@marler8997 marler8997 Nov 21, 2019

Choose a reason for hiding this comment

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

I've created the copyAndTouch function which makes sure to update the target timestamp using touch on linux platforms.

################################################################################

DMD_MAN_PAGE = $(GENERATED)/docs/man1/dmd.1
DMD_MAN_PAGE = $(GENERATED)/docs/man/man1/dmd.1
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable is now unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it's still used in the "install" target a few lines down.

@wilzbach
Copy link
Contributor

BTW we also upload the man page to DAutoTest, e.g. http://dtest.dlang.io/artifact/website-08a5fe1c6137cc5879028d65e8b1ee42781468bc-e3a514cecad8d5bfab69f12f20f39d08/web/docs/man/man1/dmd.1

And DAutoTest reporting zero changes is already a good sign 👍

@marler8997 marler8997 force-pushed the moveMan branch 3 times, most recently from 7562784 to 011393a Compare November 21, 2019 10:10
@MoonlightSentinel
Copy link
Contributor

MoonlightSentinel commented Nov 21, 2019

Maybe man (and other targets relying on D scripts) should be imported instead of compiling and executing a separate executable.
The obvious drawback would be a slight increase in build.ds compile time because of the additional files but it would also provide several benefits:

  1. Less code to maintain (as the compilation target can be omitted)
  2. Reduced execution time (no execute overhead)
  3. Better parallelization while respecting the maximum amount of jobs (once its implemented)

@marler8997 marler8997 force-pushed the moveMan branch 2 times, most recently from 5719369 to dc0c245 Compare November 21, 2019 11:02
@dlang-bot dlang-bot merged commit 4431f19 into dlang:master Nov 28, 2019
@MartinNowak
Copy link
Member

Looks like this broke all dlang.org builds with @CyberShadow's website build tool, e.g. http://dtest.dlang.io/results/38f11f93084f7f0c502f190deba166837646510a/61fe0b3552e74ce37f4e75b0d5851335c963cbbe/.
Seems to be triggered by gen_man relying phobos, while that is not available in the build tool during the dmd build. Can we do sth. about this to unblock publishing releases/updating the website @marler8997, @wilzbach, @RazvanN7?

@MoonlightSentinel
Copy link
Contributor

MoonlightSentinel commented Dec 4, 2019

@MartinNowak This issue arises because the Makefile invoking build.d does not pass the DMD variable and and uses dmd from path. See #10637

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.

7 participants