Skip to content

Commit af43952

Browse files
committed
utils/archivemount: disable on !linux
At least, the code doesn't build on Windows. And the tool will likely only be used on Linux for loading Linux sysfs or cpuid tarballs. Fixes commit 9e90d68 Signed-off-by: Brice Goglin <[email protected]>
1 parent 9e90d68 commit af43952

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

utils/hwloc/misc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long f
277277
}
278278

279279
case HWLOC_UTILS_INPUT_ARCHIVE: {
280+
#ifdef HWLOC_LINUX_SYS
280281
char mntpath[] = "/tmp/tmpdir.hwloc.archivemount.XXXXXX";
281282
char mntcmd[512];
282283
char umntcmd[512];
@@ -324,6 +325,10 @@ hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long f
324325
err = hwloc_utils_enable_input_format(topology, flags, subdir, &sub_input_format, verbose, callname);
325326
if (!err)
326327
*input_format = sub_input_format;
328+
#else
329+
fprintf(stderr, "This installation of hwloc does not support loading from an archive, sorry.\n");
330+
exit(EXIT_FAILURE);
331+
#endif
327332
break;
328333
}
329334

utils/lstopo/test-lstopo.sh.in

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,11 @@ echo "**** Import from synthetic so that we can check some exact outputs in $fil
129129
) > "$file"
130130
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-lstopo.output "$file"
131131

132-
if which archivemount >/dev/null 2>/dev/null; then
133-
if test x@HWLOC_HAVE_LINUX@ = x1; then
134-
echo "**** Archivemount'ing a Linux fsroot archive ..."
135-
file="$tmp/test-lstopo.archivemount.fsroot.output"
136-
$ls -i $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.tar.bz2 -v - | egrep -v "^assuming " > "$file"
137-
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.console "$file"
138-
fi
132+
if which archivemount >/dev/null 2>/dev/null && test x@HWLOC_HAVE_LINUX@ = x1; then
133+
echo "**** Archivemount'ing a Linux fsroot archive ..."
134+
file="$tmp/test-lstopo.archivemount.fsroot.output"
135+
$ls -i $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.tar.bz2 -v - | egrep -v "^assuming " > "$file"
136+
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $HWLOC_top_srcdir/tests/hwloc/linux/16amd64-8n2c.console "$file"
139137
if test x@HWLOC_HAVE_X86_CPUID@ = x1; then
140138
echo "**** Archivemount'ing a x86 CPUID archive ..."
141139
file="$tmp/test-lstopo.archivemount.cpuid.output"

0 commit comments

Comments
 (0)