-
-
Notifications
You must be signed in to change notification settings - Fork 703
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
posix.mak: module-specific -dip25/1000 for someModule.test and unitte… #6278
Conversation
Thanks for your pull request and interest in making D better, @carblue! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
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 referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
At the moment everything seems to error for me with:
IIRC this is due to https://issues.dlang.org/show_bug.cgi?id=18445, but the stdx.logger bit would be fixed by #5915 |
I assume this is the See also: #5915 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments
posix.mak
Outdated
@@ -340,12 +340,210 @@ endif | |||
$(addprefix $(ROOT)/unittest/,$(DISABLED_TESTS)) : | |||
@echo Testing $@ - disabled | |||
|
|||
# In particular, this posix.mak successfully compiles master (with module-specific settings acc. to aa) for: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Makefile will also be on stable
, so the comment doesn't make much sense.
posix.mak
Outdated
|
||
# global associative array aa: | ||
# keys: first dir-files, then sub-dir-files, lexical ordering | ||
# value: any dmd compiler switch, used here for -dip25/1000 only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would drop the entire comment and just say: "Module-specific compiler switches (needed for the -dip1000
transition)"
However, if you want please feel free to improve the header of this file (e.g. if it was hard for you to figure out how to run the test for an individual module or overall), but it's a redundant here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for Your review, Seb. Agreed. Since I'm more wordy in the PR introducing comment, that's redundant. Carsten
posix.mak
Outdated
aa[std.process]=-dip1000 | ||
aa[std.random]=-dip1000 | ||
aa[std.signals]=-dip1000 | ||
aa[std.socket]=-dip25 # depends on PR 6204 merged, which will be at least deferred or possibly rejected (deprecation process required due to changed class Socket) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm #6204 was closed :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reopened that, FWIW.
posix.mak
Outdated
aa[std.algorithm.iteration]=-dip25 # WIP | ||
aa[std.algorithm.mutation]=-dip1000 | ||
aa[std.algorithm.package]=-dip1000 | ||
aa[std.algorithm.searching]=-dip25 # depends on PR 6246 merged and std.algorithm.comparison fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#6246 was closed.
I get the following for pmake std/algorithm/searching.test DFLAGS=-dip1000
so
std/uni.d(7458): Error: returning sliceOverIndexed(a, b, &this) escapes a reference to parameter this, perhaps annotate with return
std/uni.d(7464): Error: returning sliceOverIndexed(0LU, this.length(), &this) escapes a reference to parameter this, perhaps annotate with return
std/experimental/logger/filelogger.d(133): Error: @safe function std.experimental.logger.filelogger.FileLogger.beginLogMsg cannot call @system function std.experimental.logger.core.systimeToISOString!(LockingTextWriter).systimeToISOString
std/experimental/logger/filelogger.d(134): Error: @safe function std.experimental.logger.filelogger.FileLogger.beginLogMsg cannot call @system function std.format.formattedWrite!(LockingTextWriter, char, string, string, int).formattedWrite
std/experimental/logger/filelogger.d(143): Error: @safe function std.experimental.logger.filelogger.FileLogger.logMsgPart cannot call @system function std.format.formattedWrite!(LockingTextWriter, char, const(char)[]).formattedWrite
std/experimental/logger/filelogger.d(143): Error: scope variable msg assigned to non-scope parameter _param_2 calling std.format.formattedWrite!(LockingTextWriter, char, const(char)[]).formattedWrite
the logger part is fixed by #5915
So it depends on https://issues.dlang.org/show_bug.cgi?id=18445 + #5915?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did reopen and update #6246
There is a strange new error there: Error: struct std.range.SortedRange!(int[], "a < b").SortedRange
member _input is not accessible from @safe code
I'm going through all modules once more (someModule.test) and prepare an overall comment and update for this PR, trying to get synchronized with Your findings.
posix.mak
Outdated
aa[std.algorithm.package]=-dip1000 | ||
aa[std.algorithm.searching]=-dip25 # depends on PR 6246 merged and std.algorithm.comparison fixed | ||
aa[std.algorithm.setops]=-dip1000 | ||
aa[std.algorithm.sorting]=-dip25 # i.a. depends on (fixed issue 17512 available in master and) a fix for writefln |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I get the same error as for searching) so depends on std.algorithm.searching?
posix.mak
Outdated
aa[std.experimental.allocator.building_blocks.segregator]=-dip1000 | ||
aa[std.experimental.allocator.building_blocks.stats_collector]=-dip1000 | ||
aa[std.experimental.logger.core]=-dip1000 # PR 6266 | ||
aa[std.experimental.logger.filelogger]=-dip25 # PR 6266; depends on a fix for: std.format.formattedWrite |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or #5915
posix.mak
Outdated
aa[std.net.isemail]=-dip1000 | ||
|
||
aa[std.range.interfaces]=-dip1000 | ||
aa[std.range.package]=-dip25 # i.a. depends on the issue 17512 fix available in master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on https://issues.dlang.org/show_bug.cgi?id=18445 + #5915 for me
posix.mak
Outdated
aa[std.regex.internal.kickstart]=-dip1000 | ||
aa[std.regex.internal.parser]=-dip1000 | ||
aa[std.regex.internal.tests2]=-dip1000 | ||
aa[std.regex.internal.tests]=-dip25 # depends on a fix for writeln |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on https://issues.dlang.org/show_bug.cgi?id=18445 + #5915 for me
See the change in #6281 We need a way to test specific DIP1000 changes to |
@wilzbach This comment is going to be huge, thus here is part 1: In this comment I refer to the following sources:
Now it's the first time I will have to "step back" from -dip1000 to -dip25 in posix.mak for: std.exception, due to https://issues.dlang.org/show_bug.cgi?id=18478. For me (Linux x86_64), with that "aa[std.exception]=-dip25" change to #6278 (and some comming comment changes) I get these results: make -j6 -f posix.mak unittest <= PASS everywhere With aa[std.file]=-dip1000 temporarily for the next 3 tests, dir phobos/generated erased before each run:
The demangled undefined reference is: pure nothrow @nogc return @safe std.uni.SliceOverIndexed!(std.uni.Grapheme).SliceOverIndexed std.uni.SliceOverIndexed!(std.uni.Grapheme).SliceOverIndexed.opSlice() make -f posix.mak std/utf.test <= no errors |
@wilzbach dmd : Latest commit 17bc56c and requiring this change applied (#6295):
There are some comments containing DROP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I am still on the road for a few hours, but we should merge this ASAP to avoid further regressions, so I might push to your PR later.
posix.mak
Outdated
aa[std.ascii]=-dip1000 | ||
aa[std.base64]=-dip1000 | ||
aa[std.bigint]=-dip1000 | ||
aa[std.bitmanip]=-dip1000 # PR 6174 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Walter is a huge fan of clickable links
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a fan of efficiency (including clickable links; sorry, in a hurry I sometimes forget them).
In this case I don't know if they work from there, but I'll update to URLs.
@wilzbach under these conditions: and requiring a slist.d fix like #6295 or the outdated one above. |
|
…t being not-compatible yet
Update: @CyberShadow had the excellent idea to move these changes to a separate makefile - I have done so for you. |
OK now we should finally be able to make incremental progress on dip1000 :) |
st rules
Somehow I managed to screw my git push-connection to closed PR #6195
So here it is again, updated.
This PR is not expected to be merged, possibly wrong to merge unchanged (I don't know; and it's useful temporarily only anyway).
"I'm not aware of the complete picture of the build process and all the consequences of such a phobos.posix.mak in CI: It may perhaps prevent merging a legitimate fix in one file because it touches yet non(-dip1000/-unit-)tested code of another phobos module, now failing due to -dip1000. "
It's main purpose is to document the state/infos/progress of -dip1000 compilable phobos and preferrably to be used locally by anybody interested. I will refer to this posix.mak in my "fix -dip1000 compilable" PRs.
It includes a global associative array 'aa' with module-specific (key) and value for -dip25/1000, according to how master's modules are compilable, updated regularly acc. progress.
Thus it's also the TODO-list for the "few" remaining -dip25 only compilable modules.
Members with write access can write into carblue:dip1000_3; I'll pay attention not to overwrite when pushing updates.
WIP_carblue will be my mark what I'm working on.
If there is a champion who wants to contribute for a difficult issue: It's the std.stdio. write family of functions, that needs fixing, currently triggering errors from several modules:
Just set -dip1000 for the aa[module] and go down to the rabbit hole.
I do these tests, each with -dip1000 and -dip25 as well (because it may happen to work for -dip1000, but not for -dip25 any more):
make -j6 -f posix.mak publictests and the next 2 ones
aa is included in 2 rules for unittesting/compiling, currently; suitable as is for Linux (at least):
make -f posix.mak path/to/someModule.test e.g. make -f posix.mak std/uni.test
make -j6 -f posix.mak unittest
I preferred associative array aa entries in the "modulename-notation" (e.g. aa[std.array]) instead of OS-dependant "pathname-notation" (didn't recall whether windows can cope with forward-slashes).$(aa[$ (subst /,.,$(basename $<))])
But this only defers the issue to the call-site (I use Linux, i.e. /):
Used currently in 2 rules, e.g.
$(DMD) -od$ $T $(DFLAGS) $ (aa[$(subst /,.,$(basename $<))]) -main $ (UDFLAGS) $(LIB) -defaultlib= -debuglib= $ (LINKDL) -cov -run $< ;
%.test : %.d $(LIB)
T=mktemp -d /tmp/.dmd-run-test.XXXXXX &&
(
RET=$$? ; rm -rf $$T ; exit $$RET
)
Positioning$(aa[$ (subst /,.,$(basename $<))]) after $ (DFLAGS) resulting in e.g. -dip25 -dip1000 always worked for me, the compiler picked up the last one.
This way, the changes introduced by this PR may be completely removed again, once phobos is fully -dip1000 compilable, and simple changes like e.g. in PR 5915 (see also 5044) will do it.