Bug 265080

Summary: www/deno: patch to make deno_std modules tests to pass (deno standard library)
Product: Ports & Packages Reporter: Guillaume Bibaut <yom>
Component: Individual Port(s)Assignee: Mikael Urankar <mikael>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (mikael)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
git diff output for patching www/deno to make deno_std library tests to pass
none
typescript file to test none

Description Guillaume Bibaut 2022-07-07 22:14:51 UTC
Created attachment 235114 [details]
git diff output for patching www/deno to make deno_std library tests to pass

Hello,

I'm trying to use Deno on FreeBSD recently, and tried to pass tests on  the deno_std modules. It seems Deno is missing at least a small patch to make them to pass.
Without this patch, tests in deno_std modules aren't passing on some `Deno.stat("/path/to/file")` function usage, which is returning some FileInfo interface with the `mode` field to null instead of being assigned to the octal value for the file mode.

I'm attaching the git diff to this.
Can you have a look at it please?
Comment 1 Guillaume Bibaut 2022-07-07 23:32:48 UTC
Just adding some deno output to show differences, and the typescript as an attachment

Before patch
> $ /usr/local/bin/deno run --allow-read main.ts 
> {
>   isFile: true,
>   isDirectory: false,
>   isSymlink: false,
>   size: 58,
>   mtime: 2022-07-07T21:48:44.817Z,
>   atime: 2022-07-07T18:53:34.401Z,
>   birthtime: 2022-07-07T18:53:34.401Z,
>   dev: null,
>   ino: null,
>   mode: null,
>   nlink: null,
>   uid: null,
>   gid: null,
>   rdev: null,
>   blksize: null,
>   blocks: null
> }

After patch
> $ deno run --allow-read main.ts 
> {
>   isFile: true,
>   isDirectory: false,
>   isSymlink: false,
>   size: 58,
>   mtime: 2022-07-07T21:48:44.817Z,
>   atime: 2022-07-07T18:53:34.401Z,
>   birthtime: 2022-07-07T18:53:34.401Z,
>   dev: 1724626467,
>   ino: 2310897,
>   mode: 33188,
>   nlink: 1,
>   uid: 1001,
>   gid: 1001,
>   rdev: 4294967295,
>   blksize: 4096,
>   blocks: 1
> }
Comment 2 Guillaume Bibaut 2022-07-07 23:34:43 UTC
Created attachment 235115 [details]
typescript file to test
Comment 3 Guillaume Bibaut 2022-07-08 07:41:15 UTC
deno standard library tests result with this patch:

On FreeBSD:
> deno_std $ deno task test
> ...
> ok | 2975 passed (212 steps) | 0 failed | 11 ignored (2m11s)

On WSL (no patch needed):
> deno_std $ deno task test
> ...
> ok | 2975 passed (212 steps) | 0 failed | 11 ignored (1m16s)

Differences can also be seen when using https://deno.land/std@0.147.0/http/file_server.ts to show local files, for example running this on FreeBSD with current unpatched deno, and on WSL:

> deno_std $ deno run --allow-read --allow-net https://deno.land/std@0.147.0/http/file_server.ts http/
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-07-08 14:34:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4588423cca935e99b093ce56e24bb629c439d706

commit 4588423cca935e99b093ce56e24bb629c439d706
Author:     Guillaume Bibaut <yom@iaelu.net>
AuthorDate: 2022-07-08 06:38:53 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2022-07-08 14:25:43 +0000

    www/deno: Fix parseFileInfo

    Add freebsd to the list so that parseFileInfo returns correct information.

    PR:             265080

 www/deno/Makefile                               |  2 +-
 www/deno/files/patch-runtime_js_30__fs.js (new) | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
Comment 5 Mikael Urankar freebsd_committer freebsd_triage 2022-07-08 14:45:31 UTC
merci!