Error makefile 71 command syntax error

For a task, I've got a Makefile provided with this content: # Flag that states that warnings will not lead to compilation errors FORCE = false # Compiler CC = gcc # Doc generator DOC = d...

For a task, I’ve got a Makefile provided with this content:

# Flag that states that warnings will not lead to compilation errors
FORCE = false

# Compiler
CC      = gcc
# Doc generator
DOC     = doxygen

# Include directories
INCLUDES     =
# Compiler flags
CFLAGS_FORCE = -c -g -ansi -pedantic -Wall -Wextra
CFLAGS       = $(CFLAGS_FORCE) -Werror
# Linker flags
LDFLAGS      =

# Source codes
SOURCE      = ueb01.c
OBJECTS     = $(SOURCE:.c=.o)

# Target name
BINARY      = ueb01

.PHONY: all help clean doc doc

default: all

force: 
    @make FORCE=true

all: $(BINARY)

# Compile a single file
%.o : %.c
    @echo "  - Building $@"
ifeq ($(FORCE),true)
    $(CC) $(CFLAGS_FORCE) $(INCLUDES) -o $@ $<
else
    $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
endif
    @echo "  ... done"

# Link files to an executable
$(BINARY): $(OBJECTS)
    @echo "  - linking $@"
    $(CC) $(LDFLAGS) $(OBJECTS) -o $(BINARY)
    @echo "  ... done"

# Clean the project
clean:
    @echo "  - delete object all files"
    rm -f $(OBJECTS) $(BINARY) *~ doxygen.log
    rm -rf doc/
    @echo "  ... done"

doc:
    @echo "  - creating documentation"
    $(DOC)
    @echo "  ... done"

# Show help
help:
    @echo "Options:"
    @echo "make all      - create program"
    @echo "make clean    - clean up"
    @echo "make doc      - create documentation"
    @echo "make force    - compile without -Werror (just for 'comfier' development)"

Within same folder as the Makefile, I’ve got a program.c file that I’d like to execute. The content of that file is not relevant here, because I can’t even compile the .c file with the provided Makefile. So when I’m the cmd window and type in make or make all, following lines are being displayed:

MAKE Version 5.4  Copyright (c) 1987, 2010 Embarcadero Technologies, Inc.
Error makefile 45: Command syntax error
Error makefile 46: Command syntax error
Error makefile 47: Command syntax error
Error makefile 48: Command syntax error
Error makefile 49: Command syntax error
Error makefile 50: Command syntax error
*** 6 errors during make ***

The Makefile was provided by my supervisors for the task and works fine as it’s supposed to do for my friends but strangely not for me.

I’ve tried to solve this by installing CMake by Kitware but it gives me the same errors.
I’m running on Windows 10 (64 Bit).

Thanks in advance! T.T

This second tutorial will cover makefiles, a very basic run down of the C programming language, compiling source code using the template examples found in DevKitPro and dealing with compiling errors. This tutorial came out way longer than I expected and I’m hoping to keep other tutorials shorter than this one. You can grab the PDF of this tutorial here: codemii-tutorial-2.

When you’re compiling source code, the program that does the compiling needs to know what to compile, which libraries to include, compiling options, optimisations, etc and this is what a makefile is used for.


Makefiles

A makefile is usually found that the root directory of the source code you have. Take the gamecube template source code example (C:devkitProexamplesgamecubetemplate). In that directory you will see a file name “Makefile”. If you open it up with notepad, you’ll be able to see the different parts of a makefile.

The important parts of a makefile for this tutorial are the following lines:

include $(DEVKITPPC)/gamecube_rules

By specificing “gamecube_rules” we are telling our compiler that the source code we want to compile will be run on the gamecube. You would use “wii_rules” to compile for the Wii.

By changing between these two, you are changing which libraries will be used when compiling the source code. Libraries are a bunch of files which we use in our source code to interact with the gamecube or Wii system.

SOURCES        :=    source
DATA        :=    data
INCLUDES    := 

These lines tell the compiler which files should be compiled. Most of the time you can leave this alone as our source code will be in /source and our additional files like images, music, etc will be in /data.

LIBS    :=    -logc –lm

This is a very important line as it tells the compiler which additional libraries we wish to use. Say we want to play an mp3 and have the relevant code in our source to do so. If we were to compile our source with the above line, the compiler would complain and say that it can’t find the functions we are using to play an mp3 file. For playing mp3 files, you need to include the “lmad” library.

The LIBS line when we add the lmad library looks like:

LIBS    :=    -lmad -logc –lm

The order of how you include your libraries is also important as some libraries may reference other libraries and if you haven’t got them in the right order, the compiler will complain about it.


Basics of C

So we’ve quickly covered the more important parts of makefiles, we are now ready to learn some basics of the C programming language (which is kind of similar to most other programming languages). If you wish to learn much more about C programming just check the net for in depth tutorials which will explain things much clearer than what I’m doing.

Firstly we will cover variables. A variable as the name suggests is a symbol that can change its value. In the example below we are assigning 0 to the variable test.

int test = 0;

The variable test is of type int which means integer (number). So we are assigning the number 0 to the variable test.

There are different types of variables in the C programming language which include:

  • boolean can either be true or false. E.g. bool test = false;
  • int / long is integer that can range from -2,147,483,648 to 2,147,483,648. E.g int test =5;
  • float is a precise decimal point number that can range from +/- 3.4e +/- 38 (~7 digits). E.g float test = 3.14159
  • double is another precise decimal point number from +/- 1.7e +/- 308 (~15 digits). E.g double test = 3.1415926535897
  • char is a single character or integer that represent a character. E.g. char test = ‘a’;

The next thing we’ll cover is control structures, some include if, else, while and for

int test = 5;
if (test == 5) { //do something }
else { //do something else }

The above code is a demonstration of an “if” statement. If the variable “test” is equal (==) to 5 then “//do something” will be run. If we had set the “test” variable to 4, then “// do something else” would be run. The double slashes (//) means that all the text after the slashes is a comment in the code.

The double equals signs (==) is what we call an operator. There are many operators, some include:
<= means less than or equal to
>= means more than or equal to
!= means not equal to

int test = 0;
while (test < 5) {
printf(“ok”);
test++
}

The above code is a while loop, which continually checks to make sure that if “test” is less than 5 then it will print the text “ok” to the screen and then increment the “test” variable, which means it will add 1 to “test”. In an example run, “test” would start out at 0, it would print “ok” to the screen and then “test” would be “test” + 1. It would then go back to the while condition and test if “test” is less than 5 which in this case “test” would be equal to 1 and so it would print “ok”, etc.

The for loop is similar to the while loop except that we will know before we enter the loop, how many times we will run the loop.

int test;
for (test = 0; test < 5; test++) {
printf(“ok”);
}

Notice how the “test” variable hasn’t been declared and we are assign the integer in the for loop. The for loop has three arguments, the starting count (test = 0), the condition (test < 5) and what to do after each loop which is usually increment the starting variable (test++). This example for loop would print “ok”5 times.

There is a data structure which is often used which is called an array. An array is a set of elements contained in a structure.

int myarray[50];
myarray[0] = 1234;

In the above code we are setting up an array of type int and setting 50 elements to be in that array. The next line shows us assigning the first element (yes, 0 is always the start of an array) of the array the value of 1234. In almost any source code that you will see, it will most likely contain an array of some sort, so it’s best that you learn about arrays.

Functions are useful if need to do something repetitive, for example, if your program were to print a list of numbers in an array on the screen you wouldn’t want to individually print each element of the array by writing the code, but rather use a function which could print all the elements of that array for you.

void myfunction () {
printf(“hi”);
}

In the above code, we have the function name “myfunction” which prints out “hi” to the screen. All functions need to return something once they have finished except if they have void before the function name. Void just means that this function will not return anything.

We can call our function “myfunction” by using: myfunction();

If we want to have a function return a certain value, be it an int, float, bool, etc, we can stick these types just before the function name as shown below.

int myfunction (int number) {
printf(“%i”, number);
return number;
}

What we are doing in the above function is we will be printing and returning the integer we receive in our function argument. So if we called int test = myfunction(5); it would print 5 to the screen and return 5 to the variable “test”.

Now the %i part of printf means that we will be replacing %i with an integer, in this case the integer is the taken from the “number” variable. We can use %f for printing out a float, %l for a long, etc.


Reading the source code

So that’s the basics of the C programming language which should get us through this tutorial. We are now ready to compile our first source code. We will be using the Wii template file instead of the Gamecube one as it’s actually got comments in the source which will help us to learn more.

Navigate to C:devkitProexamplesWiitemplate and open up the template.pnproj file which should open up with Programmer’s Notepad. When loaded, on the left hand side you will see the directory structure. Open up the template.c file by double clicking on it. You’ll now see the source code being displayed.

Below is the break down of source code for the template.c file.

#include
#include
#include
#include 

These are our include files, which specify the libraries we are including in our source code. “stdio” represents the Standard Input/Output library which lets us print text to the screen, read and write files, etc. “stdlib” represents the Standard Utilities Library, and so on. You’ll need to use at least these 4 libraries when compiling code for the Wii.

static void *xfb = NULL;
static GXRModeObj *rmode = NULL;

We can skip these lines for now, they are just variables which are used to show video on the screen.

int main(int argc, char **argv) {

This line is the start of our “main” function, which is the first piece of code that is run after our libraries and variable definitions.

Most of the lines below this line have comments so it’s pretty easy to know what the each line does. For every application you develop that you will need all the lines from “VIDEO_Init();” to “if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();”. These lines aren’t really too important to focus on so we can skip them for now.

printf("Hello World!");

This line is saying that we would want to write “Hello World!” on to the screen.

while(1) {

We are starting an infinite loop which will run the below code.

WPAD_ScanPads();

This tells the system that we want to read the controller state. This will let us get information such as which buttons were pressed, which ones were let go, etc. You will always need to call this function when inside a loop, otherwise when you run your application on the Wii, you won’t be able do anything with the controller.

u32 pressed = WPAD_ButtonsDown(0);

As the comments for this line read, the “pressed” variable will tell us if anything was pressed on the controller. If we pressed

if ( pressed & WPAD_BUTTON_HOME ) exit(0);

Here we are just checking firstly, if a button was pressed (“pressed”) and secondly if the Home button was the button that was pressed (“& WPAD_BUTTON_HOME”). If both these conditions are true, then the application will be terminated (“exit(0);”).

VIDEO_WaitVSync();

WaitVSync just waits for the Vertical Sync from the TV screen. It’s exactly the same as the option that you have in some computer games. If you didn’t have this line of code and your application was doing a lot of graphics displaying and clearing of the screen then the screen would begin to flicker (although that wouldn’t happen in computer games, the game fps would just speed up).

}

This bracket ends the indefinite loop.

return 0;

All C programs must return 0 at the end of the program. If you don’t return 0 then the compiler will complain because it won’t know where the end of the program is.
Compiling the source code

So we know understand the source code. It will firstly initialise the video and controller, print out “Hello World!” to the screen and wait for us to press the Home button on the Wiimote to exit. Go ahead and press Alt + 1 to compile the project.

You will see the following text in the Output window:

> "make"
template.c
linking ... template.elf
output ... template.dol

> Process Exit Code: 0
> Time Taken: 00:02

As you can see, we have run the “make” command and it has compiled the template.c file which contained our source. It then outputs the machine executable format, an elf and dol, either can be used on the Wii.

Another command which is useful is the “clean” command which can be run by pressing Alt + 2. The clean command removes all traces of the compiled project, so that you can re-compile the project from scratch. It’s always a good idea to run the clean command and then recompile from scratch when you make major changes to any files.


Dealing with Compiling errors

Now we’ll talk about dealing with compiling errors. Most of the time when the compiler complains about something it’s usually right and gives us the line number where the problem occurs.

Say we forget to put the ; after assigning something to a variable, the compiler responds with:

c:/devkitpro/examples/wii/template/source/template.c: In function 'main':
c:/devkitpro/examples/wii/template/source/template.c:21: error: expected ';' before 'rmode'

So the compiler tells us which function this error occurred in and leads us close to the line in question. The second line is highlighted in light purple and if you click on it, it jumps you straight to a line that is close to the error.

The compiler can also give you warning about things which still will work but they are something you should look at. For example, if I have int test; and didn’t use it anywhere in the project, the compiler would say:

c:/devkitpro/examples/wii/template/source/template.c: In function 'main':
c:/devkitpro/examples/wii/template/source/template.c:52: warning: unused variable 'test'

If you were to declare something like: int test = “ok”; which is incorrect as an integer can’t be a string then the compiler would say:

c:/devkitpro/examples/wii/template/source/template.c: In function 'main':
c:/devkitpro/examples/wii/template/source/template.c:52: warning: initialization makes integer from pointer without a cast

Most of the times reading what the compiler says does make sense. If it doesn’t you can always try to google the error message you are getting. Another thing to do if you’ve writing a whole heap of code all at once is to begin to comment out chunks of the code by using /* and */.

In the example below, the compiler will not compile the code that is inside the */ and */.

int test = 0;

/* if (test > 0) {
printf(“more than 0”);
} */

We’ve now got some fundamentals out of the way and now we can test out example project on the Wii. I’m assuming that you have the Homebrew Channel installed on your Wii. If not, you really should think about installing it, it makes things a lot easier.

In the C:devkitProexamplesWiitemplate directory you will see a template.dol and template.elf file. Rename the template.elf file to boot.elf. Create a new directory on your SD card in the /apps/ directory called “template”. Copy your boot.elf file to the directory you created (/apps/template/).

Put the SD card back in your Wii and launch the Homebrew Channel. You should now see the directory you created in the listing of applications on the Homebrew Channel. Click on the application and click Load.

You will then see it show on the screen “Hello World!” and there you have it, you’ve compiled your first project for the Nintendo Wii.

Did I miss something or was my explanation not correct? Let me know so I can add the correction in the post.


This entry was posted on Saturday, August 16th, 2008 at 9:27 pm and is filed under Wii Programming Tutorials. You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.

It was running inside of container, iiuc, it was privileged mode.

This was part of the log:

docker run -e TESTFLAGS -t --privileged --rm -v /home/binchen/go/src/github.com/opencontainers/runc:/go/src/github.com/opencontainers/runc runc_dev:master make localunittest

A full log below:
(I didn’t use sudo previously, just added it after seeing your response but seems didn’t make any difference)

Let me know if I supposed to run it differently.

binchen@m:~/go/src/github.com/opencontainers/runc$ sudo make test
[sudo] password for binchen:
make unittest integration rootlessintegration
make[1]: Entering directory /home/binchen/go/src/github.com/opencontainers/runc' docker build -t runc_dev:master . Sending build context to Docker daemon 34.15 MB Step 1 : FROM golang:1.8 ---> d31fe3d9c824 Step 2 : RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list ---> Using cache ---> 7f21c4f9c238 Step 3 : RUN apt-get update && apt-get install -y build-essential curl sudo gawk iptables jq pkg-config libaio-dev libcap-dev libprotobuf-dev libprotobuf-c0-dev libnl-3-dev libnet-dev libseccomp2/jessie-backports libseccomp-dev/jessie-backports protobuf-c-compiler protobuf-compiler python-minimal uidmap --no-install-recommends && apt-get clean ---> Using cache ---> 812e8718c3a7 Step 4 : RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless ---> Using cache ---> fd729c7e4be9 Step 5 : RUN cd /tmp && git clone https://github.com/sstephenson/bats.git && cd bats && git reset --hard 03608115df2071fff4eaaff1605768c275e5f81f && ./install.sh /usr/local && rm -rf /tmp/bats ---> Using cache ---> 4c1934cf2ab0 Step 6 : ENV CRIU_VERSION 3ca8e575b49763030d3ddfec4af190a4c9f9deef ---> Using cache ---> 5596e63f9229 Step 7 : RUN mkdir -p /usr/src/criu && curl -sSL https://github.com/xemul/criu/archive/${CRIU_VERSION}.tar.gz | tar -v -C /usr/src/criu/ -xz --strip-components=1 && cd /usr/src/criu && make install-criu && rm -rf /usr/src/criu ---> Using cache ---> 55da6bbbeb2a Step 8 : ENV ROOTFS /busybox ---> Using cache ---> 8c25b27623c5 Step 9 : RUN mkdir -p ${ROOTFS} ---> Using cache ---> 19ce1b040cbb Step 10 : COPY script/tmpmount / ---> Using cache ---> ed58427ed422 Step 11 : WORKDIR /go/src/github.com/opencontainers/runc ---> Using cache ---> 8406ab37c8ef Step 12 : ENTRYPOINT /tmpmount ---> Using cache ---> b43b1615b7c2 Step 13 : ADD . /go/src/github.com/opencontainers/runc ---> Using cache ---> 8c09e257c7f2 Step 14 : RUN . tests/integration/multi-arch.bash && curl -o- -sSL get_busybox` | tar xfJC — ${ROOTFS}
—> Using cache
—> ac4011db8b0a
Successfully built ac4011db8b0a
docker run -e TESTFLAGS -t —privileged —rm -v /home/binchen/go/src/github.com/opencontainers/runc:/go/src/github.com/opencontainers/runc runc_dev:master make localunittest
go test -timeout 3m -tags «seccomp» -v github.com/opencontainers/runc github.com/opencontainers/runc/contrib/cmd/recvtty github.com/opencontainers/runc/libcontainer github.com/opencontainers/runc/libcontainer/apparmor github.com/opencontainers/runc/libcontainer/cgroups github.com/opencontainers/runc/libcontainer/cgroups/fs github.com/opencontainers/runc/libcontainer/cgroups/systemd github.com/opencontainers/runc/libcontainer/configs github.com/opencontainers/runc/libcontainer/configs/validate github.com/opencontainers/runc/libcontainer/criurpc github.com/opencontainers/runc/libcontainer/devices github.com/opencontainers/runc/libcontainer/integration github.com/opencontainers/runc/libcontainer/intelrdt github.com/opencontainers/runc/libcontainer/keys github.com/opencontainers/runc/libcontainer/mount github.com/opencontainers/runc/libcontainer/nsenter github.com/opencontainers/runc/libcontainer/seccomp github.com/opencontainers/runc/libcontainer/specconv github.com/opencontainers/runc/libcontainer/stacktrace github.com/opencontainers/runc/libcontainer/system github.com/opencontainers/runc/libcontainer/user github.com/opencontainers/runc/libcontainer/utils
? github.com/opencontainers/runc [no test files]
? github.com/opencontainers/runc/contrib/cmd/recvtty [no test files]
=== RUN TestGetContainerPids
— PASS: TestGetContainerPids (0.00s)
=== RUN TestGetContainerStats
— PASS: TestGetContainerStats (0.00s)
=== RUN TestGetContainerState
— PASS: TestGetContainerState (0.00s)
=== RUN TestGetContainerStateAfterUpdate
— PASS: TestGetContainerStateAfterUpdate (0.00s)
=== RUN TestErrorCode
— PASS: TestErrorCode (0.00s)
=== RUN TestFactoryNew
— PASS: TestFactoryNew (0.00s)
=== RUN TestFactoryNewIntelRdt
— PASS: TestFactoryNewIntelRdt (0.00s)
=== RUN TestFactoryNewTmpfs
— PASS: TestFactoryNewTmpfs (0.03s)
=== RUN TestFactoryLoadNotExists
— PASS: TestFactoryLoadNotExists (0.00s)
=== RUN TestFactoryLoadContainer
time=»2018-02-06T22:51:02Z» level=warning msg=»cannot serialize hook of type libcontainer.unserializableHook, skipping»
— PASS: TestFactoryLoadContainer (0.00s)
=== RUN TestErrorDetail
— PASS: TestErrorDetail (0.00s)
=== RUN TestErrorWithCode
— PASS: TestErrorWithCode (0.00s)
=== RUN TestErrorWithError
— PASS: TestErrorWithError (0.00s)
=== RUN TestNotifyOnOOM
— PASS: TestNotifyOnOOM (0.00s)
=== RUN TestNotifyMemoryPressure
— PASS: TestNotifyMemoryPressure (0.00s)
=== RUN TestCheckMountDestOnProc
— PASS: TestCheckMountDestOnProc (0.00s)
=== RUN TestCheckMountDestInSys
— PASS: TestCheckMountDestInSys (0.00s)
=== RUN TestCheckMountDestFalsePositive
— PASS: TestCheckMountDestFalsePositive (0.00s)
=== RUN TestNeedsSetupDev
— PASS: TestNeedsSetupDev (0.00s)
=== RUN TestNeedsSetupDevStrangeSource
— PASS: TestNeedsSetupDevStrangeSource (0.00s)
=== RUN TestNeedsSetupDevStrangeDest
— PASS: TestNeedsSetupDevStrangeDest (0.00s)
=== RUN TestNeedsSetupDevStrangeSourceDest
— PASS: TestNeedsSetupDevStrangeSourceDest (0.00s)
=== RUN TestStateStatus
— PASS: TestStateStatus (0.00s)
=== RUN TestStoppedStateTransition
=== RUN TestStoppedStateTransition/stopped
=== RUN TestStoppedStateTransition/running
=== RUN TestStoppedStateTransition/running#01
=== RUN TestStoppedStateTransition/paused
=== RUN TestStoppedStateTransition/running#02
=== RUN TestStoppedStateTransition/created
— PASS: TestStoppedStateTransition (0.00s)
— PASS: TestStoppedStateTransition/stopped (0.00s)
— PASS: TestStoppedStateTransition/running (0.00s)
— PASS: TestStoppedStateTransition/running#01 (0.00s)
— PASS: TestStoppedStateTransition/paused (0.00s)
— PASS: TestStoppedStateTransition/running#02 (0.00s)
— PASS: TestStoppedStateTransition/created (0.00s)
=== RUN TestPausedStateTransition
=== RUN TestPausedStateTransition/paused
=== RUN TestPausedStateTransition/running
=== RUN TestPausedStateTransition/stopped
=== RUN TestPausedStateTransition/running#01
=== RUN TestPausedStateTransition/created
=== RUN TestPausedStateTransition/running#02
— PASS: TestPausedStateTransition (0.00s)
— PASS: TestPausedStateTransition/paused (0.00s)
— PASS: TestPausedStateTransition/running (0.00s)
— PASS: TestPausedStateTransition/stopped (0.00s)
— PASS: TestPausedStateTransition/running#01 (0.00s)
— PASS: TestPausedStateTransition/created (0.00s)
— PASS: TestPausedStateTransition/running#02 (0.00s)
=== RUN TestRestoredStateTransition
=== RUN TestRestoredStateTransition/stopped
=== RUN TestRestoredStateTransition/running
=== RUN TestRestoredStateTransition/running#01
=== RUN TestRestoredStateTransition/created
=== RUN TestRestoredStateTransition/running#02
=== RUN TestRestoredStateTransition/paused
— PASS: TestRestoredStateTransition (0.00s)
— PASS: TestRestoredStateTransition/stopped (0.00s)
— PASS: TestRestoredStateTransition/running (0.00s)
— PASS: TestRestoredStateTransition/running#01 (0.00s)
— PASS: TestRestoredStateTransition/created (0.00s)
— PASS: TestRestoredStateTransition/running#02 (0.00s)
— PASS: TestRestoredStateTransition/paused (0.00s)
=== RUN TestRunningStateTransition
=== RUN TestRunningStateTransition/stopped
=== RUN TestRunningStateTransition/paused
=== RUN TestRunningStateTransition/running
=== RUN TestRunningStateTransition/created
=== RUN TestRunningStateTransition/running#01
=== RUN TestRunningStateTransition/running#02
— PASS: TestRunningStateTransition (0.00s)
— PASS: TestRunningStateTransition/stopped (0.00s)
— PASS: TestRunningStateTransition/paused (0.00s)
— PASS: TestRunningStateTransition/running (0.00s)
— PASS: TestRunningStateTransition/created (0.00s)
— PASS: TestRunningStateTransition/running#01 (0.00s)
— PASS: TestRunningStateTransition/running#02 (0.00s)
=== RUN TestCreatedStateTransition
=== RUN TestCreatedStateTransition/stopped
=== RUN TestCreatedStateTransition/paused
=== RUN TestCreatedStateTransition/running
=== RUN TestCreatedStateTransition/created
=== RUN TestCreatedStateTransition/running#01
=== RUN TestCreatedStateTransition/running#02
— PASS: TestCreatedStateTransition (0.00s)
— PASS: TestCreatedStateTransition/stopped (0.00s)
— PASS: TestCreatedStateTransition/paused (0.00s)
— PASS: TestCreatedStateTransition/running (0.00s)
— PASS: TestCreatedStateTransition/created (0.00s)
— PASS: TestCreatedStateTransition/running#01 (0.00s)
— PASS: TestCreatedStateTransition/running#02 (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer 0.046s
? github.com/opencontainers/runc/libcontainer/apparmor [no test files]
=== RUN TestParseCgroups
— PASS: TestParseCgroups (0.00s)
=== RUN TestGetCgroupMounts
— PASS: TestGetCgroupMounts (0.00s)
=== RUN TestParseCgroupString
— PASS: TestParseCgroupString (0.00s)
=== RUN TestIgnoreCgroup2Mount
— PASS: TestIgnoreCgroup2Mount (0.00s)
=== RUN TestGetClosestMountpointAncestor
— PASS: TestGetClosestMountpointAncestor (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/cgroups 0.002s
=== RUN TestInvalidCgroupPath
— PASS: TestInvalidCgroupPath (0.00s)
=== RUN TestInvalidAbsoluteCgroupPath
— PASS: TestInvalidAbsoluteCgroupPath (0.00s)
=== RUN TestInvalidCgroupParent
— PASS: TestInvalidCgroupParent (0.00s)
=== RUN TestInvalidAbsoluteCgroupParent
— PASS: TestInvalidAbsoluteCgroupParent (0.00s)
=== RUN TestInvalidCgroupName
— PASS: TestInvalidCgroupName (0.00s)
=== RUN TestInvalidAbsoluteCgroupName
— PASS: TestInvalidAbsoluteCgroupName (0.00s)
=== RUN TestInvalidCgroupNameAndParent
— PASS: TestInvalidCgroupNameAndParent (0.00s)
=== RUN TestInvalidAbsoluteCgroupNameAndParent
— PASS: TestInvalidAbsoluteCgroupNameAndParent (0.00s)
=== RUN TestBlkioSetWeight
— PASS: TestBlkioSetWeight (0.00s)
=== RUN TestBlkioSetWeightDevice
— PASS: TestBlkioSetWeightDevice (0.00s)
=== RUN TestBlkioSetMultipleWeightDevice
— PASS: TestBlkioSetMultipleWeightDevice (0.00s)
=== RUN TestBlkioStats
— PASS: TestBlkioStats (0.00s)
=== RUN TestBlkioStatsNoSectorsFile
— PASS: TestBlkioStatsNoSectorsFile (0.00s)
=== RUN TestBlkioStatsNoServiceBytesFile
— PASS: TestBlkioStatsNoServiceBytesFile (0.00s)
=== RUN TestBlkioStatsNoServicedFile
— PASS: TestBlkioStatsNoServicedFile (0.00s)
=== RUN TestBlkioStatsNoQueuedFile
— PASS: TestBlkioStatsNoQueuedFile (0.00s)
=== RUN TestBlkioStatsNoServiceTimeFile
— PASS: TestBlkioStatsNoServiceTimeFile (0.00s)
=== RUN TestBlkioStatsNoWaitTimeFile
— PASS: TestBlkioStatsNoWaitTimeFile (0.00s)
=== RUN TestBlkioStatsNoMergedFile
— PASS: TestBlkioStatsNoMergedFile (0.00s)
=== RUN TestBlkioStatsNoTimeFile
— PASS: TestBlkioStatsNoTimeFile (0.00s)
=== RUN TestBlkioStatsUnexpectedNumberOfFields
— PASS: TestBlkioStatsUnexpectedNumberOfFields (0.00s)
=== RUN TestBlkioStatsUnexpectedFieldType
— PASS: TestBlkioStatsUnexpectedFieldType (0.00s)
=== RUN TestNonCFQBlkioStats
— PASS: TestNonCFQBlkioStats (0.00s)
=== RUN TestBlkioSetThrottleReadBpsDevice
— PASS: TestBlkioSetThrottleReadBpsDevice (0.00s)
=== RUN TestBlkioSetThrottleWriteBpsDevice
— PASS: TestBlkioSetThrottleWriteBpsDevice (0.00s)
=== RUN TestBlkioSetThrottleReadIOpsDevice
— PASS: TestBlkioSetThrottleReadIOpsDevice (0.00s)
=== RUN TestBlkioSetThrottleWriteIOpsDevice
— PASS: TestBlkioSetThrottleWriteIOpsDevice (0.00s)
=== RUN TestCpuSetShares
— PASS: TestCpuSetShares (0.00s)
=== RUN TestCpuSetBandWidth
— PASS: TestCpuSetBandWidth (0.00s)
=== RUN TestCpuStats
— PASS: TestCpuStats (0.00s)
=== RUN TestNoCpuStatFile
— PASS: TestNoCpuStatFile (0.00s)
=== RUN TestInvalidCpuStat
— PASS: TestInvalidCpuStat (0.00s)
=== RUN TestCpuSetRtSchedAtApply
— PASS: TestCpuSetRtSchedAtApply (0.00s)
=== RUN TestCpusetSetCpus
— PASS: TestCpusetSetCpus (0.00s)
=== RUN TestCpusetSetMems
— PASS: TestCpusetSetMems (0.00s)
=== RUN TestDevicesSetAllow
— PASS: TestDevicesSetAllow (0.00s)
=== RUN TestDevicesSetDeny
— PASS: TestDevicesSetDeny (0.00s)
=== RUN TestFreezerSetState
— PASS: TestFreezerSetState (0.00s)
=== RUN TestFreezerSetInvalidState
— PASS: TestFreezerSetInvalidState (0.00s)
=== RUN TestHugetlbSetHugetlb
— PASS: TestHugetlbSetHugetlb (0.00s)
=== RUN TestHugetlbStats
— PASS: TestHugetlbStats (0.00s)
=== RUN TestHugetlbStatsNoUsageFile
— PASS: TestHugetlbStatsNoUsageFile (0.00s)
=== RUN TestHugetlbStatsNoMaxUsageFile
— PASS: TestHugetlbStatsNoMaxUsageFile (0.00s)
=== RUN TestHugetlbStatsBadUsageFile
— PASS: TestHugetlbStatsBadUsageFile (0.00s)
=== RUN TestHugetlbStatsBadMaxUsageFile
— PASS: TestHugetlbStatsBadMaxUsageFile (0.00s)
=== RUN TestMemorySetMemory
— PASS: TestMemorySetMemory (0.00s)
=== RUN TestMemorySetMemoryswap
— PASS: TestMemorySetMemoryswap (0.00s)
=== RUN TestMemorySetMemoryLargerThanSwap
— PASS: TestMemorySetMemoryLargerThanSwap (0.00s)
=== RUN TestMemorySetSwapSmallerThanMemory
— PASS: TestMemorySetSwapSmallerThanMemory (0.00s)
=== RUN TestMemorySetKernelMemory
— PASS: TestMemorySetKernelMemory (0.00s)
=== RUN TestMemorySetKernelMemoryTCP
— PASS: TestMemorySetKernelMemoryTCP (0.00s)
=== RUN TestMemorySetMemorySwappinessDefault
— PASS: TestMemorySetMemorySwappinessDefault (0.00s)
=== RUN TestMemoryStats
— PASS: TestMemoryStats (0.00s)
=== RUN TestMemoryStatsNoStatFile
— PASS: TestMemoryStatsNoStatFile (0.00s)
=== RUN TestMemoryStatsNoUsageFile
— PASS: TestMemoryStatsNoUsageFile (0.00s)
=== RUN TestMemoryStatsNoMaxUsageFile
— PASS: TestMemoryStatsNoMaxUsageFile (0.00s)
=== RUN TestMemoryStatsNoLimitInBytesFile
— PASS: TestMemoryStatsNoLimitInBytesFile (0.00s)
=== RUN TestMemoryStatsBadStatFile
— PASS: TestMemoryStatsBadStatFile (0.00s)
=== RUN TestMemoryStatsBadUsageFile
— PASS: TestMemoryStatsBadUsageFile (0.00s)
=== RUN TestMemoryStatsBadMaxUsageFile
— PASS: TestMemoryStatsBadMaxUsageFile (0.00s)
=== RUN TestMemoryStatsBadLimitInBytesFile
— PASS: TestMemoryStatsBadLimitInBytesFile (0.00s)
=== RUN TestMemorySetOomControl
— PASS: TestMemorySetOomControl (0.00s)
=== RUN TestNetClsSetClassid
— PASS: TestNetClsSetClassid (0.00s)
=== RUN TestNetPrioSetIfPrio
— PASS: TestNetPrioSetIfPrio (0.00s)
=== RUN TestPidsSetMax
— PASS: TestPidsSetMax (0.00s)
=== RUN TestPidsSetUnlimited
— PASS: TestPidsSetUnlimited (0.00s)
=== RUN TestPidsStats
— PASS: TestPidsStats (0.00s)
=== RUN TestPidsStatsUnlimited
— PASS: TestPidsStatsUnlimited (0.00s)
=== RUN TestGetCgroupParamsInt
— PASS: TestGetCgroupParamsInt (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/cgroups/fs 0.026s
? github.com/opencontainers/runc/libcontainer/cgroups/systemd [no test files]
=== RUN TestRemoveNamespace
— PASS: TestRemoveNamespace (0.00s)
=== RUN TestHostRootUIDNoUSERNS
— PASS: TestHostRootUIDNoUSERNS (0.00s)
=== RUN TestHostRootUIDWithUSERNS
— PASS: TestHostRootUIDWithUSERNS (0.00s)
=== RUN TestHostRootGIDNoUSERNS
— PASS: TestHostRootGIDNoUSERNS (0.00s)
=== RUN TestHostRootGIDWithUSERNS
— PASS: TestHostRootGIDWithUSERNS (0.00s)
=== RUN TestUnmarshalHooks
— PASS: TestUnmarshalHooks (0.00s)
=== RUN TestUnmarshalHooksWithInvalidData
— PASS: TestUnmarshalHooksWithInvalidData (0.00s)
=== RUN TestMarshalHooks
— PASS: TestMarshalHooks (0.00s)
=== RUN TestMarshalUnmarshalHooks
— PASS: TestMarshalUnmarshalHooks (0.00s)
=== RUN TestMarshalHooksWithUnexpectedType
time=»2018-02-06T22:51:01Z» level=warning msg=»cannot serialize hook of type configs.FuncHook, skipping»
— PASS: TestMarshalHooksWithUnexpectedType (0.00s)
=== RUN TestFuncHookRun
— PASS: TestFuncHookRun (0.00s)
=== RUN TestCommandHookRun
— PASS: TestCommandHookRun (0.02s)
=== RUN TestCommandHookRunTimeout
— PASS: TestCommandHookRunTimeout (0.02s)
=== RUN TestHelperProcess
Helper Process
ok github.com/opencontainers/runc/libcontainer/configs 0.056s
=== RUN TestValidateRootless
— PASS: TestValidateRootless (0.00s)
=== RUN TestValidateRootlessUserns
— PASS: TestValidateRootlessUserns (0.00s)
=== RUN TestValidateRootlessMappingUid
— PASS: TestValidateRootlessMappingUid (0.00s)
=== RUN TestValidateRootlessMappingGid
— PASS: TestValidateRootlessMappingGid (0.00s)
=== RUN TestValidateRootlessMountUid
— PASS: TestValidateRootlessMountUid (0.00s)
=== RUN TestValidateRootlessMountGid
— PASS: TestValidateRootlessMountGid (0.00s)
=== RUN TestValidate
— PASS: TestValidate (0.00s)
=== RUN TestValidateWithInvalidRootfs
— PASS: TestValidateWithInvalidRootfs (0.00s)
=== RUN TestValidateNetworkWithoutNETNamespace
— PASS: TestValidateNetworkWithoutNETNamespace (0.00s)
=== RUN TestValidateNetworkRoutesWithoutNETNamespace
— PASS: TestValidateNetworkRoutesWithoutNETNamespace (0.00s)
=== RUN TestValidateHostname
— PASS: TestValidateHostname (0.00s)
=== RUN TestValidateHostnameWithoutUTSNamespace
— PASS: TestValidateHostnameWithoutUTSNamespace (0.00s)
=== RUN TestValidateSecurityWithMaskPaths
— PASS: TestValidateSecurityWithMaskPaths (0.00s)
=== RUN TestValidateSecurityWithROPaths
— PASS: TestValidateSecurityWithROPaths (0.00s)
=== RUN TestValidateSecurityWithoutNEWNS
— PASS: TestValidateSecurityWithoutNEWNS (0.00s)
=== RUN TestValidateUsernamespace
— PASS: TestValidateUsernamespace (0.00s)
=== RUN TestValidateUsernamespaceWithoutUserNS
— PASS: TestValidateUsernamespaceWithoutUserNS (0.00s)
=== RUN TestValidateSysctl
— PASS: TestValidateSysctl (0.00s)
=== RUN TestValidateValidSysctl
— PASS: TestValidateValidSysctl (0.00s)
=== RUN TestValidateSysctlWithSameNs
— PASS: TestValidateSysctlWithSameNs (0.00s)
=== RUN TestValidateSysctlWithoutNETNamespace
— PASS: TestValidateSysctlWithoutNETNamespace (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/configs/validate 0.031s
? github.com/opencontainers/runc/libcontainer/criurpc [no test files]
=== RUN TestDeviceFromPathLstatFailure
— PASS: TestDeviceFromPathLstatFailure (0.00s)
=== RUN TestHostDevicesIoutilReadDirFailure
— PASS: TestHostDevicesIoutilReadDirFailure (0.00s)
=== RUN TestHostDevicesIoutilReadDirDeepFailure
— PASS: TestHostDevicesIoutilReadDirDeepFailure (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/devices 0.031s
=== RUN TestUsernsCheckpoint
— SKIP: TestUsernsCheckpoint (0.00s)
checkpoint_test.go:49: Unable to c/r a container with userns
=== RUN TestCheckpoint
— FAIL: TestCheckpoint (0.29s)
checkpoint_test.go:20: === /tmp/criu-parent010604716/dump.log ===
checkpoint_test.go:31: (00.000038) Enforcing memory tracking for pre-dump.
checkpoint_test.go:31: (00.000056) Enforcing tasks run after pre-dump.
checkpoint_test.go:31: (00.000106) Warn (criu/kerndat.c:780): Can’t load /run/criu.kdat
checkpoint_test.go:31: (00.000116) Probing sock diag modules
checkpoint_test.go:31: (00.000143) Done probing
checkpoint_test.go:31: (00.009488) Pagemap is fully functional
checkpoint_test.go:31: (00.009536) Found anon-shmem device at 4
checkpoint_test.go:31: (00.009540) Reset 1315’s dirty tracking
checkpoint_test.go:31: (00.009581) … done
checkpoint_test.go:31: (00.009592) Dirty track supported on kernel
checkpoint_test.go:31: (00.009625) Found task size of 7ffffffff000
checkpoint_test.go:31: (00.015324) Warn (criu/net.c:2504): Unable to get a socket network namespace
checkpoint_test.go:31: (00.015345) Warn (criu/libnetlink.c:55): ERROR -95 reported by netlink
checkpoint_test.go:31: (00.015347) Error (criu/kerndat.c:640): NSID is not supported
checkpoint_test.go:31: (00.015378) Found mmap_min_addr 0x10000
checkpoint_test.go:31: (00.015385) files stat: fs/file-max 1609434, fs/nr_open 1048576
checkpoint_test.go:31: (00.015402) Unfreezing tasks into 1
checkpoint_test.go:31: (00.015421) Error (criu/cr-dump.c:1602): Pre-dumping FAILED.
checkpoint_test.go:38: === END ===
checkpoint_test.go:147: criu failed: type PRE_DUMP errno 0
log file: /tmp/criu-parent010604716/dump.log
=== RUN TestExecPS
panic: test timed out after 3m0s

goroutine 23 [running]:
testing.startAlarm.func1()
/usr/local/go/src/testing/testing.go:1023 +0xf9
created by time.goFunc
/usr/local/go/src/time/sleep.go:170 +0x44

goroutine 1 [chan receive]:
testing.(*T).Run(0xc4200652b0, 0x78aac1, 0xa, 0x79d158, 0xc4200ebc00)
/usr/local/go/src/testing/testing.go:698 +0x2f4
testing.runTests.func1(0xc4200652b0)
/usr/local/go/src/testing/testing.go:882 +0x67
testing.tRunner(0xc4200652b0, 0xc4200ebd48)
/usr/local/go/src/testing/testing.go:657 +0x96
testing.runTests(0xc4200be780, 0xb12d00, 0x37, 0x37, 0x7f880815c000)
/usr/local/go/src/testing/testing.go:888 +0x2c1
testing.(*M).Run(0xc4200ebf20, 0xf)
/usr/local/go/src/testing/testing.go:822 +0xfc
github.com/opencontainers/runc/libcontainer/integration.TestMain(0xc4200ebf20)
/go/src/github.com/opencontainers/runc/libcontainer/integration/init_test.go:59 +0x15e
main.main()
github.com/opencontainers/runc/libcontainer/integration/_test/_testmain.go:148 +0xf7

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2197 +0x1

goroutine 21 [syscall]:
syscall.Syscall6(0xf7, 0x1, 0x534, 0xc42004b7a8, 0x1000004, 0x0, 0x0, 0x49939c, 0x4, 0xc4200c2f30)
/usr/local/go/src/syscall/asm_linux_amd64.s:44 +0x5
os.(*Process).blockUntilWaitable(0xc4200c2fc0, 0xc42004b8c0, 0x4e3bb3, 0xc42000e170)
/usr/local/go/src/os/wait_waitid.go:28 +0xa5
os.(*Process).wait(0xc4200c2fc0, 0x0, 0x0, 0xc4200fa2c0)
/usr/local/go/src/os/exec_unix.go:22 +0x4d
os.(*Process).Wait(0xc4200c2fc0, 0x0, 0xc42004b988, 0x471788)
/usr/local/go/src/os/exec.go:115 +0x2b
github.com/opencontainers/runc/libcontainer.(*initProcess).execSetns(0xc420069980, 0xc42000e170, 0xb15c20)
/go/src/github.com/opencontainers/runc/libcontainer/process_linux.go:233 +0x3c
github.com/opencontainers/runc/libcontainer.(*initProcess).start(0xc420069980, 0x0, 0x0)
/go/src/github.com/opencontainers/runc/libcontainer/process_linux.go:300 +0x29e
github.com/opencontainers/runc/libcontainer.(*linuxContainer).start(0xc42037a000, 0xc4200b25a0, 0x1, 0x0, 0xc4200b25a0)
/go/src/github.com/opencontainers/runc/libcontainer/container_linux.go:343 +0x93
github.com/opencontainers/runc/libcontainer.(*linuxContainer).Start(0xc42037a000, 0xc4200b25a0, 0x0, 0x0)
/go/src/github.com/opencontainers/runc/libcontainer/container_linux.go:237 +0xd8
github.com/opencontainers/runc/libcontainer.(*linuxContainer).Run(0xc42037a000, 0xc4200b25a0, 0xc42037a000, 0x0)
/go/src/github.com/opencontainers/runc/libcontainer/container_linux.go:254 +0x98
github.com/opencontainers/runc/libcontainer/integration.runContainer(0xc420378000, 0x0, 0x0, 0xc4200c2d80, 0x3, 0x3, 0xc4200bede0, 0x0, 0x0, 0x0)
/go/src/github.com/opencontainers/runc/libcontainer/integration/utils_test.go:153 +0x375
github.com/opencontainers/runc/libcontainer/integration.testExecPS(0xc42034ac30, 0xc41f2da000)
/go/src/github.com/opencontainers/runc/libcontainer/integration/exec_test.go:48 +0x188
github.com/opencontainers/runc/libcontainer/integration.TestExecPS(0xc42034ac30)
/go/src/github.com/opencontainers/runc/libcontainer/integration/exec_test.go:24 +0x30
testing.tRunner(0xc42034ac30, 0x79d158)
/usr/local/go/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
/usr/local/go/src/testing/testing.go:697 +0x2ca

goroutine 11 [syscall]:
syscall.Syscall(0x0, 0xb, 0xc420386000, 0x200, 0x7f880815c4b0, 0x219, 0xc420386000)
/usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.read(0xb, 0xc420386000, 0x200, 0x200, 0xc4200da1e0, 0x7f880815c4b0, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:783 +0x55
syscall.Read(0xb, 0xc420386000, 0x200, 0x200, 0x42dcbf, 0x79cd80, 0xc42002edc0)
/usr/local/go/src/syscall/syscall_unix.go:162 +0x49
os.(*File).read(0xc42000e1b0, 0xc420386000, 0x200, 0x200, 0x4e018b, 0x714480, 0x200)
/usr/local/go/src/os/file_unix.go:165 +0x4f
os.(*File).Read(0xc42000e1b0, 0xc420386000, 0x200, 0x200, 0x436ebe, 0xc4200c6820, 0xc42002ee60)
/usr/local/go/src/os/file.go:101 +0x76
bytes.(*Buffer).ReadFrom(0xc4200acfc0, 0xb16620, 0xc42000e1b0, 0x7f88080bc028, 0xc4200acfc0, 0xc42002ef01)
/usr/local/go/src/bytes/buffer.go:179 +0x160
io.copyBuffer(0xb15be0, 0xc4200acfc0, 0xb16620, 0xc42000e1b0, 0x0, 0x0, 0x0, 0xc420018f58, 0x0, 0x0)
/usr/local/go/src/io/io.go:384 +0x2cb
io.Copy(0xb15be0, 0xc4200acfc0, 0xb16620, 0xc42000e1b0, 0x710800, 0xc420018f00, 0xc42002efb0)
/usr/local/go/src/io/io.go:360 +0x68
os/exec.(*Cmd).writerDescriptor.func1(0x710800, 0xc420018f00)
/usr/local/go/src/os/exec/exec.go:254 +0x4d
os/exec.(*Cmd).Start.func1(0xc4200a71e0, 0xc4200bf000)
/usr/local/go/src/os/exec/exec.go:371 +0x27
created by os/exec.(*Cmd).Start
/usr/local/go/src/os/exec/exec.go:372 +0x4e4

goroutine 18 [syscall]:
syscall.Syscall(0x0, 0x8, 0xc42008cc00, 0x200, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.read(0x8, 0xc42008cc00, 0x200, 0x200, 0xc4200c2cc0, 0x7f880815c000, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:783 +0x55
syscall.Read(0x8, 0xc42008cc00, 0x200, 0x200, 0x42dcbf, 0x79cd80, 0xc4200285c0)
/usr/local/go/src/syscall/syscall_unix.go:162 +0x49
os.(*File).read(0xc4200ee088, 0xc42008cc00, 0x200, 0x200, 0x4e018b, 0x714480, 0x200)
/usr/local/go/src/os/file_unix.go:165 +0x4f
os.(*File).Read(0xc4200ee088, 0xc42008cc00, 0x200, 0x200, 0x0, 0x0, 0xc420028660)
/usr/local/go/src/os/file.go:101 +0x76
bytes.(*Buffer).ReadFrom(0xc420116000, 0xb16620, 0xc4200ee088, 0x7f88080bc028, 0xc420116000, 0x1)
/usr/local/go/src/bytes/buffer.go:179 +0x160
io.copyBuffer(0xb15be0, 0xc420116000, 0xb16620, 0xc4200ee088, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/io/io.go:384 +0x2cb
io.Copy(0xb15be0, 0xc420116000, 0xb16620, 0xc4200ee088, 0x0, 0x0, 0x0)
/usr/local/go/src/io/io.go:360 +0x68
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
/usr/local/go/src/os/exec/exec.go:254 +0x4d
os/exec.(*Cmd).Start.func1(0xc420118000, 0xc4200f2440)
/usr/local/go/src/os/exec/exec.go:371 +0x27
created by os/exec.(*Cmd).Start
/usr/local/go/src/os/exec/exec.go:372 +0x4e4

goroutine 12 [syscall]:
syscall.Syscall(0x0, 0xd, 0xc42034e200, 0x200, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5
syscall.read(0xd, 0xc42034e200, 0x200, 0x200, 0xc4200f0390, 0x7f880815c960, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:783 +0x55
syscall.Read(0xd, 0xc42034e200, 0x200, 0x200, 0x42dcbf, 0x79cd80, 0xc42002f5c0)
/usr/local/go/src/syscall/syscall_unix.go:162 +0x49
os.(*File).read(0xc42000e1c0, 0xc42034e200, 0x200, 0x200, 0x4e018b, 0x714480, 0x200)
/usr/local/go/src/os/file_unix.go:165 +0x4f
os.(*File).Read(0xc42000e1c0, 0xc42034e200, 0x200, 0x200, 0x0, 0x0, 0xc42002f660)
/usr/local/go/src/os/file.go:101 +0x76
bytes.(*Buffer).ReadFrom(0xc4200ad030, 0xb16620, 0xc42000e1c0, 0x7f88080bc028, 0xc4200ad030, 0x1)
/usr/local/go/src/bytes/buffer.go:179 +0x160
io.copyBuffer(0xb15be0, 0xc4200ad030, 0xb16620, 0xc42000e1c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/io/io.go:384 +0x2cb
io.Copy(0xb15be0, 0xc4200ad030, 0xb16620, 0xc42000e1c0, 0x0, 0x0, 0x0)
/usr/local/go/src/io/io.go:360 +0x68
os/exec.(*Cmd).writerDescriptor.func1(0x0, 0x0)
/usr/local/go/src/os/exec/exec.go:254 +0x4d
os/exec.(*Cmd).Start.func1(0xc4200a71e0, 0xc4200bf060)
/usr/local/go/src/os/exec/exec.go:371 +0x27
created by os/exec.(*Cmd).Start
/usr/local/go/src/os/exec/exec.go:372 +0x4e4
FAIL github.com/opencontainers/runc/libcontainer/integration 180.007s
=== RUN TestIntelRdtSetL3CacheSchema
— PASS: TestIntelRdtSetL3CacheSchema (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/intelrdt 0.002s
? github.com/opencontainers/runc/libcontainer/keys [no test files]
? github.com/opencontainers/runc/libcontainer/mount [no test files]
=== RUN TestNsenterValidPaths
— PASS: TestNsenterValidPaths (0.05s)
=== RUN TestNsenterInvalidPaths
— PASS: TestNsenterInvalidPaths (0.00s)
=== RUN TestNsenterIncorrectPathType
— PASS: TestNsenterIncorrectPathType (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/nsenter 0.053s
=== RUN TestParseStatusFile
— PASS: TestParseStatusFile (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/seccomp 0.053s
=== RUN TestCreateCommandHookTimeout
— PASS: TestCreateCommandHookTimeout (0.00s)
=== RUN TestCreateHooks
— PASS: TestCreateHooks (0.00s)
=== RUN TestSetupSeccomp
— PASS: TestSetupSeccomp (0.00s)
=== RUN TestLinuxCgroupWithMemoryResource
— PASS: TestLinuxCgroupWithMemoryResource (0.00s)
=== RUN TestLinuxCgroupSystemd
— PASS: TestLinuxCgroupSystemd (0.00s)
=== RUN TestLinuxCgroupSystemdWithEmptyPath
— PASS: TestLinuxCgroupSystemdWithEmptyPath (0.00s)
=== RUN TestLinuxCgroupSystemdWithInvalidPath
— PASS: TestLinuxCgroupSystemdWithInvalidPath (0.00s)
=== RUN TestLinuxCgroupsPathSpecified
— PASS: TestLinuxCgroupsPathSpecified (0.00s)
=== RUN TestLinuxCgroupsPathNotSpecified
— PASS: TestLinuxCgroupsPathNotSpecified (0.00s)
=== RUN TestSpecconvExampleValidate
— PASS: TestSpecconvExampleValidate (0.00s)
=== RUN TestDupNamespaces
— PASS: TestDupNamespaces (0.00s)
=== RUN TestRootlessSpecconvValidate
— PASS: TestRootlessSpecconvValidate (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/specconv 0.059s
=== RUN TestCaptureTestFunc
— PASS: TestCaptureTestFunc (0.00s)
=== RUN TestParsePackageName
— PASS: TestParsePackageName (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/stacktrace 0.014s
=== RUN TestParseStartTime
— PASS: TestParseStartTime (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/system 0.002s
=== RUN TestUserParseLine
— PASS: TestUserParseLine (0.00s)
=== RUN TestUserParsePasswd
— PASS: TestUserParsePasswd (0.00s)
=== RUN TestUserParseGroup
— PASS: TestUserParseGroup (0.00s)
=== RUN TestValidGetExecUser
— PASS: TestValidGetExecUser (0.00s)
=== RUN TestInvalidGetExecUser
— PASS: TestInvalidGetExecUser (0.00s)
=== RUN TestGetExecUserNilSources
— PASS: TestGetExecUserNilSources (0.00s)
=== RUN TestGetAdditionalGroups
— PASS: TestGetAdditionalGroups (0.00s)
=== RUN TestGetAdditionalGroupsNumeric
— PASS: TestGetAdditionalGroupsNumeric (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/user 0.007s
=== RUN TestGenerateName
— PASS: TestGenerateName (0.00s)
=== RUN TestSearchLabels
— PASS: TestSearchLabels (0.00s)
=== RUN TestResolveRootfs
— PASS: TestResolveRootfs (0.00s)
=== RUN TestResolveRootfsWithSymlink
— PASS: TestResolveRootfsWithSymlink (0.00s)
=== RUN TestResolveRootfsWithNonExistingDir
— PASS: TestResolveRootfsWithNonExistingDir (0.00s)
=== RUN TestExitStatus
— PASS: TestExitStatus (0.00s)
=== RUN TestExitStatusSignaled
— PASS: TestExitStatusSignaled (0.00s)
=== RUN TestWriteJSON
— PASS: TestWriteJSON (0.00s)
=== RUN TestCleanPath
— PASS: TestCleanPath (0.00s)
PASS
ok github.com/opencontainers/runc/libcontainer/utils 0.005s
Makefile:71: recipe for target ‘localunittest’ failed
make: *** [localunittest] Error 1
^Cmake[1]: *** [unittest] Error 2
make: *** [test] Interrupt

I read the Help CDT Before you Begin, and I already did what it said, i.e., «the MinGW bin directory is placed in your path.»

So, I think the problem is with the installation of MSYS. I reviewed those instructions and tried to do that installation, but it seems to have failed. It did create a directory c:mysys, but there’s nothing in it.

In trying to install, I got two error messages:

Источник

Не удается создать файл: «Ошибка makefile XX: синтаксическая ошибка команды»

Для задачи у меня есть Makefile с этим контентом:

В той же папке, что и Makefile, у меня есть файл program.c, который я хотел бы выполнить. Содержимое этого файла здесь не имеет значения, потому что я даже не могу скомпилировать файл .c с предоставленным Makefile. Поэтому, когда я открываю окно cmd и набираю make или make all , отображаются следующие строки:

Makefile был предоставлен моими руководителями для этой задачи и отлично работает, как и предполагалось для моих друзей, но, как ни странно, не для меня.

Я попытался решить эту проблему, установив CMake от Kitware, но он дает мне те же ошибки. Я бегаю на Windows 10 (64-разрядная).

Заранее спасибо! T.T

Вы уверены, что все команды в makefile начинаются с символа табуляции?

Да, я почти уверен. Я зашел в Makefile и вручную вставил в строки символ табуляции. Однако выполнение «make» дает мне те же ошибки. Я также не понимаю, почему там написано, что в строке 50 есть синтаксическая ошибка, когда строка 50 пуста.

Засорение большого количества команд префиксами @ затрудняет отладку, и, как правило, этого следует избегать. Когда Makefile заработает, запустите его с make -s , если вы не хотите видеть, что вы делаете.

У вас есть рабочие gcc и doxygen ? Поддерживает ли Embarcadero make расширения GNU Make, которые вы, кажется, используете? (Их примеры выглядят так, как будто их синтаксис для условных операторов — !if )

Если подумать, используете ли вы версию make , которая действительно понимает этот файл? Судя по первой строке сообщения об ошибке, это определенно не GNU Make .

Спасибо за ответы! На самом деле, вполне возможно, что я использую «неправильную версию make». В качестве скраба я прошу прощения за этот вопрос новичка, но что я должен делать, если я хочу установить, например gcc?

Измените строку 19 на @$(MAKE) force=TRUE , чтобы избежать повторного выбора неправильной версии make в правиле force . (на самом деле, полностью избавьтесь от этой цели — использование FORCE в том виде, в котором она у вас есть, подвержено ошибкам)

Привет! Мне удалось установить MinGW, а также добавить путь к нему в Advanced Settings> Systemvariables в Windows, но похоже, что для этой операции используется «Make» от Embarcado, а не от MinGW.

@arved: пожалуйста, не создавайте теги с названиями компаний. Добавленный вами тег не имеет реального использования, поскольку он не определяет отдельную концепцию или продукт и был удален ранее.

Источник

Отладка Makefile /часть 2/

В этой части поговорим об общих методах и проблемах отладки. В конечном итоге, отладка — это солянка из всего, что работает в данной конкретной ситуации. Эти методы работают для меня и мне приходится полагаться на них даже в случае проблем с простейшими makefile. Может быть, они помогут и тебе тоже.

Один из очень раздражающих багов в make 3.80 был в сообщении об ошибке в makefile, где make указывал номер строки, и обычно этот номер строки был неверный. Я не удосужился исследовать из-за чего эта проблема возникает: из-за импортируемых файлов, присваиваний многострочных переменных или из-за пользовательских макросов. Обычно, make дает номер строки больше чем должен был бы. В сложных makefile бывает что номер не совпадает на 20 строк.

Часто наиболее простой путь увидеть значение переменной это напечатать его в ходе выполнения цели. И хотя распечатать легко можно с помощью warning , в долгой перспективе поможет сэкономить много времени немного усилий на добавление общей цели debug для вывода переменных. Вот примерный код цели debug :

Для того чтобы использовать её, нужно перечислить имена переменных которые надо распечатать в командной строке и собрать debug цель:

Если уж совсем делать всё волшебно, то можно использовать MAKECMDGOALS переменную, чтобы избежать присвоения переменной V :

Теперь можно выводить переменные просто перечислив их в командной строке. Однако, я не рекомендую этот способ, так как предупреждения make о невозможности обновлении переменных (так как они указаны как цели) могут сбить с толку:

В то время как make выводит команды из сценариев цели до их выполнения, он не выводит команды выполняющиеся в shell функции. Часто эти команды сложные и неуловимые в том плане, что могут выполняться как незамедлительно, так и в отложенной манере, если они были вызваны в значении рекурсивной переменной. Один из способов увидеть эти команды — включить отладку в самой оболочке:

Если это запустить с опцией отладки sh , мы увидим:

Можно заметить, что также выводятся значения всех переменных и выражений.

Часто встречаются сильно вложенные выражения, например, для оперирования с именами файлов:

Ничего хорошего в отладке таких выражений нет. Один из разумных подходов будет их разворот и печать каждого подвыражения:

Весьма нудно, но без настоящего отладчика это лучший путь (иногда единственный) для определения значений различных подвыражений.

Общие сообщения об ошибках

В руководстве make есть замечательный раздел со списком сообщений об ошибках make и их причин. Мы рассмотрим немного из наиболее часто встречаемых. Некоторые описанные проблемы, строго говоря, не являются ошибками make , такие как синтаксические в командных сценариях, но все же обычными проблемами для разработчиков. Полный список смотри в руководстве.

Сообщение make об ошибке имеет стандартный формат:

где makefile строка — это имя файла или импортированного файла в котором произошла ошибка. Следующая часть — номер строки, в которой произошла ошибка, далее следуют три звездочки, и, наконец, само сообщение.

Заметим, что это задача make запускать другие программы и таким образом, если при этом возникают ошибки, скорее всего проблемы в твоём makefile вызвали ошибки в этих других программах. Для примера, ошибки оболочки могут быть из-за плохо сформированных командных сценариев, или ошибок компилятора из-за некорректных аргументов командной строки. Выяснение того, какая программа выдала сообщение об ошибке — первоочередная задача при решении проблемы. К счастью, сообщения make довольно очевидны.

Синтаксические ошибки

Обычно это типографические ошибки: пропущенные скобки, пробелы после запятых в параметрах функции, и так далее.

Одна из наиболее частых ошибок для новых пользователей make это опускание скобок вокруг имен переменных:

Скорее всего, make развернёт переменную $S в ничего, и оболочка выполнит цикл только раз со значением OURCES в f . В зависимости от того, что ты собрался делать с f , можно получить забавные сообщения оболочки:

но можно и не получить сообщения вовсе. Помни — имена переменных обрамляются скобками.

missing separator

или (в GNU make — пер.):

обычно означает make искал разделитель, такой как :, =, или табуляцию и не нашел ни одного. Вместо этого, он нашел что-то что он не понял.

commands commence before first target

Эта ошибка появляется в основном в середине makefile, когда строка вне командного сценария начинается с отступа (пробелы или символ табуляции). make сделает все возможное, чтобы устранить неоднозначность этой ситуации, но если строка не может быть идентифицирована как присваивание значения, условное выражение или многострочное определение макроса, make решит что это неправильно размещенная команда.

unterminated variable reference

Это простая, но распространённая ошибка. Она означает, что ты забыл закрыть имя переменной или вызов функции правильным количеством скобок. С сильно вложенными вызовами функций и именами переменных make файлы становятся похожими на Lisp! Избежать этого поможет хороший редактор, который умеет сопоставлять скобки, такой как Emacs.

Ошибки в командных сценариях

Есть три типа частых ошибок в командных сценариях: пропущенная точка с запятой в многострочных командах, незаконченная или неверная переменная пути, или просто команда, которая просто обнаружила проблему в ходе выполнения.

Мы обсуждали пропущенные точки с запятыми в разделе «лучшие практики», поэтому не будем на этом останавливаться здесь.

выводится, когда оболочка не смогла найти команду foo . Так, оболочка поискала в каждой папке из переменной PATH исполняемый файл и не нашла совпадений. Чтобы исправить такую ошибку, нужно обновить PATH переменную, обычно в .profile (Bourne shell), .bashrc (bash) или .cshrc (C shell). Конечно, можно также установить PATH в самом makefile, и экспортировать PATH из make .

Если же команда завершилась с ошибкой, она выходит с ненулевым статусом выхода. В этом случае, make отчитается об ошибке со следующим сообщением:

Здесь touch команда не сработала, что напечатало своё собственное сообщение объясняющее сбой. Следующая строка — это итоговая ошибка make . Упавшая цель в makefile указана в квадратных скобках, а затем статус выхода упавшей программы. Если программа вышла по сигналу, а не с ненулевым статусом выхода, то make напечатает более подробное сообщение.

Заметим также, что команды под знаком @ также могут упасть. В этом случае сообщение об ошибке может возникнуть как будто оно из ниоткуда.

В обоих случаях ошибка происходит из программ запускаемых make , нежели от самого make .

No Rule to Make Target

Это сообщение имеет две формы:

Это означает, что make решил обновить файл XXX, но make не смог найти ни одного правила для выполнения работы. make ищет во всех явных и неявных правилах в его базе данных прежде чем сдаться и вывести это сообщение.

Есть три причины для этой ошибки:

  • В твоем makefile отсутствует необходимое правило для обновления файла. В этом случае тебе необходимо добавить правило с описанием как построить цель.
  • В makefile — опечатка. Или make ищет неверный файл или в правиле построения этого файла указан неверный файл. Если в makefile используются переменные, то опечатки становится еще труднее отыскать. Иногда единственный путь быть точно уверенным в значении сложного имени файла это напечатать его или печатая переменную напрямую или исследуя внутреннюю базу данных make .

Файл должен быть, но make не находит его или из-за того, что его нет, или make не знает где его искать. Конечно, иногда make абсолютно прав. Файла нет — похоже мы забыли его скачать из VCS . Еще чаще, make не может найти файл из-за того, что исходник расположен где-то еще. Иногда исходник в другом дереве исходников, или может файл генерируется другой программой и создался в папке артефактов сборки.

Overriding Commands for Target

make позволяет только один командный сценарий для цели (за исключением «::» правил, которые редко используются). Если встретится больше чем один командный сценарий для одной цели, make выведет предупреждение:

Также он может вывести сообщение:

Первое предупреждение показывает строку, на которой был найден второй сценарий команд; тогда как второе предупреждение указывает на позицию исходного переопределённого командного сценария.

В сложных makefile цели часто определены несколько раз, каждый раз добавляя еще собственные требования. Одно из этих определений цели обычно содержит командный сценарий, но в ходе разработки или отладки очень легко добавить еще один и не заметить, что существующий набор команд уже переопределен.

Например, мы могли бы определить общную цель во включаемом файле:

и позволим нескольким отдельным makefile добавить свои собственные требования. Мы могли бы записать в makefile:

Если непреднамеренно добавить командный сценарий в такой makefile, make выдаст предупреждение переопределения.

Источник

Adblock
detector

Part of the problem is that you’re using $(nvidia-smi ...) instead of $(shell nvidia-smi ...). That’s easily solved.

You also have to use $$2 instead of just $2 to prevent make from expanding it (probably expanding to nothing, resulting in the awk expression being just {print } and printing the entire line).

e.g. with a minimalist Makefile:

all:
    CUDA="$(shell nvidia-smi -q | awk -F': ' '/CUDA Version/ {print $$2}')"

Note the colon followed by space in awk’s -F field separator.

$ make
CUDA="Not Found"

This is actually the correct value for my system, I don’t have CUDA installed.

BTW, it’s important to realise that while some make syntax looks a bit like shell syntax, it’s very different….and, worse, the similarities can make it easy to write buggy makefiles.

See Makefile: how to sed correctly to edit a variable for a good answer relevant to your question.


On a more general note, you will probably find the output of nvidia-smi -q to be much easier to process with awk (or sed or perl or whatever).

e.g. on my system:

$ nvidia-smi -q | grep -i version
Driver Version                            : 460.56
CUDA Version                              : Not Found
    VBIOS Version                         : 86.06.0E.00.38
    Inforom Version
        Image Version                     : G001.0000.01.03

$ nvidia-smi -q | awk -F': ' '/CUDA Version/ {print $2}'
Not Found

I don’t have CUDA stuff installed, so I just get «not found». I can get a useful result for Driver Version:

$ nvidia-smi -q | awk -F': ' '/Driver Version/ {print $2}'
460.56

nvidia-smi also has various --query-gpu options. e.g.

$ nvidia-smi --query-gpu=driver_version,vbios_version --format=csv
driver_version, vbios_version
460.56, 86.06.0E.00.38

Oddly, CUDA version isn’t one of the query-gpu options. See nvidia-smi --help-query-gpu for full details.

>
Не могу откомпилировать проект!!!

  • Подписаться на тему
  • Сообщить другу
  • Скачать/распечатать тему



Сообщ.
#1

,
27.09.05, 13:18

    Добрый всем день.

    Так судьба сложилась, надо написать программу под Palm.
    Времени, как всегда…нет.

    Ситуация такая.
    1.Скачал PalmOS Developer Suit 1.2, установил, создаю проект Hello World, компилю…ошибка:

    Project test build command is not GNU make
    В окне консоли ссылка на ошибку в строке make-файла

    ifeq ($(SDK_LOCATION), )
    SDK_LOCATION = C:/PalmSource/Palm_OS_Developer_Suite/sdk-5r4/
    endif

    При чем, эмулятор честно запускается…только не понятно что с ним делать.
    В нете нашел две ссылки на данную проблему, там вразумительного ответа не последовало.

    2.Пытаюсь откомпильить PRC tools в командной строке…

    m68k-palmos-gcc.exe -O2 -c hello.c -o hello.o

    создал hello.o

    m68k-palmos-gcc.exe hello.o hello

    m68k-palmos-gcc: hello: No such file or directory
    m68k-palmos-gcc: No input files

    если

    m68k-palmos-gcc.exe *.o hello
    m68k-palmos-gcc: hello: No such file or directory

    Делаю по инструкции из доки PalmOs programing Bible

    3. Code Warrior for 68k Embedded скачал с сайта разработчика, не могу его взломать!

    ПОМОГИТЕ! Чувствуеш себя полным идиотом! Во всех доках пишут, как хорошо и легко разрабатывать проги для Palm’ов!
    Киньте в меня ссылку с «поломаным» CodeWarrior или подскажите как настроить PODS.

    Заранее спасибо.


    igor_n



    Сообщ.
    #2

    ,
    27.09.05, 22:25

      Краткий курс по prc-tools здесь: http://wiki.palmoid.com/ow.asp?PrcToolsBegginer . Там же ссылки на настройку prc tools.


      Yrek



      Сообщ.
      #3

      ,
      28.09.05, 07:50

        А как насчет настроек PODS?

        Хочется IDE.

        Расскажите , пожалуста , по шагам, как проект откомпилить?
        На одоном компе у меня получилось, не понял как, пришол на другой (PODS везде сам ставил) — ошибки makefile:

        Причем: создаю Managed Make 68k, creator ID = Q123 , Sample Application (Puzzl Game), Build All

        make clean all
        MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp.
        Error makefile 9: Command syntax error
        Error makefile 13: Command syntax error
        Error makefile 14: Command syntax error
        Error makefile 15: Command syntax error
        Error makefile 16: Command syntax error
        Error makefile 17: Command syntax error
        Error makefile 18: Command syntax error
        Error makefile 19: Command syntax error
        Error makefile 23: Command syntax error
        Error makefile 24: Command syntax error
        Error makefile 25: Command syntax error
        Error makefile 35: Colon expected
        Error makefile 44: Colon expected
        Error makefile 63: Command syntax error
        *** 14 errors during make ***
        Build complete for project test1

        Ну подскажите! Где «прошелкал» я? И почему нулевый проект выдает ошибки!


        shub@



        Сообщ.
        #4

        ,
        28.09.05, 08:20

          Full Member

          ***

          Рейтинг (т): 10

          Цитата

          MAKE Version 5.2 Copyright © 1987, 1998 Inprise Corp.

          Намек понял ? ;)


          Yrek



          Сообщ.
          #5

          ,
          28.09.05, 09:01

            Да, краем уха видел, что лажовая версия, но она идет с PODS 1.2, я ничего кроме этого пакета не ставил, что же это за сборка!
            Ну, подскажите, где взять другой Make и как его «вклеить» в PODS 1.2 ?


            Yrek



            Сообщ.
            #6

            ,
            28.09.05, 09:35

              Спасибо за намек.
              Гугла помогла…опять.

              А Борланд — гад.
              Угораздило меня поставить Делфу. Два дня коту под хвост.

              Всем у кого такая проблема.

              Make 5.2 — это не тот, что идет с PODS, а тот, что идет с Delphi 6.
              Смотрите переменную среды PATH, потом
              Search file : make.exe (entire disk) — и все станет ясно.

              0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)

              0 пользователей:

              • Предыдущая тема
              • PalmOS
              • Следующая тема

              [ Script execution time: 0,0232 ]   [ 15 queries used ]   [ Generated: 9.02.23, 14:27 GMT ]  

              Понравилась статья? Поделить с друзьями:
            • Error main file version
            • Error main file cannot be included recursively when building a preamble
            • Error main cannot start client command adb
            • Error mail command failed 550 not local sender over smtp
            • Error macro mortal kombat