Bug 250458 - lang/nim: Update to 1.4.0
Summary: lang/nim: Update to 1.4.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Loïc Bartoletti
URL: https://nim-lang.org/blog/2020/10/16/...
Keywords: buildisok
Depends on:
Blocks:
 
Reported: 2020-10-19 12:37 UTC by Neal Nelson
Modified: 2020-11-03 12:20 UTC (History)
2 users (show)

See Also:
ports: maintainer-feedback+


Attachments
Diffs to upgrade port. (16.14 KB, patch)
2020-10-19 12:37 UTC, Neal Nelson
ports: maintainer-approval+
Details | Diff
Diffs to upgrade port, with docs. (19.95 KB, patch)
2020-10-23 15:45 UTC, Neal Nelson
ports: maintainer-approval+
Details | Diff
Patch for upgrade (19.66 KB, patch)
2020-10-25 07:35 UTC, Neal Nelson
ports: maintainer-approval+
Details | Diff
lang/nim: Update to 1.4.O (18.76 KB, patch)
2020-10-29 15:32 UTC, Loïc Bartoletti
lbartoletti: maintainer-approval?
Details | Diff
Fixed version of the fixed patch. (18.97 KB, patch)
2020-11-02 10:29 UTC, Neal Nelson
ports: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Neal Nelson 2020-10-19 12:37:45 UTC
Created attachment 218884 [details]
Diffs to upgrade port.

Update the lang/nim port to the latest 1.4.0.
Comment 1 Automation User 2020-10-19 12:58:06 UTC
Build and package info is available at https://gitlab.com/swills/freebsd-ports/pipelines/204600791
Comment 2 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-21 07:06:32 UTC
Hello,

I noticed that the doc is not generated in html. I saw some upstream changes. It seems to require a `koch doc` to generate it. Can you confirm this?
Comment 3 Neal Nelson 2020-10-21 16:25:26 UTC
(In reply to Loïc Bartoletti from comment #2)
You're quite right. I had hoped to have an updated patch today, but koch doc is doing something quite naughty which poudriere does not like, so I'm having to track it down.
Comment 4 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-21 16:34:23 UTC
(In reply to Neal Nelson from comment #3)

> but koch doc is doing something quite naughty which poudriere does not like

same problem here...
Comment 5 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-22 16:14:32 UTC
Piotr, can you review the patch for powerpc arch?
I fixed some arch upstream and add "powerpc" arch (https://github.com/nim-lang/Nim/blob/devel/compiler/installer.ini#L12) So maybe the patch is to be deleted or rewrited?
Comment 6 Neal Nelson 2020-10-23 15:45:08 UTC
Created attachment 219006 [details]
Diffs to upgrade port, with docs.

I finally managed to get the docs building within poudriere.
Comment 7 Piotr Kubaj freebsd_committer freebsd_triage 2020-10-23 16:05:23 UTC
(In reply to Loïc Bartoletti from comment #5)
Well, this port doesn't build on powerpc due to:
cd /wrkdirs/usr/ports/lang/nim/work/nim-1.4.0 && /usr/bin/env CC="cc" LINKER="cc"  COMP_FLAGS=" -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing
" LINK_FLAGS=" -fstack-protector-strong "  /bin/sh build.sh
# OS: freebsd
# CPU: powerpc
clang -w '-fmax-errors=3' -O3 -fno-strict-aliasing -fno-ident -m64 -Ic_code -c c_code/1_1/stdlib_assertions.nim.c -o c_code/1_1/stdlib_assertions.nim.o
In file included from c_code/1_1/stdlib_assertions.nim.c:8:
c_code/nimbase.h:542:1: error: static_assert failed due to requirement 'sizeof(int) == sizeof(void *) && 32 == sizeof(int) * 8' ""
NIM_STATIC_ASSERT(sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8, "");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c_code/nimbase.h:271:35: note: expanded from macro 'NIM_STATIC_ASSERT'
#define NIM_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
                                  ^               ~
1 error generated.
*** Error code 1

Do you mean powerpc64? On powerpc64, it builds both with the version in ports and when 1.4.0 is used, apart from that pkg-plist issue on 1.4.0:
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: lib/nim/fusion/btreetables.nim
Error: Orphaned: lib/nim/fusion/compat.nim
Error: Orphaned: lib/nim/fusion/filepermissions.nim
Error: Orphaned: lib/nim/fusion/htmlparser.nim
Error: Orphaned: lib/nim/fusion/htmlparser/parsexml.nim
Error: Orphaned: lib/nim/fusion/htmlparser/xmltree.nim
Error: Orphaned: lib/nim/fusion/pools.nim
Comment 8 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-23 17:47:21 UTC
(In reply to Neal Nelson from comment #6)
Nice!

Please, can you remove or fix the path in file config/nim.cfg:
`gcc.options.linker = "/usr/home/nealie/ports/lang/nim/work/nimcache"`

Thanks
Comment 9 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-23 17:56:31 UTC
(In reply to Piotr Kubaj from comment #7)



> Well, this port doesn't build on powerpc due to:
> cd /wrkdirs/usr/ports/lang/nim/work/nim-1.4.0 && /usr/bin/env CC="cc" LINKER="cc"  COMP_FLAGS=" -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing
>" LINK_FLAGS=" -fstack-protector-strong "  /bin/sh build.sh
># OS: freebsd
># CPU: powerpc

OK, so, there is an issue in buildsh.nimf upstream. I'll take a look in qemu later. Thanks

> On powerpc64, it builds both with the version in ports and when 1.4.0 is used, apart from that pkg-plist issue on 1.4.0:

Fusion is not (yet) packaged by Neal, since it requires to fetch this repository: https://github.com/nim-lang/fusion

Indeed, outside of poudriere, nim will clone the repository and try to add fusion.

Maybe it should be included in the package, Neal?
Comment 10 Neal Nelson 2020-10-25 07:35:55 UTC
Created attachment 219053 [details]
Patch for upgrade

Sorry about the remnants in the last patch. Such are the joys of the two step patching that is required.
Comment 11 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-29 15:32:35 UTC
Created attachment 219204 [details]
lang/nim: Update to 1.4.O

Minor changes:

- remove portrevision
- fix nimcache hack for docs (nim doesn't found or use an incorrect cache directory if we don't remove the lines in the config files)
- don't build fusion for now

Is it ok for you? Can you retry it please? Thanks.
Comment 12 Neal Nelson 2020-10-29 15:51:34 UTC
Comment on attachment 219204 [details]
lang/nim: Update to 1.4.O

I seem to be having problems setting this flag. Hopefully this works.
Comment 13 Neal Nelson 2020-10-29 15:55:06 UTC
(In reply to Neal Nelson from comment #12)
Ah, maybe it was lucky I was unable to set the maintainer approval flag, as I hadn't realised that patch was modified from my own.

- The nimcache settings are needed, otherwise the docs do not build in poudriere. It took me three days to track that one down, so don't blame me if it no longer works.

Have you tried building your patched version in poudriere?
Comment 14 Neal Nelson 2020-10-30 07:53:08 UTC
I tried running the latest patch through poudriere and it still fails as I think that the cache setting is not being propagated, so I stand by my last submitted patch.
Comment 15 Loïc Bartoletti freebsd_committer freebsd_triage 2020-10-30 07:55:12 UTC
(In reply to Neal Nelson from comment #13)

> - The nimcache settings are needed, otherwise the docs do not build in poudriere. It took me three days to track that one down, so don't blame me if it no longer works.

Thank you for finding this solution, this is exactlay what it needs for the port to be built in poudriere. I just modified this one because when using nim via the poudriere package, the nimcache was in /wrkdirs/usr/ports/lang/nim and it's not usable. So nim must be forced to use a folder defined when building it, but for the release of the package, this variable must be removed for correct use.

I've also added a constraint not to build fusion (otherwise you'll have problems on the plist as a piotr raise)

> Have you tried building your patched version in poudriere?

Yes, I tested with poudriere and in a jail.

Thank you very much for your contributions.
Comment 16 Neal Nelson 2020-11-02 10:29:09 UTC
Created attachment 219300 [details]
Fixed version of the fixed patch.

The last patch still fails a poudriere testrun, but I have added in the necessary switch to stop the runnable examples being run, which fails. This all seems to work for me now.
Comment 17 commit-hook freebsd_committer freebsd_triage 2020-11-03 12:18:12 UTC
A commit references this bug:

Author: lbartoletti
Date: Tue Nov  3 12:18:04 UTC 2020
New revision: 553979
URL: https://svnweb.freebsd.org/changeset/ports/553979

Log:
  lang/nim: Update to 1.4.0

  - Update to 1.4.0
  - Add a workaround to build doc in poudriere
  - Remove patch-compiler_docgen.nim (fixed upstream)
  - Add patch-koch.nim to disable Fusion build

  Release notes:
    - https://nim-lang.org/blog/2020/10/16/version-140-released.html

  PR:		250458
  Submitted by:	Neal Nelson (maintainer)

Changes:
  head/lang/nim/Makefile
  head/lang/nim/distinfo
  head/lang/nim/files/patch-compiler_docgen.nim
  head/lang/nim/files/patch-config-nim.cfg
  head/lang/nim/files/patch-koch.nim
  head/lang/nim/pkg-plist
Comment 18 Loïc Bartoletti freebsd_committer freebsd_triage 2020-11-03 12:20:20 UTC
Committed. Thanks a lot!