How to build man pages in dub git repo? #2570
-
I get source code of dub github repo, here are the detailed steps of building dub and its man pages, which occurred error when building man pages. So I need helps about building man pages. (dmd-2.101.2)ruby: ~/my-build
$ git clone --depth=1 https://github.com/dlang/dub
Cloning into 'dub'...
remote: Enumerating objects: 1097, done.
remote: Counting objects: 100% (1097/1097), done.
remote: Compressing objects: 100% (743/743), done.
remote: Total 1097 (delta 61), reused 907 (delta 54), pack-reused 0
Receiving objects: 100% (1097/1097), 1.50 MiB | 1.73 MiB/s, done.
Resolving deltas: 100% (61/61), done.
(dmd-2.101.2)ruby: ~/my-build
$ cd dub/
(dmd-2.101.2)ruby: ~/my-build/dub
$ dmd -run build.d
Using pre-existing version file. To force a rebuild, provide an explicit version (first argument) or remove: /home/ruby/my-build/dub/source/dub/version_.d
Building dub using dmd (dflags: ["-g", "-O", "-w"]), this may take a while...
DUB has been built as: /home/ruby/my-build/dub/bin/dub
You may want to run `sudo ln -s /home/ruby/my-build/dub/bin/dub /usr/local/bin` now
(dmd-2.101.2)ruby: ~/my-build/dub
$ ./bin/dub scripts/man/gen_man.d
source/dub/internal/dyaml/node.d(2513,9): Deprecation: scope variable `this` assigned to non-scope parameter `_param_0` calling `match`
Serializing composite type Flags!(BuildRequirement) which has no serializable fields
Serializing composite type Flags!(BuildOption) which has no serializable fields
source/dub/dependency.d(914,18): Deprecation: scope variable `this` assigned to non-scope parameter `oth` calling `opEquals`
source/dub/dependency.d(917,30): Deprecation: scope variable `this` assigned to non-scope parameter `a` calling `doCmp`
source/dub/dependency.d(918,27): Deprecation: scope variable `this` assigned to non-scope parameter `b` calling `doCmp`
source/dub/dependency.d(936,26): Deprecation: scope variable `this` assigned to non-scope parameter `oth` calling `opEquals`
source/dub/internal/configy/Exceptions.d(130,34): Deprecation: reference to local variable `buffer` assigned to non-scope parameter `__anonymous_param` calling ``
source/dub/internal/configy/Exceptions.d(134,34): Deprecation: reference to local variable `buffer` assigned to non-scope parameter `__anonymous_param` calling ``
source/dub/internal/configy/Exceptions.d(248,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(250,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(283,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(286,27): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(323,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(325,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(332,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/configy/Exceptions.d(335,31): Deprecation: `@safe` function `formatMessage` calling `formattedWrite`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/write.d(537,34): which calls `std.format.spec.FormatSpec!char.FormatSpec.writeUpToNextSpec!(void delegate(in char[]) @safe).writeUpToNextSpec`
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): which would be `@system` because of:
/home/ruby/dlang/dmd-2.101.2/linux/bin64/../../src/phobos/std/format/spec.d(258,33): scope variable `this` assigned to non-scope parameter `e` calling `put`
source/dub/internal/dyaml/node.d(2513,9): Deprecation: scope variable `this` assigned to non-scope parameter `_param_0` calling `match`
scripts/man/gen_man.d(269,26): Error: no property `peek` for `arg.defaultValue` of type `const(dub.internal.dyaml.stdsumtype.SumType!(string[], string, bool, int, uint))`
Error dmd failed with exit code 1. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ah sorry, I updated the man page generator to include more information and better be formatted, but I was doing so on an older branch. When rebasing onto master I didn't test how much has changed, but because of changes in how default values work on the command line, the script broke here. Gonna PR a fix, you can workaround it locally like this right now: diff --git a/scripts/man/gen_man.d b/scripts/man/gen_man.d
index e789ebe1..3d4a1273 100755
--- a/scripts/man/gen_man.d
+++ b/scripts/man/gen_man.d
@@ -5,6 +5,7 @@ dependency "dub" path="../.."
import std.algorithm, std.conv, std.format, std.path, std.range;
import std.stdio : File;
+import dub.internal.dyaml.stdsumtype;
import dub.commandline;
static struct Config
@@ -266,7 +267,7 @@ struct ManWriter
}
if (larg !is null) {
name ~= bold(escapeWord("--%s".format(larg)));
- if (!arg.defaultValue.peek!bool)
+ if (arg.defaultValue.match!((bool b) => false, _ => true))
name ~= escapeWord("=") ~ italic("VALUE");
}
writeArgName(cmdName, name);
|
Beta Was this translation helpful? Give feedback.
ah sorry, I updated the man page generator to include more information and better be formatted, but I was doing so on an older branch. When rebasing onto master I didn't test how much has changed, but because of changes in how default values work on the command line, the script broke here. Gonna PR a fix, you can workaround it locally like this right now: