Commit Graph

632 Commits

Author SHA1 Message Date
flywind
80c8107c56 [tools] use the right parameter [backport:1.0] (#18957)
(cherry picked from commit b2873f0f63)
2021-10-06 13:41:18 +02:00
narimiran
9d23c14dd2 some other files need the same change too 2021-04-30 11:00:19 +02:00
flywind
265499ee57 fix #16364 (#16379) [backport]
* fix #16364

* add comments

* Update tools/dochack/dochack.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Clyybber <darkmine956@gmail.com>
(cherry picked from commit 5d8f862bc6)
2020-12-19 14:10:40 +01:00
Timothee Cour
1a92a4b0bd remove all mentions of doc2, jsondoc2 (except 1 mentioning the alias) (#15683)
(cherry picked from commit 13b1b19a83)
2020-11-27 17:47:27 +01:00
lenoil98
b3b7a1e73f Update buildsh.nimf (#15945)
fix powerpc64le detection

(cherry picked from commit 778914c3ca)
2020-11-16 07:07:58 +01:00
lenoil98
30362cde20 Add support for FreeBSD/PowerPC64 Little Endian (#15927)
* Update installer.ini

Add support for powerpc64 little endian

* Update buildsh.nimf

Add support for powerpc64 little endian

* Update makefile.nimf

Add support for freebsd/powerpc64 little endian

(cherry picked from commit 63c559e781)
2020-11-16 07:00:24 +01:00
Miran
04f810c2ec Correct all eggs (#15906)
* "eg" is a misspelled "egg", "e.g." is "exempli gratia"
* Also, "ie" is "i.e.".

(cherry picked from commit bbe49a14ae)
2020-11-16 06:54:45 +01:00
Andreas Rumpf
3492178494 refactoring: removed cmdlinehelper.mainCommand callback 2020-10-11 20:44:04 +02:00
genotrance
442841037a Fix #12027 (#15519) 2020-10-10 07:04:57 +02:00
alaviss
dcd0ce1775 niminst: restore ZIP building functionality (#15472)
This is necessary for building Windows releases, was erroneously removed
by #15451.
2020-10-02 22:48:35 +02:00
alaviss
e3eae3f7c7 tools/deps: fix git dir check (#15470)
On Windows, a successful call will have a trailing newline appended, so
strip that away before doing any checks.
2020-10-02 18:52:20 +02:00
Juan Carlos
d1eb76184b Clean out niminst (#15451) 2020-10-01 22:19:06 +02:00
flywind
9c86f4867e fix doc search(escape HTML code) (#15433)
* use release version

* fix doc search
2020-09-30 10:52:49 +02:00
alaviss
d4892e9388 koch, compiler: bundle fusion as part of the source archive (#15409)
This allows distributions to build Nim from the downloaded source
archive without an Internet connection.
2020-09-26 09:31:55 +02:00
Juan Carlos
c4e03b540e Fix #15183 (#15300) 2020-09-11 08:57:57 +02:00
Jaremy Creechley
a76ae8f795 Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF) (#15250)
* Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF)

Adding FreeRTOS/LwIP to compiler:

* adding freertos option
* dyncalls for freertos
* add freertos to posix os list
* adding lwip option

Setting up networking FreeRTOS/LwIP Port:

* setting up lwip network for freertos
* fixing posix / networking for freertos
* disable setInheritable for freerots
* using lwip for net control items

* Fix builds by ignoring lib/posix/posix_freertos_consts.nim similar to lib/posix/posix_other_consts.nim
2020-08-31 11:48:54 +02:00
Clyybber
13e659cfec Big compiler Cleanup (#14777) 2020-08-28 22:18:09 +02:00
Miran
5c4e2bf68e fix nightlies: smaller log files (#15074)
Hopefully this will fix
"The job exceeded the maximum log length, and has been terminated."
2020-07-25 22:56:37 +02:00
Miran
4b93c61f0d jsre: try to fix nightlies (#15057) 2020-07-24 21:15:20 +02:00
narimiran
46aacf917f Fix style inconsistencies due to the previous commit 2020-07-06 11:24:43 +02:00
narimiran
ebaf603c84 revert 0944b0f4 2020-07-06 10:55:51 +02:00
Timothee Cour
695154970d deprecate existsDir; use dirExists instead (#14884) 2020-07-03 23:04:23 +02:00
Juan Carlos
4f6acf24ff Add jsre (#14870) 2020-07-03 20:13:10 +02:00
Timothee Cour
dc5a40f3f3 {.deprecated: [existsFile: fileExists].} (#14735)
* {.deprecated: [existsFile: fileExists].}

* s/existsFile/fileExists/ except under deps

* workaround pending #14819

* fix test
2020-07-02 16:19:13 +02:00
Timothee Cour
89a15e417d CI openbsd: 3x batching via NIM_TESTAMENT_BATCH ; overall CI finishes in 21m instead of 34m (#14851)
* CI openbsd: 2x batching via NIM_TESTAMENT_BATCH

* auto-generate .builds/openbsd_x.yml to avoid code duplication

* 3x batching
2020-06-30 14:21:30 +02:00
lbartoletti
5c1fa142d6 New freebsd platforms (#14801)
* add riscv as riscv64

* add all platforms supported by FreeBSD
2020-06-29 10:31:25 +02:00
alaviss
1a0725f022 koch: add --localdocs to allow building only local docs (#14783)
* koch: add --localdocs to allow building only local docs

This flag also make koch doc use the passed arguments when building
the offline docs.

This is useful when generating nightlies as we would want to use
--doccmd:skip and also skipping a pass of docgen speed things up
drastically (for non-native targets).

This flag superseded the undocumented --docslocal.

* kochdocs: filter google analytics code from the arg list instead

This commit introduce a small PEG expression to filter out the google
analytics code before building local docs when --localdocs is not
specified. This lets us keep any arguments unrelated to google analytics
when building local docs, useful for use with --doccmd:skip
2020-06-25 10:28:57 +02:00
Euan
0434aef4cd Patch #14716 - add missing when (#14792) 2020-06-24 18:44:10 +02:00
Euan
a3ae52de1a Fix #14715 - detect tool fails on FreeBSD (#14716) 2020-06-24 18:02:18 +02:00
Miran
e7f280bd26 Remove deprecated stuff from stdlib (#14699)
* update to the latest Jester

* remove deprecated procs from some stdlib modules

* 'criterion' is not maintained anymore and relies on obsolete stuff
2020-06-17 15:25:02 +02:00
Euan
7b12f13946 Use cc on OpenBSD and link to libm when building result (#14672) 2020-06-16 08:50:57 +02:00
alaviss
67d34366dc tools/kochdocs: add log folding supports for more CI services (#14643)
Added log folding for:
- Github Actions
- Azure Pipelines
2020-06-12 10:06:29 +02:00
lbartoletti
30c09e4607 [OpenBSD] Add arm support (#14608)
* add arm support to openbsd

* use clang on openbsd
2020-06-08 20:06:04 +02:00
Leorize
1715935846 ssl_config_parser: refactor for sanity reasons 2020-06-06 21:11:53 +02:00
Leorize
1fb2a58674 net: use a secure cipher list by default
Previously, the `net` module use the blanket "ALL" as the default cipher
list. This list may contain security ciphers that are weak and/or outdated
according to the current standard.

This commit introduces a new module `ssl_config` that contains the
latest OpenSSL configurations as recommended by Mozilla OpSec, and
make the `net` module use the cipher list targeting `intermediate`
compatibility level as the default.
2020-06-06 21:11:53 +02:00
Timothee Cour
4301a3da9d * honor --errorMax even for tools (eg drnim, nim doc) (#14546)
* fix a bug that prevented nim doc compiler/nim on windows
2020-06-02 18:54:33 +02:00
Timothee Cour
3cf88c2b49 walkDirRecFilter, update doc CI filter, compiler/index.nim for docs + various other fixes (#14501)
* update doc CI filter to include the files mostly likely to require doc rebuild
* remove code duplication in ./config/nimdoc.cfg; show link to compiler docs, various fixes
* walkDirRecFilter, factor nativeToUnixPath workaround
* glob for getRst2html
* docslocal: 40s to build all docs
* revert code dedup in github actions which did not work alas...
* fixups
2020-06-01 19:21:41 +02:00
Timothee Cour
cb6eb5268f enable compiler docs with their own index+search (#14493)
* enable compiler docs (with its own index)
2020-05-29 22:11:41 +02:00
alaviss
0533c43547 Revert "niminst: use threaded compression when supported (#14455)" (#14462)
This reverts commit b749d58ea1.
2020-05-27 08:33:24 +02:00
alaviss
b749d58ea1 niminst: use threaded compression when supported (#14455) 2020-05-26 14:05:51 +02:00
Timothee Cour
58282547f6 fix #6583, fix #14376, index+search now generated for all projects, many bug fixes with nim doc (#14324)
* refs #6583 fix nim doc output
* changelog
* change default for outDir when unspecified
* cleanups
* --project implies --index
2020-05-25 13:25:40 +02:00
Kaushal Modi
bf0e1c696f Remove the uses of {.procvar.} pragma (#14359)
This pragma did nothing.

Ref:
- https://github.com/nim-lang/Nim/issues/2172#issuecomment-383276469
- https://github.com/nim-lang/Nim/issues/12975
2020-05-15 23:37:24 +02:00
wltsmrz
c817e85f4c Linux updates (#14170)
* Add posix_memalign()

* Add linux-specific open() flags

O_TMPFILE: since Linux 3.11
O_PATH: since Linux 2.6.39
O_NOATIME: since Linux 2.6.8
O_DIRECT: since Linux 2.4.10

* Fix Stat type

* Fix POSIX AF_INET* const generation
2020-05-04 19:23:49 +02:00
Dien Tran
3be669be32 Move generated tex file to doc to correct location (#14191) 2020-05-02 23:49:08 +02:00
alaviss
22418ce8fb tools/finish: don't quote path with space (#14058) [backport]
Path with spaces should be added as is, quoting them makes utilities
treat the quotes as part of the path. This makes `nim` unable to be used
from the command line even if it appears to be added to user's Path
environment variable.

Even more confusing, Windows 10's PATH editor shows the path without any
quotes, you only see them when you use "Edit text". Took me a good 15
minutes to figure out why couldn't I run `nim` despite it being in Path.
2020-04-22 07:51:18 +02:00
alaviss
1bdc30bdb1 Make file descriptors from stdlib non-inheritable by default (#13201)
* io: make file descriptors non-inheritable by default

This prevents file descriptors/handles leakage to child processes
that might cause issues like running out of file descriptors, or potential
security issues like leaking a file descriptor to a restricted file.

While this breaks backward compatibility, I'm rather certain that not
many programs (if any) actually make use of this implementation detail.
A new API `setInheritable` is provided for the few that actually want to
use this functionality.

* io: disable inheritance at file creation time for supported platforms

Some platforms provide extension to fopen-family of functions to allow
for disabling descriptor inheritance atomically during File creation.
This guards against possible leaks when a child process is spawned
before we managed to disable the file descriptor inheritance
(ie. in a multi-threaded program).

* net, nativesockets: make sockets non inheritable by default

With this commit, sockets will no longer leak to child processes when
you don't want it to. Should solves a lot of "address in use" that might
occur when your server has just restarted.

All APIs that create sockets in these modules now expose a `inheritable`
flag that allow users to toggle inheritance for the resulting sockets.
An implementation of `setInheritance()` is also provided for SocketHandle.

While atomically disabling inheritance at creation time is supported on
Windows, it's only implemented by native winsock2, which is too much for
now. This support can be implemented in a future patch.

* posix: add F_DUPFD_CLOEXEC

This command duplicates file descriptor with close-on-exec flag set.

Defined in POSIX.1-2008.

* ioselectors_kqueue: don't leak file descriptors

File descriptors internally used by ioselectors on BSD/OSX are now
shielded from leakage.

* posix: add O_CLOEXEC

This flag allows file descriptors to be open() with close-on-exec flag
set atomically.

This flag is specified in POSIX.1-2008

* tfdleak: test for selectors leakage

Also simplified the test by using handle-type agnostic APIs to test for
validity.

* ioselectors_epoll: mark all fd created close-on-exec

File descriptors from ioselectors should no longer leaks on Linux.

* tfdleak: don't check for selector leakage on Windows

The getFd proc for ioselectors_select returns a hardcoded -1

* io: add NoInheritFlag at compile time

* io: add support for ioctl-based close-on-exec

This allows for the flag to be set/unset in one syscall. While the
performance gains might be negliable, we have one less failure point
to deal with.

* tfdleak: add a test for setInheritable

* stdlib: add nimInheritHandles to restore old behaviors

* memfiles: make file handle not inheritable by default for posix

* io: setInheritable now operates on OS file handle

On Windows, the native handle is the only thing that's inheritable, thus
we can assume that users of this function will already have the handle
available to them. This also allows users to pass down file descriptors
from memfiles on Windows with ease, should that be desired.

With this, nativesockets.setInheritable can be made much simpler.

* changelog: clarify

* nativesockets: document setInheritable return value

* posix_utils: atomically disable fd inheritance for mkstemp
2020-04-20 17:09:59 +02:00
Miran
06e0c75ba9 make fuzzy search a bit less fuzzy (#13996) [backport:1.2] 2020-04-16 20:22:32 +02:00
genotrance
35b046373a Improve #12920 fix (#13958) 2020-04-12 21:08:16 +02:00
alaviss
cc3f5d21b2 posix: add full Haiku support (#13931)
* posix: add full Haiku support

This commit provides a posix_haiku derived from posix_other, with types
following Haiku's definition. This fixes cases where the compiler
generates type check for the wrong types (ie. checks where generated for
an int-derived type but it's actually implemented as an uint instead).

* tools/kochdocs: welcome posix_haiku to the blacklist
2020-04-09 15:56:08 +02:00
Timothee Cour
93cd98dd14 move tinyc to a separate repo and allow installing external dependencency (eg tinyc) from koch / library code (#13850)
* remove tinyc
* installDeps
* update tinyc paths
2020-04-03 09:10:45 +02:00