Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions chmodzip.d
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ int main(string[] args)
zr.expand(de);
writefln("name = %s", de.name);
writefln("\tcomment = %s", de.comment);
writefln("\tmadeVersion = x%04x", de.madeVersion);
writefln("\textractVersion = x%04x", de.extractVersion);
writefln("\tflags = x%04x", de.flags);
writefln("\tcompressionMethod = %d", de.compressionMethod);
writefln("\tcrc32 = x%08x", de.crc32);
writefln("\texpandedSize = %s", de.expandedSize);
writefln("\tcompressedSize = %s", de.compressedSize);
writefln("\teattr = %03o, %03o", de.externalAttributes >> 16, de.externalAttributes & 0xFFFF);
writefln("\teattr = %03o, %03o", de.fileAttributes);
writefln("\tiattr = %03o", de.internalAttributes);
//writefln("\tdate = %s", std.date.toString(std.date.toDtime(de.time)));
writefln("\tdate = %s", SysTime(unixTimeToStdTime((de.time))));
Expand Down Expand Up @@ -74,11 +73,10 @@ L1:

foreach (member; members)
{
if (de.name == member && ((de.externalAttributes >> 16) & octal!7777) != newattr)
if (de.name == member && (de.fileAttributes & octal!7777) != newattr)
{
changes = true;
de._madeVersion = 0x317; // necessary or linux unzip will ignore attributes
de.externalAttributes = (de.externalAttributes & ~(octal!7777 << 16)) | (newattr << 16);
de.fileAttributes = de.fileAttributes & ~octal!7777 | newattr;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dman.d
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ string CHeader(string topic)
static string[] dmccmds =
[
"assert.h", "complex.h", "ctype.h", "fenv.h",
"float.h", "locale.h", "math.h", "setjmp.h,"
"float.h", "locale.h", "math.h", "setjmp.h,",
"signal.h", "stdarg.h", "stddef.h", "stdio.h",
"stdlib.h", "string.h", "time.h", "gc.h",
"bios.h", "cerror.h", "disp.h", "dos.h",
Expand Down
8 changes: 1 addition & 7 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ $(ROOT)/dustmite: DustMite/dustmite.d DustMite/splitter.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) DustMite/dustmite.d DustMite/splitter.d -of$(@)

#dreadful custom step because of libcurl dmd linking problem (Bugzilla 7044)
$(CURL_TOOLS): $(ROOT)/%: %.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) -c -of$(@).o $(<)
# grep for the linker invocation and append -lcurl
LINKCMD=$$($(DMD) $(MODEL_FLAG) $(DFLAGS) -v -of$(@) $(@).o 2>/dev/null | grep $(@).o); \
$${LINKCMD} -lcurl

$(TOOLS) $(DOC_TOOLS): $(ROOT)/%: %.d
$(TOOLS) $(DOC_TOOLS) $(CURL_TOOLS): $(ROOT)/%: %.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) -of$(@) $(<)

ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ???
Expand Down
24 changes: 18 additions & 6 deletions rdmd_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ void main(string[] args)
"concurrency", &concurrencyTest,
);

// if the compiler contains a dir separator, it's not the in the global PATH
// but a relative path
// an absolute path or executable in the PATH is required as the test suite
// used chdir
if (compiler.canFind(dirSeparator))
compiler = compiler.asAbsolutePath.array;

enforce(rdmd.exists, "Path to rdmd does not exist: %s".format(rdmd));

rdmdApp = tempDir().buildPath("rdmd_app_") ~ binExt;
Expand Down Expand Up @@ -347,15 +354,20 @@ void runTests()
assert(res.status == 0, res.output);
assert(!res.output.canFind("compile_force_src"));

auto fullCompilerPath = environment["PATH"]
.splitter(pathSeparator)
.map!(dir => dir.buildPath(compiler ~ binExt))
.filter!exists
.front;
// for absolute compiler path, we make the path relative again
string fullCompilerPath = void;
if (compiler.isAbsolute)
fullCompilerPath = compiler.asRelativePath(getcwd()).array;
else
fullCompilerPath = environment["PATH"]
.splitter(pathSeparator)
.map!(dir => dir.buildPath(compiler ~ binExt))
.filter!exists
.front;

res = execute([rdmdApp, "--compiler=" ~ fullCompilerPath, forceSrc]);
assert(res.status == 0, res.output ~ "\nCan't run with --compiler=" ~ fullCompilerPath);
assert(res.output.canFind("compile_force_src"));
assert(res.output.canFind("compile_force_src"), "Can't find compile_force_src");

// Create an empty temporary directory and clean it up when exiting scope
static struct TmpDir
Expand Down
65 changes: 46 additions & 19 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,70 @@

set -uexo pipefail

DIGGER_DIR="../digger"
DIGGER="../digger/digger"
TRAVIS_BRANCH=${TRAVIS_BRANCH:-master}
DMD="../dmd/src/dmd"
N=2

# set to 64-bit by default
if [ -z ${MODEL:-} ] ; then
MODEL=64
fi

clone() {
local url="$1"
local path="$2"
local branch="$3"
for i in {0..4}; do
if git clone --depth=1 --branch "$branch" "$url" "$path"; then
break
elif [ $i -lt 4 ]; then
sleep $((1 << $i))
else
echo "Failed to clone: ${url}"
exit 1
fi
done
}

test_rdmd() {
# run rdmd internal tests
rdmd -m$MODEL -main -unittest rdmd.d
rdmd --compiler=$DMD -m$MODEL -main -unittest rdmd.d

# compile rdmd & testsuite
dmd -m$MODEL rdmd.d
dmd -m$MODEL rdmd_test.d
$DMD -m$MODEL rdmd.d
$DMD -m$MODEL rdmd_test.d

# run rdmd testsuite
./rdmd_test
./rdmd_test --compiler=$DMD
}

build_digger() {
git clone --recursive https://github.com/CyberShadow/Digger "$DIGGER_DIR"
(cd "$DIGGER_DIR" && rdmd --build-only -debug digger)
}
setup_repos()
{
for repo in dmd druntime phobos dlang.org installer ; do
if [ ! -d "../${repo}" ] ; then
if [ $TRAVIS_BRANCH != master ] && [ $TRAVIS_BRANCH != stable ] &&
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $TRAVIS_BRANCH > /dev/null; then
# use master as fallback for other repos to test feature branches
clone https://github.com/dlang/${repo}.git ../${repo} master
else
clone https://github.com/dlang/${repo}.git ../${repo} $TRAVIS_BRANCH
fi
fi
done

install_digger() {
$DIGGER build --model=$MODEL "master"
export PATH=$PWD/result/bin:$PATH
make -j$N -C ../dmd/src -f posix.mak MODEL=$MODEL HOST_DMD=dmd all
Copy link
Member

Choose a reason for hiding this comment

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

Missing make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD dmd.conf after that, hence the failure with rdmd.

make -j$N -C ../druntime -f posix.mak MODEL=$MODEL HOST_DMD=$DMD
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL HOST_DMD=$DMD
}

if ! [ -d "$DIGGER_DIR" ] ; then
build_digger
fi

install_digger
setup_repos

dmd --version
$DMD --version
rdmd --help | head -n 1
dub --version

# all dependencies installed - run tests now
# TODO: fix changed
make -f posix.mak catdoc ddemangle detab dget dman dustmite tolf

test_rdmd