profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/anthonyfok/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Anthony Fok anthonyfok @Debian Edmonton, Canada https://wiki.debian.org/AnthonyFok I am a Debian Developer and package Go programs like Hugo the static website generator (@gohugoio).

anthonyfok/academic-kickstart 0

Easily create a beautiful website using Academic and Hugo

anthonyfok/afero 0

A FileSystem Abstraction System for Go

anthonyfok/airspace-hugo 0

Airspace theme (Hugo version)

anthonyfok/airspace-hugo-karjudev 0

Airspace theme from ThemeFisher ported to Hugo

anthonyfok/anthonyfok.github.io 0

https://anthonyfok.github.io/

anthonyfok/asciidocgo 0

Like asciidoctor, but in Go.

anthonyfok/autokey 0

AutoKey, a desktop automation utility for Linux and X11.

anthonyfok/aws-sdk-go 0

AWS SDK for the Go programming language.

anthonyfok/blackburn 0

A Hugo theme built using Yahoo's Pure CSS

GollumEvent

push eventOpenDRR/pathways-paper

Joost van Ulden

commit sha 582ade74cc924959198dfe2c297c37aa004604e6

Adding english section documents

view details

Joost van Ulden

commit sha f1c6a8f29150417b977ed814494aaedf497a00c7

Update file extensions to be compliant with GitHub

view details

push time in a day

PullRequestReviewEvent

pull request commentOpenDRR/pathways-paper

Adding english section documents

@anthonyfok does the approach of section documents in a language folder make sense?

@jvanulde Yes! This is a great idea, and something that had totally escaped my mind because I forgot the fact that our Pathways paper will eventually be translated into French too. 😅 Yes, I think language folders like en and fr make total sense.

jvanulde

comment created time in a day

PullRequestReviewEvent

fork anthonyfok/java9to13

Power Catchup – Java 9 to 13: HTML5 Presentation and Code Examples

https://bentolor.github.io/java9to13/

fork in 2 days

issue commentOpenDRR/opendrr-platform

Check for bilingual README and LICENSE; generate PR if necessary

I'd like to echo what @DamonU2 said about the bilingual README files in the OpenDRR/national-human-settlement, i.e. the naming of README.md and LISEZMOI.md, which is very clear and very fair to both languages.

For MIT License, since there is no official French translation, leaving it as a single file named LICENSE is ideal.

Regarding bilingual licence files such as the "Open Government Licence - Licence du gouvernement ouvert – Canada Canada", I experimented over at OpenDRR/pathways-paper and settled on the names LICENCE-en.txt and LICENCE-fr.txt for the time being, and fortunately, GitHub does recognize these as licence files with the Canadian-British spelling and the ISO 639-1 two-letter language code as suffix and all. (What did not work were LICENCE.en.txt and LICENCE.fr.txt with the period instead of hyphen.)

As for LICENCE-en.txt vs LICENSE-en.txt, the latter seems more common due to the prevalence of American English, though the former is more Canadian and is used in the Open Government Licence name itself, though I suspect lots of Canadians often use American spelling too. I personally am fine with either spelling. Feedback welcomed too! :-)

anthonyfok

comment created time in 2 days

push eventOpenDRR/gh-milestone

Anthony Fok

commit sha 402a249356cf62ed46391ebfb9a2500b68fe6b82

Add gh-milestone (bash script)

view details

push time in 3 days

issue openedgabriel-vasile/mimetype

application/octet-stream data detected as "text/plain; charset=utf-8" since v1.3.0

Attach the file for which the detection is inaccurate Please see the attached test-file-from-shared_test_go_in_github-cli.txt file, extracted from https://github.com/cli/cli/blob/09b09810dd812e3ede54b59ad9d6912b946ac6c5/pkg/cmd/gist/shared/shared_test.go#L54-L87 (I wanted to use the .bin extension for binary data, but GitHub won't let me...)

Expected MIME type application/octet-stream (as was detected by v1.2.0 and before)

Returned MIME type text/plain; charset=utf-8

Version of the library you are using v1.3.1 (and v1.3.0)

Output of go version go version go1.16.8 linux/amd64

Additional context

While packaging github.com/cli/cli (GitHub CLI gh), of which github.com/gabriel-vasile/mimetype is a dependency, I ran into the following error:

=== RUN   TestIsBinaryContents
    shared_test.go:85: 
                Error Trace:    shared_test.go:85
                Error:          Not equal: 
                                expected: true
                                actual  : false
                Test:           TestIsBinaryContents
--- FAIL: TestIsBinaryContents (0.00s)

It turns out that the go.mod of gh currently has github.com/gabriel-vasile/mimetype pinned at v1.1.2, while I packaged v1.3.1 for Debian: https://ftp-master.debian.org/new/golang-github-gabriel-vasile-mimetype_1.3.1-1.html

I originally tested with the following test main.go:

package main

import (
	"fmt"

	"github.com/gabriel-vasile/mimetype"
)

var fileContent = []byte{239, 191, 189, 239, 191, 189, 239, 191, 189, 239,
	191, 189, 239, 191, 189, 16, 74, 70, 73, 70, 239, 191, 189, 1, 1, 1,
	1, 44, 1, 44, 239, 191, 189, 239, 191, 189, 239, 191, 189, 239, 191,
	189, 239, 191, 189, 67, 239, 191, 189, 8, 6, 6, 7, 6, 5, 8, 7, 7, 7,
	9, 9, 8, 10, 12, 20, 10, 12, 11, 11, 12, 25, 18, 19, 15, 20, 29, 26,
	31, 30, 29, 26, 28, 28, 32, 36, 46, 39, 32, 34, 44, 35, 28, 28, 40,
	55, 41, 44, 48, 49, 52, 52, 52, 31, 39, 57, 61, 56, 50, 60, 46, 51,
	52, 50, 239, 191, 189, 239, 191, 189, 239, 191, 189, 67, 1, 9, 9, 9, 12}

func main() {
	mtype := mimetype.Detect(fileContent)
	fmt.Println(mtype)
}

with the following commands:

$ go get github.com/gabriel-vasile/mimetype@v1.2.0
$ go run main.go 
application/octet-stream
$ go get github.com/gabriel-vasile/mimetype@v1.3.0
go get: upgraded github.com/gabriel-vasile/mimetype v1.2.0 => v1.3.0
$ go run main.go 
text/plain; charset=utf-8
$ go get github.com/gabriel-vasile/mimetype@v1.3.1
go get: upgraded github.com/gabriel-vasile/mimetype v1.3.0 => v1.3.1
$ go run main.go 
text/plain; charset=utf-8

Testing the same data with file:

$ hd test-file-from-shared_test_go_in_github-cli.txt 
00000000  ef bf bd ef bf bd ef bf  bd ef bf bd ef bf bd 10  |................|
00000010  4a 46 49 46 ef bf bd 01  01 01 01 2c 01 2c ef bf  |JFIF.......,.,..|
00000020  bd ef bf bd ef bf bd ef  bf bd ef bf bd 43 ef bf  |.............C..|
00000030  bd 08 06 06 07 06 05 08  07 07 07 09 09 08 0a 0c  |................|
00000040  14 0a 0c 0b 0b 0c 19 12  13 0f 14 1d 1a 1f 1e 1d  |................|
00000050  1a 1c 1c 20 24 2e 27 20  22 2c 23 1c 1c 28 37 29  |... $.' ",#..(7)|
00000060  2c 30 31 34 34 34 1f 27  39 3d 38 32 3c 2e 33 34  |,01444.'9=82<.34|
00000070  32 ef bf bd ef bf bd ef  bf bd 43 01 09 09 09 0c  |2.........C.....|
00000080
$ file test-file-from-shared_test_go_in_github-cli.txt 
test-file-from-shared_test_go_in_github-cli.txt: data

I believe this is a case where the test data happens to be valid UTF-8, but it "uses odd control characters, so doesn't look like text" according to https://github.com/file/file/blob/master/src/encoding.c; see https://github.com/file/file/blob/360436c8502150b0ef99d6ffd5683463804d863a/src/encoding.c#L350-L370

Thanks in advance!

created time in 4 days

issue closedmaruel/panicparse

fatal error: float64nan (panic before malloc heap initialized) on mips{,le} (Go 1.15+)

go test ./... fails on mips and mipsle with the following fatal error on Go 1.15 and up.

fatal error: float64nan
runtime: panic before malloc heap initialized

No such error when tested with Go 1.14.7.

Workaround on Go 1.15 and above: set GOMIPS=softfloat

Apparently fails on real MIPS machine, and not just cross-compiled version, see https://buildd.debian.org/status/package.php?p=panicparse for 1.6.1-1. (Unfortunately, it failed without log...)

Full test log (where GOMIPS=hardfloat is the default):

$ GOARCH=mips go test ./...
?   	github.com/maruel/panicparse	[no test files]
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x16e786, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800140 sp=0x4080012c pc=0x4ec6c
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800170 sp=0x40800140 pc=0x650bc
runtime.rt0_go(0x40800303, 0x4080032b, 0x40800366, 0x40800379, 0x0, 0x4080038d, 0x4080039b, 0x408003d1, 0x408003e7, 0x40800463, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800180 sp=0x40800170 pc=0x896fc
FAIL	github.com/maruel/panicparse/cmd/panic	0.016s
?   	github.com/maruel/panicparse/cmd/panic/internal	[no test files]
?   	github.com/maruel/panicparse/cmd/panic/internal/incorrect	[no test files]
?   	github.com/maruel/panicparse/cmd/panic/internal/utf8	[no test files]
?   	github.com/maruel/panicparse/cmd/panicweb	[no test files]
?   	github.com/maruel/panicparse/cmd/panicweb/internal	[no test files]
?   	github.com/maruel/panicparse/cmd/pp	[no test files]
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x2baec0, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800130 sp=0x4080011c pc=0x50ce8
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800160 sp=0x40800130 pc=0x67604
runtime.rt0_go(0x408002fe, 0x40800329, 0x40800364, 0x40800377, 0x0, 0x4080038b, 0x40800399, 0x408003cf, 0x408003e5, 0x40800461, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800170 sp=0x40800160 pc=0x8f3b8
FAIL	github.com/maruel/panicparse/internal	0.024s
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x228f64, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800130 sp=0x4080011c pc=0x50b68
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800160 sp=0x40800130 pc=0x67234
runtime.rt0_go(0x408002f2, 0x4080031e, 0x40800359, 0x4080036c, 0x0, 0x40800380, 0x4080038e, 0x408003c4, 0x408003da, 0x40800456, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800170 sp=0x40800160 pc=0x8c52c
FAIL	github.com/maruel/panicparse/internal/htmlstack	0.014s
?   	github.com/maruel/panicparse/internal/internaltest	[no test files]
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x25a462, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800140 sp=0x4080012c pc=0x50c40
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800170 sp=0x40800140 pc=0x67460
runtime.rt0_go(0x40800307, 0x4080032f, 0x4080036a, 0x4080037d, 0x0, 0x40800391, 0x4080039f, 0x408003d5, 0x408003eb, 0x40800467, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800180 sp=0x40800170 pc=0x8e75c
FAIL	github.com/maruel/panicparse/stack	0.010s
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x372dda, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800130 sp=0x4080011c pc=0x51304
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800160 sp=0x40800130 pc=0x679d0
runtime.rt0_go(0x408002f8, 0x40800323, 0x4080035e, 0x40800371, 0x0, 0x40800385, 0x40800393, 0x408003c9, 0x408003df, 0x4080045b, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800170 sp=0x40800160 pc=0x8ec54
FAIL	github.com/maruel/panicparse/stack/webstack	0.008s
FAIL

Many thanks!

closed time in 6 days

anthonyfok

issue commentmaruel/panicparse

fatal error: float64nan (panic before malloc heap initialized) on mips{,le} (Go 1.15+)

Hi! Thanks for the follow up.

Sorry, this issue turns out to be a false alarm.

It turns out that the test with GOMIPS=hardfloat (the default) did pass on real machine with my third try. Everything is in the green, including the mipsel build, with 1.6.1-3! See https://buildd.debian.org/status/package.php?p=panicparse I'm really happy that all architectures passed! (otherwise it could hold back other packages like syncthing)...

So, no, definitely DO NOT buy new MIPS hardware just to test this issue. It is my false alarm. Debian actually has remote-accessible MIPS machine for testing, though that is not even necessary in this case. :-)

I'll be closing this issue now.

Cheers, Anthony

anthonyfok

comment created time in 6 days

PR opened Debian/dh-make-golang

Switch to goldmark and glamour for Markdown to package description rendering enhancement

This pull request switches the current blackfriday-based renderer to goldmark-based glamour Markdown renderer for ANSI terminal output and supports plain-text output too.

The goal is to have README.md more properly formatted into our needed package description, thus requiring less manual editing.

The caveat is that the resulting dh-make-golang binary does grow somewhat bigger, from about 6.5 MB to 17 MB, though I think the use of glamour and friends allow us to improve the package description formatting with minimal amount of work.

I'd like to solicit feedback before merging this PR. All comments are welcome!


Example 1: Before

 Glamour<p>
     <img src="https://stuff.charm.sh/glamour/glamour-github-header.png"
     width="245" alt="Glamour Title Treatment"><br> <a
     href="https://github.com/charmbracelet/glamour/releases"><img
     src="https://img.shields.io/github/release/charmbracelet/glamour.svg"
     alt="Latest Release"></a> <a
     href="https://pkg.go.dev/github.com/charmbracelet/glamour?tab=doc"><img
     src="https://godoc.org/github.com/golang/gddo?status.svg"
     alt="GoDoc"></a> <a
     href="https://github.com/charmbracelet/glamour/actions"><img
     src="https://github.com/charmbracelet/glamour/workflows/build/badge.svg"
     alt="Build Status"></a> <a
     href="https://coveralls.io/github/charmbracelet/glamour?branch=master"><img
     src="https://coveralls.io/repos/github/charmbracelet/glamour/badge.svg?branch=master"
     alt="Coverage Status"></a> <a
     href="https://goreportcard.com/report/charmbracelet/glamour"><img
     src="https://goreportcard.com/badge/charmbracelet/glamour" alt="Go
     ReportCard"></a>
 </p> Stylesheet-based markdown rendering for your CLI apps.
 .
 Glamour dark style example
 .
 glamour lets you render markdown
 (https://en.wikipedia.org/wiki/Markdown) documents & templates on ANSI
 (https://en.wikipedia.org/wiki/ANSI_escape_code) compatible terminals. You
 can create your own stylesheet or simply use one of the stylish defaults.
 Usage ```go import "github.com/charmbracelet/glamour"
 .
 in := `# Hello World
 .
 This is a simple example of Markdown rendering
 with Glamour!  Check out the other examples
 (https://github.com/charmbracelet/glamour/tree/master/examples) too.
 .
 Bye!  `
 .
 out, err := glamour.Render(in, "dark") fmt.Print(out) ```
 .
 .
 Custom Renderer ```go import "github.com/charmbracelet/glamour"
 .
 r, _ := glamour.NewTermRenderer(
     // detect background color and pick either the default dark or
     light theme glamour.WithAutoStyle(), // wrap output at specific
     width glamour.WithWordWrap(40),
 )
 .
 out, err := r.Render(in) fmt.Print(out) ``` Styles
 You can find all available default styles in our gallery
 (https://github.com/charmbracelet/glamour/tree/master/styles/gallery).
 Want to create your own style? Learn
 how! (https://github.com/charmbracelet/glamour/tree/master/styles)
 .
 There are a few options for using a custom style: 1. Call
 glamour.Render(inputText, "desiredStyle") 1. Set the GLAMOUR_STYLE
 environment variable to your desired default style or a file location
 for a style and call glamour.RenderWithEnvironmentConfig(inputText)
 1. Set the GLAMOUR_STYLE environment variable and pass
 glamour.WithEnvironmentConfig() to your custom renderer Glamourous
 Projects Check out these projects, which use glamour: - Glow
 (https://github.com/charmbracelet/glow), a markdown renderer for the
 command-line.  - GitHub CLI (https://github.com/cli/cli), GitHub’s
 official command line tool.  - GLab (https://github.com/profclems/glab),
 An open source GitLab command line tool.  License MIT
 (https://github.com/charmbracelet/glamour/raw/master/LICENSE)
 --------------------------------------------------------------------------------
 .
 Part of Charm (https://charm.sh).
 .
 .
 .
 Charm热爱开源 • Charm loves open source

Example 1: After

 Glamour
 .
 .
 Stylesheet-based markdown rendering for your CLI apps.
 .
 [Image: Glamour dark style example]
 (https://stuff.charm.sh/glamour/glamour-example.png)
 .
 `glamour` lets you render markdown
 (https://en.wikipedia.org/wiki/Markdown) documents & templates on ANSI
 (https://en.wikipedia.org/wiki/ANSI_escape_code) compatible terminals.
 You can create your own stylesheet or simply use one of the stylish
 defaults.
 .
 Usage
 .
   import "github.com/charmbracelet/glamour"
 .
   in := `# Hello World
 .
   This is a simple example of Markdown rendering with Glamour!
   Check out the [other
 examples](https://github.com/charmbracelet/glamour/tree/master/examples)
 too.
 .
   Bye!
   `
 .
   out, err := glamour.Render(in, "dark")
   fmt.Print(out)
 .
 .
 Custom Renderer
 .
   import "github.com/charmbracelet/glamour"
 .
   r, _ := glamour.NewTermRenderer(
       // detect background color and pick either the default dark or
 light theme
       glamour.WithAutoStyle(),
       // wrap output at specific width
       glamour.WithWordWrap(40),
   )
 .
   out, err := r.Render(in)
   fmt.Print(out)
 .
 Styles
 .
 You can find all available default styles in our gallery
 (https://github.com/charmbracelet/glamour/tree/master/styles/gallery).
 Want to create your own style? Learn how!
 (https://github.com/charmbracelet/glamour/tree/master/styles)
 .
 There are a few options for using a custom style:
 .
  1. Call `glamour.Render(inputText, "desiredStyle")`
  2. Set the `GLAMOUR_STYLE` environment variable to your desired default
     style or a file location for a style and call
     `glamour.RenderWithEnvironmentConfig(inputText)`
  3. Set the `GLAMOUR_STYLE` environment variable and pass
     `glamour.WithEnvironmentConfig()` to your custom renderer
 .
 Glamourous Projects
 .
 Check out these projects, which use `glamour`:
 .
  * Glow (https://github.com/charmbracelet/glow), a markdown renderer for
    the command-line.
  * GitHub CLI (https://github.com/cli/cli), GitHub’s official command
    line tool.
  * GLab (https://github.com/profclems/glab), An open source GitLab
    command line tool.
 .
 License
 .
 MIT (https://github.com/charmbracelet/glamour/raw/master/LICENSE)
 .
 ------------------------------------------------------------------------
 .
 Part of Charm (https://charm.sh).
 .
 .
 Charm热爱开源 • Charm loves open source

Example 2: Before

 GitHub CLI gh is GitHub on the command line. It brings pull requests,
 issues, and other GitHub concepts to the terminal next to where you are
 already working with git and your code.
 .
 screenshot of gh pr status
 .
 GitHub CLI is available for repositories hosted on GitHub.com and GitHub
 Enterprise Server 2.20+, and to install on macOS, Windows, and Linux.
 Documentation See the manual (https://cli.github.com/manual/) for
 setup and usage instructions.  Contributing If anything feels off,
 or if you feel that some functionality is missing, please check out
 the contributing page (./.github/CONTRIBUTING.md). There you will find
 instructions for sharing your feedback, building the tool locally, and
 submitting pull requests to the project.  <!-- this anchor is linked to
 from elsewhere, so avoid renaming it -->InstallationmacOS gh is available
 via Homebrew (https://brew.sh), MacPorts (https://www.macports.org),
 Conda (https://docs.conda.io/en/latest/), and as a downloadable binary
 from the releases page (https://github.com/cli/cli/releases/latest).
 Homebrew | Install:          | Upgrade:          | | -----------------
 | ----------------- | | brew install gh | brew upgrade gh | MacPorts |
 Install:               | Upgrade:                                       |
 | ---------------------- | ----------------------------------------------
 | | sudo port install gh | sudo port selfupdate && sudo port
 upgrade gh | Conda | Install:                                 |
 Upgrade:                                |
 |------------------------------------------|-----------------------------------------|
 | conda install gh --channel conda-forge | conda update gh --channel
 conda-forge |

Example 2: After

 GitHub CLI
 .
 `gh` is GitHub on the command line. It brings pull requests, issues, and
 other GitHub concepts to the terminal next to where you are already
 working with `git` and your code.
 .
 [Image: screenshot of gh pr status] (https://user-
 images.githubusercontent.com/98482/84171218-327e7a80-aa40-11ea-8cd1-
 5177fc2d0e72.png)
 .
 GitHub CLI is available for repositories hosted on GitHub.com and GitHub
 Enterprise Server 2.20+, and to install on macOS, Windows, and Linux.
 .
 Documentation
 .
 See the manual (https://cli.github.com/manual/) for setup and usage
 instructions.
 .
 Contributing
 .
 If anything feels off, or if you feel that some functionality is
 missing, please check out the contributing page
 (/.github/CONTRIBUTING.md). There you will find instructions for sharing
 your feedback, building the tool locally, and submitting pull requests
 to the project.
 .
 .
 Installation
 .
 macOS
 .
 `gh` is available via Homebrew (https://brew.sh), MacPorts
 (https://www.macports.org), Conda (https://docs.conda.io/en/latest/),
 and as a downloadable binary from the releases page
 (https://github.com/cli/cli/releases/latest).
 .
 Homebrew
 .
      INSTALL:     |    UPGRADE:
 ------------------+------------------
   brew install gh | brew upgrade gh
 .
 MacPorts
 .
         INSTALL:       |            UPGRADE:
 -----------------------+---------------------------------
   sudo port install gh | sudo port selfupdate && sudo
                        | port upgrade gh
 .
 Conda
 .
              INSTALL:            |            UPGRADE:
 ---------------------------------+---------------------------------
   conda install gh --channel     | conda update gh --channel
   conda-forge                    | conda-forge
+204 -163

0 comment

7 changed files

pr created time in 7 days

push eventDebian/dh-make-golang

Anthony Fok

commit sha 29f1659e44cee2fb6b77db12218010c5378bb922

ci-test: Remove Go 1.15.x from test matrix as the use of //go:embed requires Go 1.16 and newer

view details

push time in 7 days

push eventanthonyfok/dh-make-golang

Anthony Fok

commit sha 29f1659e44cee2fb6b77db12218010c5378bb922

ci-test: Remove Go 1.15.x from test matrix as the use of //go:embed requires Go 1.16 and newer

view details

push time in 7 days

issue commentmaruel/panicparse

TestPanicweb fail with "expected 4 calls, got 5" on ppc64{,le}

Here is my patch to circumvent the "expected 4 calls, got 5" error on ppc64 and ppc64le:

Description: Skip TestPanicweb on ppc64 and ppc64le
 TestPanicweb in context_test.go fails with "expected 4 calls, got 5"
 on ppc64 and ppc64le architectures.
 Tested with Go 1.14.7, 1.15.15, 1.16.7 and 1.17.
Author: Anthony Fok <foka@debian.org>
Origin: vendor
Bug: https://github.com/maruel/panicparse/issues/66
Last-Update: 2021-09-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/stack/context_test.go
+++ b/stack/context_test.go
@@ -1616,6 +1616,11 @@
 				t.Fatalf("expected 1 goroutine for the signature, got %d", l)
 			}
 			if l := len(b.Stack.Calls); l != 4 {
+				switch arch := runtime.GOARCH; arch {
+				case "ppc64", "ppc64le":
+					t.Logf("expected %d calls, got %d", 4, l)
+					t.Skipf("Skipping %s on %s\nSee https://github.com/maruel/panicparse/issues/66\n", t.Name(), arch)
+				}
 				t.Fatalf("expected %d calls, got %d", 4, l)
 			}
 			if runtime.GOOS == "windows" {

I'm checking https://buildd.debian.org/status/package.php?p=panicparse for the ppc64el build status of panicparse 1.6.1-2 Debian package.

anthonyfok

comment created time in 7 days

issue commentmaruel/panicparse

TestAugment/float64 fails on 32-bit architectures (v1.6.1)

Hi again,

Now that I have prepared the workaround for the panicparse 1.6.1-2 Debian package, I now realize the float64nan fatal error is a separate issue that can be circumvented by GOMIPS=softfloat, or perhaps it is machine-dependent, so I have separated that out into Issue #67.

Here is my patch to skip TestAugment/float64 on 32-bit architectures to avoid build failures on Debian's armel, armhf, i386 and mipsel build daemons at https://buildd.debian.org/status/package.php?p=panicparse:

Description: Skip TestAugment/float64 on 32-bit architectures
 Skip TestAugment/float64 on 386, arm, mips and mipsle to avoid errors.
 .
 mips and mipsle also require GOMIPS=softfloat to circumvent
     fatal error: float64nan
     runtime: panic before malloc heap initialized
Author: Anthony Fok <foka@debian.org>
Origin: vendor
Bug: https://github.com/maruel/panicparse/issues/65
Last-Update: 2021-09-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/stack/source_test.go
+++ b/stack/source_test.go
@@ -11,6 +11,7 @@
 	"os"
 	"os/exec"
 	"path/filepath"
+	"runtime"
 	"strings"
 	"testing"
 
@@ -472,7 +473,12 @@
 				t.Logf("Different (-want +got):\n%s", diff)
 				t.Logf("Source code:\n%s", input)
 				t.Logf("Output:\n%s", content)
-				t.FailNow()
+				arch := runtime.GOARCH
+				if t.Name() == "TestAugment/float64" && arch == "mips" {
+					t.Logf("Allow %s difference on %s\nSee https://github.com/maruel/panicparse/issues/65\n", t.Name(), arch)
+				} else {
+					t.FailNow()
+				}
 			}
 
 			// If inlining was disabled, try a second time but zap things out.
@@ -624,6 +630,14 @@
 			if want.Calls[i].Args.Values[j].Value == pointer {
 				// Replace the pointer value.
 				if got.Calls[i].Args.Values[j].Value == 0 {
+					if t.Name() == "TestAugment/float64" {
+						switch arch := runtime.GOARCH; arch {
+						case "386", "arm", "mipsle":
+							t.Logf("Call %d, value %d, expected pointer, got 0", i, j)
+
+							t.Skipf("Skipping %s on %s\nSee https://github.com/maruel/panicparse/issues/65\n", t.Name(), arch)
+						}
+					}
 					t.Fatalf("Call %d, value %d, expected pointer, got 0", i, j)
 				}
 				old := fmt.Sprintf("0x%x", got.Calls[i].Args.Values[j].Value)
anthonyfok

comment created time in 7 days

issue openedmaruel/panicparse

fatal error: float64nan (panic before malloc heap initialized) on mips{,le} (Go 1.15+)

go test ./... fails on mips and mipsle with the following fatal error on Go 1.15 and up.

fatal error: float64nan
runtime: panic before malloc heap initialized

No such error when tested with Go 1.14.7.

Workaround on Go 1.15 and above: set GOMIPS=softfloat

Apparently fails on real MIPS machine, and not just cross-compiled version, see https://buildd.debian.org/status/package.php?p=panicparse for 1.6.1-1. (Unfortunately, it failed without log...)

Full test log (where GOMIPS=hardfloat is the default):

$ GOARCH=mips go test ./...
?   	github.com/maruel/panicparse	[no test files]
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x16e786, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800140 sp=0x4080012c pc=0x4ec6c
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800170 sp=0x40800140 pc=0x650bc
runtime.rt0_go(0x40800303, 0x4080032b, 0x40800366, 0x40800379, 0x0, 0x4080038d, 0x4080039b, 0x408003d1, 0x408003e7, 0x40800463, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800180 sp=0x40800170 pc=0x896fc
FAIL	github.com/maruel/panicparse/cmd/panic	0.016s
?   	github.com/maruel/panicparse/cmd/panic/internal	[no test files]
?   	github.com/maruel/panicparse/cmd/panic/internal/incorrect	[no test files]
?   	github.com/maruel/panicparse/cmd/panic/internal/utf8	[no test files]
?   	github.com/maruel/panicparse/cmd/panicweb	[no test files]
?   	github.com/maruel/panicparse/cmd/panicweb/internal	[no test files]
?   	github.com/maruel/panicparse/cmd/pp	[no test files]
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x2baec0, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800130 sp=0x4080011c pc=0x50ce8
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800160 sp=0x40800130 pc=0x67604
runtime.rt0_go(0x408002fe, 0x40800329, 0x40800364, 0x40800377, 0x0, 0x4080038b, 0x40800399, 0x408003cf, 0x408003e5, 0x40800461, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800170 sp=0x40800160 pc=0x8f3b8
FAIL	github.com/maruel/panicparse/internal	0.024s
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x228f64, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800130 sp=0x4080011c pc=0x50b68
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800160 sp=0x40800130 pc=0x67234
runtime.rt0_go(0x408002f2, 0x4080031e, 0x40800359, 0x4080036c, 0x0, 0x40800380, 0x4080038e, 0x408003c4, 0x408003da, 0x40800456, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800170 sp=0x40800160 pc=0x8c52c
FAIL	github.com/maruel/panicparse/internal/htmlstack	0.014s
?   	github.com/maruel/panicparse/internal/internaltest	[no test files]
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x25a462, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800140 sp=0x4080012c pc=0x50c40
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800170 sp=0x40800140 pc=0x67460
runtime.rt0_go(0x40800307, 0x4080032f, 0x4080036a, 0x4080037d, 0x0, 0x40800391, 0x4080039f, 0x408003d5, 0x408003eb, 0x40800467, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800180 sp=0x40800170 pc=0x8e75c
FAIL	github.com/maruel/panicparse/stack	0.010s
fatal error: float64nan
runtime: panic before malloc heap initialized

runtime stack:
runtime.throw(0x372dda, 0xa)
	/usr/lib/go-1.16/src/runtime/panic.go:1117 +0x60 fp=0x40800130 sp=0x4080011c pc=0x51304
runtime.check()
	/usr/lib/go-1.16/src/runtime/runtime1.go:252 +0x574 fp=0x40800160 sp=0x40800130 pc=0x679d0
runtime.rt0_go(0x408002f8, 0x40800323, 0x4080035e, 0x40800371, 0x0, 0x40800385, 0x40800393, 0x408003c9, 0x408003df, 0x4080045b, ...)
	/usr/lib/go-1.16/src/runtime/asm_mipsx.s:57 +0x90 fp=0x40800170 sp=0x40800160 pc=0x8ec54
FAIL	github.com/maruel/panicparse/stack/webstack	0.008s
FAIL

Many thanks!

created time in 7 days

push eventOpenDRR/pathways-paper

Anthony Fok

commit sha 8da4ba2e2a9a6e4fe1ba673250049f42a82f00fc

README.md: Add URL to our Pathways Paper wiki page

view details

push time in 7 days

push eventOpenDRR/gh-milestone

Anthony Fok

commit sha e0cfb1c5b19c6672a69817d0007dec5dc029885a

Initial commit

view details

push time in 7 days

create barnchOpenDRR/gh-milestone

branch : main

created branch time in 7 days

created repositoryOpenDRR/gh-milestone

GitHub CLI extension for migrating issues to new milestone.

created time in 7 days

issue closedOpenDRR/opendrr-platform

Get OpenQuake to run in GitHub Actions with a sample dataset

Reference: Slack DM with Joost on 2021-04-01, etc.

See initial OpenQuake installation in a GitHub Actions at https://github.com/anthonyfok/github-experiments

closed time in 8 days

anthonyfok

issue commentOpenDRR/opendrr-platform

Get OpenQuake to run in GitHub Actions with a sample dataset

@anthonyfok can we close this?

Good catch! Thank you Joost! Yes, let's close this.

anthonyfok

comment created time in 8 days

startedOpenXiangShan/XiangShan

started time in 8 days

push eventOpenDRR/pathways-paper

Anthony Fok

commit sha ec68f372fc0284a3904c2666a99514c048a13ca5

Initial commit

view details

push time in 8 days

push eventOpenDRR/pathways-paper

Anthony Fok

commit sha 59a16aade248faccc24af9c44a4f7ef9a2feedbb

Initial commit

view details

push time in 8 days

push eventOpenDRR/pathways-paper

Anthony Fok

commit sha 02dcc4e4ab47500e0177cb5c281f0498258b21c9

Initial commit

view details

push time in 8 days