more logging and better errors related to bwrap
This commit is contained in:
parent
586135170c
commit
6511663dc4
3 changed files with 49 additions and 15 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
/bin
|
/bin
|
||||||
|
*.epk
|
22
lib/main.go
22
lib/main.go
|
@ -259,6 +259,22 @@ func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logge
|
||||||
return 0, tempDir, err, ErrBubbleWrapInsufficientPermissions
|
return 0, tempDir, err, ErrBubbleWrapInsufficientPermissions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.LogFunc(Log{
|
||||||
|
Level: "DEBUG",
|
||||||
|
Content: "Temp directory: " + tempDir,
|
||||||
|
Prompt: false,
|
||||||
|
})
|
||||||
|
logger.LogFunc(Log{
|
||||||
|
Level: "DEBUG",
|
||||||
|
Content: "Target root: " + targetRoot,
|
||||||
|
Prompt: false,
|
||||||
|
})
|
||||||
|
logger.LogFunc(Log{
|
||||||
|
Level: "DEBUG",
|
||||||
|
Content: "Joined path: " + filepath.Join("/", buildConfig.TargetRoot),
|
||||||
|
Prompt: false,
|
||||||
|
})
|
||||||
|
|
||||||
arguments := []string{
|
arguments := []string{
|
||||||
"--unshare-net",
|
"--unshare-net",
|
||||||
"--bind", "/bin", "/bin",
|
"--bind", "/bin", "/bin",
|
||||||
|
@ -275,7 +291,7 @@ func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logge
|
||||||
"--tmpfs", "/run",
|
"--tmpfs", "/run",
|
||||||
"--tmpfs", "/tmp",
|
"--tmpfs", "/tmp",
|
||||||
"--proc", "/proc",
|
"--proc", "/proc",
|
||||||
"/usr/bin/fakeroot", "--", // fakeroot-tcp still installs as "fakeroot" for some reason TODO: handle wrong fakeroot installation
|
"/usr/bin/fakeroot-tcp", "--", // fakeroot-tcp still installs as "fakeroot" for some reason TODO: handle wrong fakeroot installation
|
||||||
"/bin/sh", "/eternity/build.sh",
|
"/bin/sh", "/eternity/build.sh",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +315,7 @@ func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logge
|
||||||
Prompt: false,
|
Prompt: false,
|
||||||
})
|
})
|
||||||
logger.LogFunc(Log{
|
logger.LogFunc(Log{
|
||||||
Level: "INFO",
|
Level: "DEBUG",
|
||||||
Content: "Command: bwrap " + strings.Join(arguments, " "),
|
Content: "Command: bwrap " + strings.Join(arguments, " "),
|
||||||
Prompt: false,
|
Prompt: false,
|
||||||
})
|
})
|
||||||
|
@ -329,7 +345,7 @@ func BuildEPK(projectDir string, inMemory bool, buildConfig Build, logger *Logge
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.LogFunc(Log{
|
logger.LogFunc(Log{
|
||||||
Level: "INFO",
|
Level: "ERROR",
|
||||||
Content: "Error occurred while executing build.sh, returning error",
|
Content: "Error occurred while executing build.sh, returning error",
|
||||||
Prompt: false,
|
Prompt: false,
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,13 +1,29 @@
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "example-package",
|
"author": "Arzumify",
|
||||||
"version": "1.0.0"
|
"name": "mypkg",
|
||||||
|
"desc": "A wonderful package",
|
||||||
|
"longDesc": "A very wonderful package\nWith a very long\nDescription!",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"license": "MIT",
|
||||||
|
"arch": "noarch",
|
||||||
|
"deps": [],
|
||||||
|
"specialFiles": {
|
||||||
|
"noDelete": ["/etc/config.conf"],
|
||||||
|
"noReplace": ["/var/hi/cache.thing"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"type": "host",
|
"type": "host",
|
||||||
|
"deps": [],
|
||||||
"steps": [
|
"steps": [
|
||||||
"echo Building the package...",
|
"mkdir -p build/t/etc/",
|
||||||
"echo Done!"
|
"mkdir -p build/t/var/hi/",
|
||||||
]
|
"touch build/t/etc/config.conf",
|
||||||
|
"touch build/t/var/hi/cache.thing"
|
||||||
|
],
|
||||||
|
"root": "build",
|
||||||
|
"hooks": "install-scripts",
|
||||||
|
"files": "resources"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue