Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Week-Of-Year Implementation to Times Module #17223

Merged
merged 19 commits into from
Jan 3, 2022
Merged

Conversation

capocasa
Copy link
Collaborator

@capocasa capocasa commented Mar 2, 2021

ISO Week-of-year implementation for the times module using algorithm from wikipedia, which is in turn from Van Gent, Math Department of Uttrecht University. Previously referenced on the forum, used for a year in production with no issues. Fairly comprehensive unit tests. Performance should be ok, additional bit twiddling possible but probably won't be needed by anyone. Nimble package also possible but very small / seems to fit better here. Feedback welcome.

@@ -522,6 +523,35 @@ proc getDaysInYear*(year: int): int =
doAssert getDaysInYear(2001) == 365
result = 365 + (if isLeapYear(year): 1 else: 0)

proc getWeeksInYear*(y: int): YearweekRange =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Natural and/or document that the argument must be positive, same with other proc.
Also needs {.since.} and changelog entry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help!

Copy link
Collaborator Author

@capocasa capocasa Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juancarlospaco > Use Natural

Added unit tests that demonstrate support for iron age dates instead (use case for negative integer)

Edit: Added {.since.} and changelog entry, I believe specified requirements are now complete

lib/pure/times.nim Outdated Show resolved Hide resolved

template initDateTime*(weekday: WeekDay, yearweek: YearweekRange, year: int,
hour: HourRange, minute: MinuteRange, second: SecondRange,
zone: Timezone = local()): DateTime =
Copy link
Member

@timotheecour timotheecour Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this overload? just use nanosecond: NanosecondRange = 0 above ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have two other initDateTime procs anyway, one of which is unnecessary, I assume @capocasa copied that from there?

Copy link
Collaborator Author

@capocasa capocasa Mar 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it that way for consistency with the existing API.

The alias proc isn't really unnecessary, it allows you to create a datetime by positional arguments with a time zone without specifying nanoseconds. I assume the original author concluded time zones were a more common use case than nanoseconds, and I agree. But even if you don't, having to remember which kind of initDateTime allows omitting nanoseconds with a time zone would suck, so the alias should stay for consistency's sake, expectations are there, too late to change them.

Edit: The correct way to add only one weekyear initDateTime seems to me to be to deprecate one of the existing ones, but I think it would better to add both and then potentially deprecate one of each later to decouple the deprecation discussion from adding week-of-year.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't aggravate the problem, let's just introduce 1 overload, not 2

proc initDateTime*(weekday: WeekDay, yearweek: YearweekRange, year: int,
                   hour: HourRange, minute: MinuteRange, second: SecondRange,
                   nanosecond: NanosecondRange,
                   zone: Timezone = local()): DateTime {.since: (1, 5).} =

in future work, we can discuss whether to deprecate the pre-existing

proc initDateTime(monthday: MonthdayRange; month: Month; year: int;
                  hour: HourRange; minute: MinuteRange; second: SecondRange;
                  zone: Timezone = local())

and make nanoseconds an option param for

proc initDateTime(monthday: MonthdayRange; month: Month; year: int;
                  hour: HourRange; minute: MinuteRange; second: SecondRange;
                  nanosecond: NanosecondRange; zone: Timezone = local())

@Varriount Varriount changed the title Yearweek Add Week-Of-Year Implementation to Times Module Mar 2, 2021
@capocasa
Copy link
Collaborator Author

capocasa commented Mar 2, 2021

I believe I have addressed all currently raised issues, please let me know if further improvements are in order. Thanks for all the input!

@GULPF GULPF self-requested a review March 2, 2021 16:58
lib/pure/times.nim Outdated Show resolved Hide resolved
@timotheecour
Copy link
Member

CI fails, you can run nim doc --lib:lib lib/pure/times.nim locally before pushing to avoid having to debug via CI

@@ -642,3 +642,65 @@ block: # ttimes
doAssert initDuration(milliseconds = 500).inMilliseconds == 500
doAssert initDuration(milliseconds = -500).inMilliseconds == -500
doAssert initDuration(nanoseconds = -999999999).inMilliseconds == -999

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add:

  block: # getWeeksInYear
    # add a few tests here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, caught a bug with negative years

Copy link
Member

@GULPF GULPF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A common gotcha for ISO week dates is that the year numbering is not the same as in the gregorian calendar. From the Wikipedia article:

The year number of the ISO week very often differs from the Gregorian year number for dates close to 1 January. For example, 29 December 2014 is ISO 2015-W01-1, i.e., it is in year 2015 instead of 2014. A programming bug confusing these two year numbers is probably the cause of some Android users of Twitter being unable to log in around midnight of 29 December 2014 UTC.[2]

And here it is expressed in code using the PR:

import times

var dt1 = initDateTime(29, mDec, 2014, 0, 0, 0, 0, utc())
var week = dt1.getWeekOfYear()
var dt2 = initDateTime(dt1.weekday, week, dt1.year, 0, 0, 0, 0, utc())
echo dt1.year # Prints 2014
echo dt2.year # Prints 2013

This gotcha can be somewhat avoided by designing the API differently. I like Pythons isocalendar function which returns all components of a ISO week date (year, week, weekday) since it gives a hint to the caller that the ISO week date year is special. I would suggest doing something similiar for the times module. The difference between the two different year numberings should also be pointed out in the doc comment for the new overload of initDateTime, since the year it takes as input is different from the other overloads.

@timotheecour
Copy link
Member

timotheecour commented Mar 3, 2021

As mentioned in #17223 (review), iso weak is error prone and the API should be designed to prevent user errors.

let's instead introduce what python provide. I suggest the following API:

type IsoCalendar* = object
  year*: int
  weekIso*: range[1..53]
  weekDay*: WeekDay

proc isoCalendar*(): IsoCalendar = ...

proc initDateTime*(iso: IsoCalendar, hour: HourRange, minute: MinuteRange, second: SecondRange,
                   nanosecond: NanosecondRange, zone: Timezone = local()): DateTime {.since: (1, 5).} = ...

note

As discussed in https://stackoverflow.com/questions/2600775/how-to-get-week-number-in-python, the ISO week is not the most intuitive one, and there are other ones we may want to add in future, that are commonly used, eg:

https://docs.python.org/3/library/time.html

Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.
Week number of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday are considered to be in week 0.

The API I suggested makes this possible without ambiguity, since we encapsulate with IsoCalendar, so other conventions can be added without confusion later, eg:

type XXXCalendar* = object ...
  # Week number of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday are considered to be in week 0.

note2

there should be a ..Warning explaining the gotcha's involved, along with runnableExamples that illustrate it (the current runnableExamples don't address this).

example: python

https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior

>>> datetime.date(2021, 1, 1).isocalendar()
datetime.IsoCalendarDate(year=2020, week=53, weekday=5)
>>> datetime.date(2021, 1, 1).strftime("%W")
'00'
>>> datetime.date(2021, 1, 1).strftime("%V")
'53'
>>> datetime.date(2021, 1, 1).strftime("%U")
'00'

@capocasa
Copy link
Collaborator Author

capocasa commented Mar 3, 2021

@GULPF

Thanks for the feedback! Good catch!

I would prefer to solve it by having a getWeekYear() proc that will give you the iso year, and highlighted warning about the difference with examples as in @timotheecour's note 2.

Rationale:

  1. Forcing the user to calculate 3 values when potentially only needing 1 is stylistically well suited to python, but not to Nim.
  2. The datetime is designed as an object with procs that take primary types. Weekday is not a big enough feature to justify the inconsistency introduced by departing from that.

@timotheecour

note1: IsoCalendar is too object heavy a design for the Nim standard library, in my mind. It makes it is clumsy to use in a lot of cases: e.g.

  • object with iso-num/day/year plus data about that date
  • placing iso-num/day/year in local variables.

Using type IsoCalendar* = tuple would alleviate that by allowing unpacking.

Good point to think about extending the API to sunday weeknums. But I think having to type initDateTime(initIsoCalender(..)) wouldn't be worth it. I think it would be best to be add an enum parameter [iso/north-america] to the relevant procs and default to iso if sunday-based weeknums are introduced, because that's only clumsy for the sunday case, which is to my knowledge rare.

note 2: as mentioned above, I think this is a great idea too.

I'll gladly implement whatever consensus we end up with for the API design and added examples/docs.

@capocasa
Copy link
Collaborator Author

capocasa commented Mar 3, 2021

@timotheecour

type IsoCalendar* = tuple
  year*: int
  weekIso*: range[1..53]
  weekDay*: WeekDay

proc isoCalendar*(): IsoCalendar = ...

proc initDateTime*(iso: IsoCalendar, hour: HourRange, minute: MinuteRange, second: SecondRange,
                   nanosecond: NanosecondRange, zone: Timezone = local()): DateTime {.since: (1, 5).} = ...

@capocasa capocasa closed this Mar 3, 2021
@capocasa capocasa reopened this Mar 3, 2021
@capocasa
Copy link
Collaborator Author

capocasa commented Mar 3, 2021

The more I think about it the more @timotheecour's suggestion to use an IsoCalendar makes sense to me, because it does sidestep a lot of potential confuse-the-weeknum-type bugs and it does make you think about what kind of year you are typing. Implementation works fine too.

I'm having a hard time getting over the parameter design of initDateTime(isocalendar, hour, minute, second, ns, timezone) though. Something about mixing an object type and several simple types just makes me shudder. In python that's not an issue because there is a date object.

@timotheecour
Copy link
Member

I'm having a hard time getting over the parameter design of initDateTime(isocalendar, hour, minute, second, ns, timezone) though. Something about mixing an object type and several simple types just makes me shudder. In python that's not an issue because there is a date object.

how about:

type IsoCalendar* = object
  year*: int
  weekIso*: range[1..53]
  weekDay*: WeekDay

type DayTime* = object
  hour: HourRange, minute: MinuteRange, second: SecondRange, nanosecond: NanosecondRange

proc initDateTime*(isoDay: IsoCalendar, dayTime: DayTime, zone: Timezone = local()): DateTime

IMO, it makes sense to have a dedicated type for DayTime, it makes API's more composable

@capocasa
Copy link
Collaborator Author

capocasa commented Mar 5, 2021

TL;DR isocalendar is Pythonic, not Nimish. We should use a simple variant distinct type to help the user distinguish iso and regular years.

After taking a little time to think this through, I have come to the conclusion that we should do two things:

  1. Release Iso week support with the current Api, adding a getYearWeek proc, and possible a variant distinct type for the iso year (non-iso week dates can be added later through an enum parameter)
  2. Create a proper RFC to explore adding Date, DayTime, IsoCalendar (or IsoDate), and something like SundayWeekDate- or possibly not doing that and adding IsoDatetime and SundayDatetimeobjects.

Rationale:

My aesthetical reaction to the initDateTime(IsoCalendar, hour, ...) was symptomatic of the amount of changes that would be needed to be made in order to create a consistent API that also contains an IsoCalendar object (or tuple).

By adding an IsoCalendar object, you introduced a Date object. You must then, to keep the design good- by which I mean, consistent enough to be usable, because surprise-through-arbitrariness is avoided- also introduce a regular Date object, with a monthday, month and year. And if you do that, you are equally obliged to also implement a DayTime object.

But all of that only makes sense if you ware also willing to implement all the math for all the objects as related to each other and related to all the other times objects. If you introduce the objects without also implementing all the related procs, then you introduced dead objects. In a library, if I have objects, I need the math that goes with them in procs.

That is a lot of implementing just to give users a little nudge about the iso year, something they should know about anyway if they are going to use the concept. It's not that hard, you can see it in any calendar, physical or software, so the reminder in the docs should suffice- or potentially a simple variant distinct type for isoyear would solve the problem just as well, if not better, than python isocalendar does.

Now, of course, it might actually make sense to add all those objects and all those procs- that's what Python does, and that's why isocalendar feels elegant in Python. Personally, I missed Date and DayTime from Python (where it is called "Time") at first, but I quickly realized that I can just use a partially zeroed DateTime to represent dates or a TimeInterval shorter than 24 hours to represent time of day. So the minimalistic nature of the times module grew on me, and now I like it. But a PR about week dates is not really the best place to be discussing huge API changes for a module, so this should be explored in the context of a proper RFC that would explicitly accept or reject python-style date and daytime objects.

If don't add the Date and DayTime objects for regular dates, we can't add it for week day, either, without being infuriatingly arbitrary- something Nim has avoided so far, unlike, say, PHP (I know enough about PHP to want to avoid its design flaws at all cost, and arbitrary inconsistency tops the list). Therefore, I believe that the best choice is to follow as closely as possible the existing API design, which is what I did my best to do within the current pull request (minus the missing getWeekYear() proc that will be added).

Even this pull request were to get merged right now- and date, daytime and isocalendar were approved and added later- I think the resulting combined API is still good. Sometimes you need an iso week, and sometimes you need the full date, and you can get either.

So that is why I think we can afford to move forward with this pull request and add the missing functionality, and open the big can of worms later.

Comments and questions welcome! Thanks to everyone for contributing their thoughts so far.

@capocasa
Copy link
Collaborator Author

capocasa commented Mar 8, 2021

Done implementing changes!

  • Added distinct IsoYear type to prevent week-based/regular year confusion, and allow adding initDateTime overloads for other week number calendars
  • renamed getWeeksInYear to getWeeksInIsoYear to allow adding other week numbers
  • removed getWeekYear proc
  • Added getIsoWeekAndYear proc. iso-week calculation also yields the iso-year "for free", so it's most straight-forward to return both
  • Examples now reflect differences between regular year and week-based ISO year
  • Updated tests
  • Updated changelog entry

Discussion:

The API design assumes no changes will be made to times.

If Date, IsoDate and DayTime objects were to be introduced, the current getIsoWeekAndYear would be easy enough to be replaced with, or called by, an additional getIsoDate proc.

I believe I have addressed all concerns raised in the discussion so far, although for practical reasons not necessarily in the suggested way. But I am really quite pleased by how much better this PR's quality got thanks to all your input. And I really appreciate the welcoming quick help addressing my newbie mistakes, as well.

If you feel you need to raise further issues, or have additional feedback, suggestions or questions, I'd be more than happy to address those, as well.

lib/pure/times.nim Outdated Show resolved Hide resolved
@capocasa capocasa closed this Mar 10, 2021
@timotheecour timotheecour added the stale Staled PR/issues; remove the label after fixing them label Mar 10, 2021
@ghost
Copy link

ghost commented Mar 10, 2021

Sorry if my question is a bit rude, but is there any reason for this PR to be closed?

@capocasa
Copy link
Collaborator Author

Not rude at all! The reason is that I attempted to close the github app by pressing the pull request's "close" button, and I couldn't figure out how to reopen it until now, on Desktop.

@capocasa capocasa reopened this Mar 10, 2021
@stale stale bot removed the stale Staled PR/issues; remove the label after fixing them label Mar 10, 2021
@capocasa
Copy link
Collaborator Author

Rebased in the hope to successfully compete for scarce merge reviewing resources

@@ -288,6 +288,9 @@ type
YeardayRange* = range[0..365]
NanosecondRange* = range[0..999_999_999]

IsoWeekRange* = range[1 .. 53]
IsoYear* = distinct int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add doc comments for these two new types.

@Araq
Copy link
Member

Araq commented Dec 20, 2021

As I said above, add a couple of more doc comments and then a changelog entry. Thanks!

@capocasa
Copy link
Collaborator Author

capocasa commented Jan 2, 2022

Thanks for the review! Changelog entry was already there from last time, added the mentioned docstrings.

lib/pure/times.nim Outdated Show resolved Hide resolved
lib/pure/times.nim Outdated Show resolved Hide resolved
changelog.md Outdated Show resolved Hide resolved
Co-authored-by: konsumlamm <[email protected]>
@Araq Araq merged commit e49d52e into nim-lang:devel Jan 3, 2022
Clyybber pushed a commit to Clyybber/nimskull that referenced this pull request Feb 25, 2022
Concerns these changes:
nim-lang/Nim@727c637...340b5a1

Excluded changes are:
nim-lang/Nim#18963
nim-lang/Nim#19003
nim-lang/Nim#19043
nim-lang/Nim#19055
nim-lang/Nim#19053
nim-lang/Nim#19064
nim-lang/Nim#18642
nim-lang/Nim#19062
nim-lang/Nim#19082
nim-lang/Nim#19090
nim-lang/Nim#19077
nim-lang/Nim#19021
nim-lang/Nim#19100
nim-lang/Nim#19102
nim-lang/Nim#19111
nim-lang/Nim#19115
nim-lang/Nim#19133
nim-lang/Nim#19142
nim-lang/Nim#19158
nim-lang/Nim#19129
nim-lang/Nim#19137
nim-lang/Nim#19168
nim-lang/Nim#19156
nim-lang/Nim#19147
nim-lang/Nim#19180
nim-lang/Nim#19183
nim-lang/Nim#19182
nim-lang/Nim#19187
nim-lang/Nim#19179
nim-lang/Nim#19209
nim-lang/Nim#19210
nim-lang/Nim#19207
nim-lang/Nim#19219
nim-lang/Nim#19195
nim-lang/Nim#19212
nim-lang/Nim#19134
nim-lang/Nim#19235
nim-lang/Nim#19252
nim-lang/Nim#19196
nim-lang/Nim#19295
nim-lang/Nim#19301
nim-lang/Nim#19181
nim-lang/Nim#17223
nim-lang/Nim#19370
nim-lang/Nim#19385
nim-lang/Nim#19307
nim-lang/Nim#19394
nim-lang/Nim#19399
nim-lang/Nim#19390
nim-lang/Nim#19407
nim-lang/Nim#19419
nim-lang/Nim#19421
nim-lang/Nim#19363
nim-lang/Nim#19406
nim-lang/Nim#19431
nim-lang/Nim#19455
nim-lang/Nim#19461
nim-lang/Nim@cb894c7
nim-lang/Nim#19462
nim-lang/Nim#19442
nim-lang/Nim#19437
nim-lang/Nim#19433
nim-lang/Nim#19512
nim-lang/Nim#19487
nim-lang/Nim#19543

Excluded changes include major changes which require more consideration
and changes which don't apply to the current code anymore but could be
worth porting over still.

Excluded changes which only change the identifier casing in tests
or only concern code removed in nimskull aren't listed.

Begin commit listing:

use two underscores for easy demangling [backport:1.6] (#19028)

Add Elbrus 2000 architecture (#19024)

* Add Elbrus 2000 architecture

* Add e2k to niminst

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <[email protected]>

remove exception (#18906)

allow converting static vars to `openArray` (#19035)

When assigning constant output to a seq, and then passing that static
seq to other functions that take `openArray`, the compiler may end up
producing errors, as it does not know how to convert `static[seq[T]]`
to `openArray[T]`. By ignoring the `static` wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to `internal error: inconsistent
environment type`, instead of the relevant `openArrayLoc` error message.

use the correct header for TIOCGWINSZ on Solaris (#19037)

Minor update to terminal docs (#19056)

* Update terminal.nim

- Added some extra docs to cursorUp/Down/Forward/Backward
- I was able to use hideCursor and showCursor without adding stdout, removed the parameter
- Added docs to terminalHeight()* and terminalWidth()*

* Update lib/pure/terminal.nim

Co-authored-by: konsumlamm <[email protected]>

* Update lib/pure/terminal.nim

Co-authored-by: konsumlamm <[email protected]>

* Added back f: file to cursor movement

* Removed unnecessary comments

Co-authored-by: konsumlamm <[email protected]>

fix a tiny formating issue in doc/destructors.rst (#19058)

fix a tiny code snippet formatting issue in `doc/constructors.rst`, again (#19065)

Fix nimIdentNormalize, fixes #19067 (#19068)

* Make nimIdentNormalize return "" when passed ""; fixes #19067

Fixes #19067

* Add tests for nimIdentNormalize

fix #18971 (#19070) [backport:1.6]

since the example code return value from global variable, instead
of first argument, the `n.len` is 1 which causes compiler crashes.

fixes #19000 (#19032)

* fixes #19000

* progress

fix #18410 (Errors initializing an object of RootObj with the C++ backend) [backport] (#18836)

* fix #18410

* one line comment

* typo

* typo

* cover cpp

update numbers of lifetime-tracking hooks in doc/destructors.rst (#19088)

bootstrapping Nim compiler with `cpp --gc:orc` (#19087)

libs/impore/re: Add note about the requirement of `matches` to be pre-allocated (#19081)

Add few runnableExamples for `findBounds` for clarity.

Fixes nim-lang/Nim#18775

Add test for issue 15435 (#19079)

* Add test for issue 15435

Closes nim-lang/Nim#15435.

* Specify bug # in comment

Addresses nim-lang/Nim#19079 (comment)

manual: Document the use of `static` as a proc call (#19084)

* manual: Document the use of `static` as a proc call

Also adds tests.

Fixes nim-lang/Nim#16987 .

* Update doc/manual.rst

Co-authored-by: konsumlamm <[email protected]>

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

* manual: Undocument usage of foo.static

foo.static and foo.static() are not expected to work.

Ref: https://github.com/nim-lang/Nim/pull/19084/files#r741203578

Co-authored-by: konsumlamm <[email protected]>

manual: Document that comma propagates the default values of parameters (#19080)

* manual: Document that comma propagates the default values of parameters

Fixes nim-lang/Nim#15949.

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

fixes #19011 [backport:1.6] (#19114)

Add deprecation pragmas in lib/deprecated/pure (#19113)

Deprecate `std/sharedlist` and `std/sharedtables` (#19112)

fix nimindexterm in rst2tex/doc2tex [backport] (#19106)

* fix nimindexterm (rst2tex/doc2tex) [backport]

* Add support for indexing in rst

Call {.cursor.} a pragma. (#19116)

* Call {.cursor.} a pragma.

Its hard to find .curser annotation while googling because all other things like it are called pragmas. See https://nim-lang.org/docs/manual.html#pragmas
Also the . in front of the name makes it hard to find and search for.

Can we just call it cursor pragma?

* Small fix for comment.

Remove tlsEmulation enabled from Windows + GCC config (#19119) [backport:1.6]

This flag has a very significant performance impact on programs compiled with --threads:on. It is also apparently not needed anymore for standard circumstances. Can we remove the config? See nim-lang/Nim#18146 (comment) for discussion and perf impact. [backport:1.6]

Add security tip for setCookie (#19117)

* Add security tip for setCookie

* Update lib/pure/cookies.nim

Co-authored-by: Dominik Picheta <[email protected]>

* Update lib/pure/cookies.nim

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: Andreas Rumpf <[email protected]>
Co-authored-by: Dominik Picheta <[email protected]>
Co-authored-by: konsumlamm <[email protected]>

correct cookie docs (#19122)

refactoring: orc can use getThreadId() (#19123)

* refactoring: orc can use getThreadId()

* progress

fixed colorNames sorting mistake (#19125) [backport]

update manual (#19130) [backport]

Merge file size fields correctly on Windows (#19141)

* Merge file size fields correctly on Windows

Merge file size fields correctly on Windows

- Merge the two 32-bit file size fields from `BY_HANDLE_FILE_INFORMATION` correctly in `rawToFormalFileInfo`.
- Fixes #19135

* Update os.nim

Fix punycode.decode function (#19136)

* Refactor: rename proc to func

* Fix punycode.decode function

This function could only properly decode punycodes containing a single
encoded unicode character. As soon as there was more than one punycode
character group to decode it produced invalid output - the number of
characters was correct, but their position was not.

* Update tpunycode.nim

Co-authored-by: Clay Sweetser <[email protected]>

Fix undeclared 'SYS_getrandom' on emscripten (#19144)

wrong spaces (3 => 2) (#19145)

`caseStmtMacros` no longer experimental, experimental manual refactor (#19173)

* `caseStmtMacros` no longer experimental, experimental manual refactor

* Update doc/manual.rst

* apply review suggestions

* apply review

Co-authored-by: Andreas Rumpf <[email protected]>

fix inline syntax highlighting in system.nim (#19184)

swap port to correct port order (#19177)

Co-authored-by: Jaremy Creechley <[email protected]>

feat: TLS-ALPN wrappers for OpenSSL (#19202)

Co-authored-by: Iced Quinn <[email protected]>

misc bugfixes [backport:1.2] (#19203)

treat do with pragmas but no parens as proc (#19191)

fixes #19188

[format minor] remove unnecessary spaces (#19216)

Making TCC work again on Windows --cpu:amd64 - fix #16326 (#19221)

* fix #16326

* removing comments

fixes a converter handling regression that caused private converters to leak into client modules; fixes #19213; [backport:1.6] (#19229)

Add support for LoongArch (#19223)

* Add support for LoongArch

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <[email protected]>

remove `std/sharedstrings` (#19228)

* remove std/sharedstrings

it has been broken since 0.18.0

* rephrase the changelog entry

add comments to spawn and pinnedSpawn (#19230)

`spawn` uses `nimSpawn3` internally and `pinnedSpawn` uses `nimSpawn4` internally. I comment it in order to help contributors get the gist of its functionality.

fixes an old ARC bug: the produced copy/sink operations don't copy the hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)

nimRawSetjmp: support Windows (#19197)

* nimRawSetjmp: support Windows

Using `_setjmp()` directly is required to avoid some rare (but very
annoying) exception-related stack corruption leading to segfaults on
Windows, with Mingw-w64 and SEH.
More details: status-im/nimbus-eth2#3121

Also add "nimBuiltinSetjmp" - mostly for benchmarking.

* fix for Apple's Clang++

Revert "swap port to correct port order (#19177)" (#19234)

This reverts commit 0d0c249.

move toDeque to after addLast (#19233) [backport:1.0]

Changes the order of procs definitions in order to avoid calling an undefined proc.

let Nim support Nimble 0.14 with lock-file support [backport:1.6] (#19236)

nimc.rst: fix table markup (#19239)

Various std net improvements (#19132)

* Variant of  that works with raw IpAddresses.

- Add doc tests for new net proc's.
- Aadd recvFrom impl
- Add recvFrom impl -- tweak handling data var

- Update lib/pure/net.nim
	Co-authored-by: Dominik Picheta <[email protected]>

- cleaning up sendTo args
- remove extra connect test
- cleaning up sendTo args
- fix inet_ntop test
- fix test failing - byte len

* fix test failing - byte len

* debugging odd windows build failure

* debugging odd windows build failure

* more experiments to figure out the windows failure

* try manual assigment on InAddr

Co-authored-by: Jaremy Creechley <[email protected]>

fix bug #14468 zero-width split (#19248)

basicopt.txt: Unify the format (#19251)

fix: fixes bug in CVerifyPeerUseEnvVars (#19247)

Previously CVerifyPeerUseEnvVars was not being passed into
scanSslCertificates, which meant that we weren't scanning
additional certificate locations given via the SSL_CERT_FILE and
SSL_CERT_DIR environment variables

suggestion to respect typedarray type (#19257)

* suggestion to respect typedarray

* Update jssys.nim

Co-authored-by: Sven Keller <[email protected]>

fix #19244 - solves the problem of the InAddr object constructor in Windows. (#19259)

* Update winlean.nim

* Update tnet_ll.nim

Fixed typo in manual.rst unsafeAssign->uncheckedAssign. Fixes part 1 of #19266 (#19267)

use uppercase "type" for Proxy-Authorization header (#19273)

Some servers will reject authorization requests with a lowercase "basic" type. Changing to "Basic" seems to solve these issues.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization

Update colors.nim (#19274)

* Update colors.nim

Added `lightgray` alias to `lightgrey` and `...grey`aliases for the rest of the gray colors.
Added color `rebeccapurple`.
Fixed the incorrect values for the `PaleVioletRed` and `MediumPurple` colors.
This module should now be matching the CSS colors.
I used the seq[tuple] syntax for defining the names.

* Document colors changes.

Extract runnables that specify `doccmd` (#19275) [backport:1.6]

Fix build on FreeBSD/powerpc (#19282)

It's currently misdetected as powerpc64.

Fix #19107 (#19286) [backport]

fixes grammar typos [backport] (#19289)

fix 19292 (#19293)

Fix #19297 - fixing broken list after adding empty list (#19299)

* Update lists.nim

* Update tlists.nim

* removed check `if b.tail != nil`

The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.

fixes #16617 [backport] (#19300)

Update JS and nimscript import tests (#19306)

* add new modules, except experimental ones
* remove deprecated modules mersenne and sharedlist
* better describe why some modules fail and some modules don't

add compile time option for POSIX sigwait on Illumos/Solaris (#19296)

* add compile time option for POSIX sigwait on Illumos/Solaris

* fix link to documentation of `sigwait` on Illumos/Solaris

[docs] clarify the raised exception (#19308)

* [docs] clarify the raised exception

Lest developers wanna know what the exception is.

* Apply suggestions from @konsumlamm

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: konsumlamm <[email protected]>

docs: Fix typo in tut1.rst (#19309)

Fix #19314 - fixing broken `DoublyLinkedList` after adding empty `DoublyLinkedList` (#19315) [backport]

* Update lists.nim

* Update tlists.nim

fixed typos (#19316)

devel: style fix (#19318)

this allows "--styleCheck:usages --styleCheck:error"

docs: Fix typo in tut1.rst (#19324)

correct the comments (#19322)

--expandArc

```
var
  a
  b
a = matrix(5, 5, 1.0)
b = matrix(5, 5, 2.0)
`=sink`(b, -
  let blitTmp = b
  wasMoved(b)
  blitTmp +
    a)
`=destroy`(b)
`=destroy`(a)
```

add std/private/win_getsysteminfo; refactor the usage of `GetSystemInfo` (#19310)

* add std/private/win_getsysteminfo

* import at the top level

* wrappers follow nep1 too

* follow review comment

Update net.nim (#19327) [backport]

Fix #19038 - making the Nim compiler work again on Windows XP (#19331)

* Update osenv.nim

* Update win_setenv.nim

* Update lib/pure/includes/osenv.nim

* Update lib/pure/includes/osenv.nim

* fixing cstring

Co-authored-by: Andreas Rumpf <[email protected]>

fix nim-lang#19343 (#19344) [backport]

Ensure HttpClient onProgress is called once per second
Ensure that reported speed is accurate

stylecheck usages part two: stdlib cleanup (#19338)

* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

added filemode docs (#19346)

Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)

fix stylecheck error with asyncdispatch (#19350)

* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

* fix stylecheck error with asyncdispatch

it is a partial regression since #12842

* add tests

* don't use echo in tests

remove spaces between an identifier and a star (#19355)

It makes search easier by searching `+`* instead of `+` which filter lots of unexported versions.

Follow nim-lang/Nim#18681

bitsets.nim: cleanup (#19361)

make rst thread safe (#19369)

split for the convenience of review

docs: Mention `import foo {.all.}` syntax (#19377)

Mention the `import foo {.all.}` syntax in the manual,
with a caveat about private imports.
Also link to the experimental importutils module.

Co-authored-by: adigitoleo <[email protected]>

update copyright year (#19381)

docs: Fix broken cross references to `rfind` in strutils (#19382) [backport]

Fixes three broken cross references to `rfind` in strutils.
Breakage due to signature changes of the `rfind` methods.

Co-authored-by: adigitoleo <[email protected]>

move type operation section and remove deepcopy document (#19389)

ref #19173; because deepcopy is not fit for ORC/ARC which was used for spawn and spawn will be removed from compiler

deprecate unsafeAddr; extend addr (#19373)

* deprecate unsafeAddr; extend addr

addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr

* follow @Vindaar's advice

* change the signature of addr

* unsafeAddr => addr (stdlib)

* Update changelog.md

* unsafeAddr => addr (tests)

* Revert "unsafeAddr => addr (stdlib)"

This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c.

* doc changes; thanks to @konsumlamm

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: konsumlamm <[email protected]>

improve changelog a bit (#19400)

mangle names in nimbase.h using cppDefine (#19395) [backport]

mangle names in nimbase.h
fix comments

Optimize lent in JS [backport:1.6] (#19393)

* Optimize lent in JS [backport:1.6]

* addr on lent doesn't work anymore, don't use it

* use unsafeAddr  in test again for older versions

update deprecated example (#19415)

`toNimIdent` proc is deprecated, so I replaced it with `ident` proc

Improve Zshell completion (#19354)

fix stricteffects (nimsuggest/sexp) (#19405)

* fix stricteffects (nimsuggest/sexp)

* Update tstrict_effects3.nim

* Update tests/effects/tstrict_effects3.nim

suppress deprecated warnings (#19408)

* suppress deprecated warnings

once bump version to 1.7.3 enable deprecated messages

* deprecate later

add an example to setControlCHook (#19416)

* add an example to setControlCHook

* [skip CI] format example for setControlCHook

Co-authored-by: Nathan Blaxall <[email protected]>

fix term rewriting with sideeffect (#19410)

* fix term rewriting with sideeffect

fix #6217

* add tests

* Update tests/template/template_various.nim

Resolve cross file resolution errors in atomics (#19422) [backport:1.6]

* Resolve call undeclared routine testAndSet

* Fix undeclared field atomicType

Fix #11923 (#19427)

* Apply commit nim-lang/Nim@5da931f that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma

os: faster getFileSize (#19438)

Use "stat" rather than "open", "seek", and "close" system calls.
The Windows implementation remains the same.

bugfix: varargs count as open arrays (#19447)

update outdated link (#19465)

Ref nim-lang/Nim#19463

Update jsfetch with latest API and fix missing bindings (#19473)

* Update with latest API and fix missing bindings

remove deprecated `Body`
remove implicit `cstring` convs
add `Headers` to `FetchOptions`
add `Request` init proc which takes `FetchOptions`

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <[email protected]>

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <[email protected]>

* remove experimental flag

Co-authored-by: Juan Carlos <[email protected]>

No longer segfault when using a typeclass with a self referencing type (#19467)

Clonkk fix2 11923 (#19451)

* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas

fix parseEnum cannot parse enum with const fields (#19466)

fix #19463

Add compilers and hints to default nim.cfg (#18424)

don't use a temp for addr [backport: 1.6] (#19503)

* don't use a temp for addr

fix #19497

* Update compiler/ccgcalls.nim

Co-authored-by: konsumlamm <[email protected]>

* add a test

Co-authored-by: konsumlamm <[email protected]>

fixes #19404 by protecting the memory we borrow from. this replaces crashes with minor memory leaks which seems to be acceptable. In the longer run we need a better VM that didn't grow hacks over a decade. (#19515)

Co-authored-by: flywind <[email protected]>

Remove backslash in glob pattern (#19524)

use OrderedTable instead of OrderedTableRef for mimedb (#19522)

* use OrderedTable instead of OrderedTableRef for mimedb

Signed-off-by: David Krause <[email protected]>

* added changelog entry for mimedb change

Signed-off-by: David Krause <[email protected]>

Remove Deprecated oids.oidsToString (#19519)

* Remove deprecated oids.oidToString

* Remove deprecated oids.oidToString

Remove deprecated math.c_frexp (#19518)

* Remove Deprecated math proc

* Remove Deprecated math proc

* Remove Deprecated math proc

[testcase] genSym fails to make unique identifier for ref object types (#19506)

close #15118

Documentation: Fix word usage (#19529)

Update chcks.nim (#19540)

keep casing of noinit and noreturn pragmas consistently documented (#19535)

compile pragma: cache the result sooner (#19554)

extccomp.addExternalFileToCompile() relies on hashes to decide whether
an external C file needs recompilation or not.

Due to short-circuit evaluation of boolean expressions, the procedure
that generates a corresponding hash file is not called the first time an
external file is compiled, so an avoidable recompilation is triggered
the next build.

This patch fixes that by moving the proc call with a desired side
effect from its boolean expression, so it's executed unconditionally.
Clyybber pushed a commit to Clyybber/nimskull that referenced this pull request Feb 25, 2022
Concerns these changes:
nim-lang/Nim@727c637...340b5a1

Excluded changes are:
nim-lang/Nim#18963
nim-lang/Nim#19003
nim-lang/Nim#19043
nim-lang/Nim#19055
nim-lang/Nim#19053
nim-lang/Nim#19064
nim-lang/Nim#18642
nim-lang/Nim#19062
nim-lang/Nim#19082
nim-lang/Nim#19090
nim-lang/Nim#19077
nim-lang/Nim#19021
nim-lang/Nim#19100
nim-lang/Nim#19102
nim-lang/Nim#19111
nim-lang/Nim#19115
nim-lang/Nim#19133
nim-lang/Nim#19142
nim-lang/Nim#19158
nim-lang/Nim#19129
nim-lang/Nim#19137
nim-lang/Nim#19168
nim-lang/Nim#19156
nim-lang/Nim#19147
nim-lang/Nim#19180
nim-lang/Nim#19183
nim-lang/Nim#19182
nim-lang/Nim#19187
nim-lang/Nim#19179
nim-lang/Nim#19209
nim-lang/Nim#19210
nim-lang/Nim#19207
nim-lang/Nim#19219
nim-lang/Nim#19195
nim-lang/Nim#19212
nim-lang/Nim#19134
nim-lang/Nim#19235
nim-lang/Nim#19252
nim-lang/Nim#19196
nim-lang/Nim#19295
nim-lang/Nim#19301
nim-lang/Nim#19181
nim-lang/Nim#17223
nim-lang/Nim#19370
nim-lang/Nim#19385
nim-lang/Nim#19307
nim-lang/Nim#19394
nim-lang/Nim#19399
nim-lang/Nim#19390
nim-lang/Nim#19407
nim-lang/Nim#19419
nim-lang/Nim#19421
nim-lang/Nim#19363
nim-lang/Nim#19406
nim-lang/Nim#19431
nim-lang/Nim#19455
nim-lang/Nim#19461
nim-lang/Nim@cb894c7
nim-lang/Nim#19462
nim-lang/Nim#19442
nim-lang/Nim#19437
nim-lang/Nim#19433
nim-lang/Nim#19512
nim-lang/Nim#19487
nim-lang/Nim#19543

Excluded changes include major changes which require more consideration
and changes which don't apply to the current code anymore but could be
worth porting over still.

Excluded changes which only change the identifier casing in tests
or only concern code removed in nimskull aren't listed.

Begin commit listing:

use two underscores for easy demangling [backport:1.6] (#19028)

Add Elbrus 2000 architecture (#19024)

* Add Elbrus 2000 architecture

* Add e2k to niminst

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <[email protected]>

remove exception (#18906)

allow converting static vars to `openArray` (#19035)

When assigning constant output to a seq, and then passing that static
seq to other functions that take `openArray`, the compiler may end up
producing errors, as it does not know how to convert `static[seq[T]]`
to `openArray[T]`. By ignoring the `static` wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to `internal error: inconsistent
environment type`, instead of the relevant `openArrayLoc` error message.

use the correct header for TIOCGWINSZ on Solaris (#19037)

Minor update to terminal docs (#19056)

* Update terminal.nim

- Added some extra docs to cursorUp/Down/Forward/Backward
- I was able to use hideCursor and showCursor without adding stdout, removed the parameter
- Added docs to terminalHeight()* and terminalWidth()*

* Update lib/pure/terminal.nim

Co-authored-by: konsumlamm <[email protected]>

* Update lib/pure/terminal.nim

Co-authored-by: konsumlamm <[email protected]>

* Added back f: file to cursor movement

* Removed unnecessary comments

Co-authored-by: konsumlamm <[email protected]>

fix a tiny formating issue in doc/destructors.rst (#19058)

fix a tiny code snippet formatting issue in `doc/constructors.rst`, again (#19065)

Fix nimIdentNormalize, fixes #19067 (#19068)

* Make nimIdentNormalize return "" when passed ""; fixes #19067

Fixes #19067

* Add tests for nimIdentNormalize

fix #18971 (#19070) [backport:1.6]

since the example code return value from global variable, instead
of first argument, the `n.len` is 1 which causes compiler crashes.

fixes #19000 (#19032)

* fixes #19000

* progress

fix #18410 (Errors initializing an object of RootObj with the C++ backend) [backport] (#18836)

* fix #18410

* one line comment

* typo

* typo

* cover cpp

update numbers of lifetime-tracking hooks in doc/destructors.rst (#19088)

bootstrapping Nim compiler with `cpp --gc:orc` (#19087)

libs/impore/re: Add note about the requirement of `matches` to be pre-allocated (#19081)

Add few runnableExamples for `findBounds` for clarity.

Fixes nim-lang/Nim#18775

Add test for issue 15435 (#19079)

* Add test for issue 15435

Closes nim-lang/Nim#15435.

* Specify bug # in comment

Addresses nim-lang/Nim#19079 (comment)

manual: Document the use of `static` as a proc call (#19084)

* manual: Document the use of `static` as a proc call

Also adds tests.

Fixes nim-lang/Nim#16987 .

* Update doc/manual.rst

Co-authored-by: konsumlamm <[email protected]>

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

* manual: Undocument usage of foo.static

foo.static and foo.static() are not expected to work.

Ref: https://github.com/nim-lang/Nim/pull/19084/files#r741203578

Co-authored-by: konsumlamm <[email protected]>

manual: Document that comma propagates the default values of parameters (#19080)

* manual: Document that comma propagates the default values of parameters

Fixes nim-lang/Nim#15949.

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

fixes #19011 [backport:1.6] (#19114)

Add deprecation pragmas in lib/deprecated/pure (#19113)

Deprecate `std/sharedlist` and `std/sharedtables` (#19112)

fix nimindexterm in rst2tex/doc2tex [backport] (#19106)

* fix nimindexterm (rst2tex/doc2tex) [backport]

* Add support for indexing in rst

Call {.cursor.} a pragma. (#19116)

* Call {.cursor.} a pragma.

Its hard to find .curser annotation while googling because all other things like it are called pragmas. See https://nim-lang.org/docs/manual.html#pragmas
Also the . in front of the name makes it hard to find and search for.

Can we just call it cursor pragma?

* Small fix for comment.

Remove tlsEmulation enabled from Windows + GCC config (#19119) [backport:1.6]

This flag has a very significant performance impact on programs compiled with --threads:on. It is also apparently not needed anymore for standard circumstances. Can we remove the config? See nim-lang/Nim#18146 (comment) for discussion and perf impact. [backport:1.6]

Add security tip for setCookie (#19117)

* Add security tip for setCookie

* Update lib/pure/cookies.nim

Co-authored-by: Dominik Picheta <[email protected]>

* Update lib/pure/cookies.nim

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: Andreas Rumpf <[email protected]>
Co-authored-by: Dominik Picheta <[email protected]>
Co-authored-by: konsumlamm <[email protected]>

correct cookie docs (#19122)

refactoring: orc can use getThreadId() (#19123)

* refactoring: orc can use getThreadId()

* progress

fixed colorNames sorting mistake (#19125) [backport]

update manual (#19130) [backport]

Merge file size fields correctly on Windows (#19141)

* Merge file size fields correctly on Windows

Merge file size fields correctly on Windows

- Merge the two 32-bit file size fields from `BY_HANDLE_FILE_INFORMATION` correctly in `rawToFormalFileInfo`.
- Fixes #19135

* Update os.nim

Fix punycode.decode function (#19136)

* Refactor: rename proc to func

* Fix punycode.decode function

This function could only properly decode punycodes containing a single
encoded unicode character. As soon as there was more than one punycode
character group to decode it produced invalid output - the number of
characters was correct, but their position was not.

* Update tpunycode.nim

Co-authored-by: Clay Sweetser <[email protected]>

Fix undeclared 'SYS_getrandom' on emscripten (#19144)

wrong spaces (3 => 2) (#19145)

`caseStmtMacros` no longer experimental, experimental manual refactor (#19173)

* `caseStmtMacros` no longer experimental, experimental manual refactor

* Update doc/manual.rst

* apply review suggestions

* apply review

Co-authored-by: Andreas Rumpf <[email protected]>

fix inline syntax highlighting in system.nim (#19184)

swap port to correct port order (#19177)

Co-authored-by: Jaremy Creechley <[email protected]>

feat: TLS-ALPN wrappers for OpenSSL (#19202)

Co-authored-by: Iced Quinn <[email protected]>

misc bugfixes [backport:1.2] (#19203)

treat do with pragmas but no parens as proc (#19191)

fixes #19188

[format minor] remove unnecessary spaces (#19216)

Making TCC work again on Windows --cpu:amd64 - fix #16326 (#19221)

* fix #16326

* removing comments

fixes a converter handling regression that caused private converters to leak into client modules; fixes #19213; [backport:1.6] (#19229)

Add support for LoongArch (#19223)

* Add support for LoongArch

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <[email protected]>

remove `std/sharedstrings` (#19228)

* remove std/sharedstrings

it has been broken since 0.18.0

* rephrase the changelog entry

add comments to spawn and pinnedSpawn (#19230)

`spawn` uses `nimSpawn3` internally and `pinnedSpawn` uses `nimSpawn4` internally. I comment it in order to help contributors get the gist of its functionality.

fixes an old ARC bug: the produced copy/sink operations don't copy the hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)

nimRawSetjmp: support Windows (#19197)

* nimRawSetjmp: support Windows

Using `_setjmp()` directly is required to avoid some rare (but very
annoying) exception-related stack corruption leading to segfaults on
Windows, with Mingw-w64 and SEH.
More details: status-im/nimbus-eth2#3121

Also add "nimBuiltinSetjmp" - mostly for benchmarking.

* fix for Apple's Clang++

Revert "swap port to correct port order (#19177)" (#19234)

This reverts commit 0d0c249.

move toDeque to after addLast (#19233) [backport:1.0]

Changes the order of procs definitions in order to avoid calling an undefined proc.

let Nim support Nimble 0.14 with lock-file support [backport:1.6] (#19236)

nimc.rst: fix table markup (#19239)

Various std net improvements (#19132)

* Variant of  that works with raw IpAddresses.

- Add doc tests for new net proc's.
- Aadd recvFrom impl
- Add recvFrom impl -- tweak handling data var

- Update lib/pure/net.nim
	Co-authored-by: Dominik Picheta <[email protected]>

- cleaning up sendTo args
- remove extra connect test
- cleaning up sendTo args
- fix inet_ntop test
- fix test failing - byte len

* fix test failing - byte len

* debugging odd windows build failure

* debugging odd windows build failure

* more experiments to figure out the windows failure

* try manual assigment on InAddr

Co-authored-by: Jaremy Creechley <[email protected]>

fix bug #14468 zero-width split (#19248)

basicopt.txt: Unify the format (#19251)

fix: fixes bug in CVerifyPeerUseEnvVars (#19247)

Previously CVerifyPeerUseEnvVars was not being passed into
scanSslCertificates, which meant that we weren't scanning
additional certificate locations given via the SSL_CERT_FILE and
SSL_CERT_DIR environment variables

suggestion to respect typedarray type (#19257)

* suggestion to respect typedarray

* Update jssys.nim

Co-authored-by: Sven Keller <[email protected]>

fix #19244 - solves the problem of the InAddr object constructor in Windows. (#19259)

* Update winlean.nim

* Update tnet_ll.nim

Fixed typo in manual.rst unsafeAssign->uncheckedAssign. Fixes part 1 of #19266 (#19267)

use uppercase "type" for Proxy-Authorization header (#19273)

Some servers will reject authorization requests with a lowercase "basic" type. Changing to "Basic" seems to solve these issues.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization

Update colors.nim (#19274)

* Update colors.nim

Added `lightgray` alias to `lightgrey` and `...grey`aliases for the rest of the gray colors.
Added color `rebeccapurple`.
Fixed the incorrect values for the `PaleVioletRed` and `MediumPurple` colors.
This module should now be matching the CSS colors.
I used the seq[tuple] syntax for defining the names.

* Document colors changes.

Extract runnables that specify `doccmd` (#19275) [backport:1.6]

Fix build on FreeBSD/powerpc (#19282)

It's currently misdetected as powerpc64.

Fix #19107 (#19286) [backport]

fixes grammar typos [backport] (#19289)

fix 19292 (#19293)

Fix #19297 - fixing broken list after adding empty list (#19299)

* Update lists.nim

* Update tlists.nim

* removed check `if b.tail != nil`

The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.

fixes #16617 [backport] (#19300)

Update JS and nimscript import tests (#19306)

* add new modules, except experimental ones
* remove deprecated modules mersenne and sharedlist
* better describe why some modules fail and some modules don't

add compile time option for POSIX sigwait on Illumos/Solaris (#19296)

* add compile time option for POSIX sigwait on Illumos/Solaris

* fix link to documentation of `sigwait` on Illumos/Solaris

[docs] clarify the raised exception (#19308)

* [docs] clarify the raised exception

Lest developers wanna know what the exception is.

* Apply suggestions from @konsumlamm

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: konsumlamm <[email protected]>

docs: Fix typo in tut1.rst (#19309)

Fix #19314 - fixing broken `DoublyLinkedList` after adding empty `DoublyLinkedList` (#19315) [backport]

* Update lists.nim

* Update tlists.nim

fixed typos (#19316)

devel: style fix (#19318)

this allows "--styleCheck:usages --styleCheck:error"

docs: Fix typo in tut1.rst (#19324)

correct the comments (#19322)

--expandArc

```
var
  a
  b
a = matrix(5, 5, 1.0)
b = matrix(5, 5, 2.0)
`=sink`(b, -
  let blitTmp = b
  wasMoved(b)
  blitTmp +
    a)
`=destroy`(b)
`=destroy`(a)
```

add std/private/win_getsysteminfo; refactor the usage of `GetSystemInfo` (#19310)

* add std/private/win_getsysteminfo

* import at the top level

* wrappers follow nep1 too

* follow review comment

Update net.nim (#19327) [backport]

Fix #19038 - making the Nim compiler work again on Windows XP (#19331)

* Update osenv.nim

* Update win_setenv.nim

* Update lib/pure/includes/osenv.nim

* Update lib/pure/includes/osenv.nim

* fixing cstring

Co-authored-by: Andreas Rumpf <[email protected]>

fix nim-lang#19343 (#19344) [backport]

Ensure HttpClient onProgress is called once per second
Ensure that reported speed is accurate

stylecheck usages part two: stdlib cleanup (#19338)

* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

added filemode docs (#19346)

Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)

fix stylecheck error with asyncdispatch (#19350)

* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

* fix stylecheck error with asyncdispatch

it is a partial regression since #12842

* add tests

* don't use echo in tests

remove spaces between an identifier and a star (#19355)

It makes search easier by searching `+`* instead of `+` which filter lots of unexported versions.

Follow nim-lang/Nim#18681

bitsets.nim: cleanup (#19361)

make rst thread safe (#19369)

split for the convenience of review

docs: Mention `import foo {.all.}` syntax (#19377)

Mention the `import foo {.all.}` syntax in the manual,
with a caveat about private imports.
Also link to the experimental importutils module.

Co-authored-by: adigitoleo <[email protected]>

update copyright year (#19381)

docs: Fix broken cross references to `rfind` in strutils (#19382) [backport]

Fixes three broken cross references to `rfind` in strutils.
Breakage due to signature changes of the `rfind` methods.

Co-authored-by: adigitoleo <[email protected]>

move type operation section and remove deepcopy document (#19389)

ref #19173; because deepcopy is not fit for ORC/ARC which was used for spawn and spawn will be removed from compiler

deprecate unsafeAddr; extend addr (#19373)

* deprecate unsafeAddr; extend addr

addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr

* follow @Vindaar's advice

* change the signature of addr

* unsafeAddr => addr (stdlib)

* Update changelog.md

* unsafeAddr => addr (tests)

* Revert "unsafeAddr => addr (stdlib)"

This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c.

* doc changes; thanks to @konsumlamm

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: konsumlamm <[email protected]>

improve changelog a bit (#19400)

mangle names in nimbase.h using cppDefine (#19395) [backport]

mangle names in nimbase.h
fix comments

Optimize lent in JS [backport:1.6] (#19393)

* Optimize lent in JS [backport:1.6]

* addr on lent doesn't work anymore, don't use it

* use unsafeAddr  in test again for older versions

update deprecated example (#19415)

`toNimIdent` proc is deprecated, so I replaced it with `ident` proc

Improve Zshell completion (#19354)

fix stricteffects (nimsuggest/sexp) (#19405)

* fix stricteffects (nimsuggest/sexp)

* Update tstrict_effects3.nim

* Update tests/effects/tstrict_effects3.nim

suppress deprecated warnings (#19408)

* suppress deprecated warnings

once bump version to 1.7.3 enable deprecated messages

* deprecate later

add an example to setControlCHook (#19416)

* add an example to setControlCHook

* [skip CI] format example for setControlCHook

Co-authored-by: Nathan Blaxall <[email protected]>

fix term rewriting with sideeffect (#19410)

* fix term rewriting with sideeffect

fix #6217

* add tests

* Update tests/template/template_various.nim

Resolve cross file resolution errors in atomics (#19422) [backport:1.6]

* Resolve call undeclared routine testAndSet

* Fix undeclared field atomicType

Fix #11923 (#19427)

* Apply commit nim-lang/Nim@5da931f that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma

os: faster getFileSize (#19438)

Use "stat" rather than "open", "seek", and "close" system calls.
The Windows implementation remains the same.

bugfix: varargs count as open arrays (#19447)

update outdated link (#19465)

Ref nim-lang/Nim#19463

Update jsfetch with latest API and fix missing bindings (#19473)

* Update with latest API and fix missing bindings

remove deprecated `Body`
remove implicit `cstring` convs
add `Headers` to `FetchOptions`
add `Request` init proc which takes `FetchOptions`

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <[email protected]>

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <[email protected]>

* remove experimental flag

Co-authored-by: Juan Carlos <[email protected]>

No longer segfault when using a typeclass with a self referencing type (#19467)

Clonkk fix2 11923 (#19451)

* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas

fix parseEnum cannot parse enum with const fields (#19466)

fix #19463

Add compilers and hints to default nim.cfg (#18424)

don't use a temp for addr [backport: 1.6] (#19503)

* don't use a temp for addr

fix #19497

* Update compiler/ccgcalls.nim

Co-authored-by: konsumlamm <[email protected]>

* add a test

Co-authored-by: konsumlamm <[email protected]>

fixes #19404 by protecting the memory we borrow from. this replaces crashes with minor memory leaks which seems to be acceptable. In the longer run we need a better VM that didn't grow hacks over a decade. (#19515)

Co-authored-by: flywind <[email protected]>

Remove backslash in glob pattern (#19524)

use OrderedTable instead of OrderedTableRef for mimedb (#19522)

* use OrderedTable instead of OrderedTableRef for mimedb

Signed-off-by: David Krause <[email protected]>

* added changelog entry for mimedb change

Signed-off-by: David Krause <[email protected]>

Remove Deprecated oids.oidsToString (#19519)

* Remove deprecated oids.oidToString

* Remove deprecated oids.oidToString

Remove deprecated math.c_frexp (#19518)

* Remove Deprecated math proc

* Remove Deprecated math proc

* Remove Deprecated math proc

[testcase] genSym fails to make unique identifier for ref object types (#19506)

close #15118

Documentation: Fix word usage (#19529)

Update chcks.nim (#19540)

keep casing of noinit and noreturn pragmas consistently documented (#19535)

compile pragma: cache the result sooner (#19554)

extccomp.addExternalFileToCompile() relies on hashes to decide whether
an external C file needs recompilation or not.

Due to short-circuit evaluation of boolean expressions, the procedure
that generates a corresponding hash file is not called the first time an
external file is compiled, so an avoidable recompilation is triggered
the next build.

This patch fixes that by moving the proc call with a desired side
effect from its boolean expression, so it's executed unconditionally.
Clyybber pushed a commit to Clyybber/nimskull that referenced this pull request Feb 25, 2022
Concerns these changes:
nim-lang/Nim@727c637...340b5a1

Excluded changes are:
nim-lang/Nim#18963
nim-lang/Nim#19003
nim-lang/Nim#19043
nim-lang/Nim#19055
nim-lang/Nim#19053
nim-lang/Nim#19064
nim-lang/Nim#18642
nim-lang/Nim#19062
nim-lang/Nim#19082
nim-lang/Nim#19090
nim-lang/Nim#19077
nim-lang/Nim#19021
nim-lang/Nim#19100
nim-lang/Nim#19102
nim-lang/Nim#19111
nim-lang/Nim#19115
nim-lang/Nim#19133
nim-lang/Nim#19142
nim-lang/Nim#19158
nim-lang/Nim#19129
nim-lang/Nim#19137
nim-lang/Nim#19168
nim-lang/Nim#19156
nim-lang/Nim#19147
nim-lang/Nim#19180
nim-lang/Nim#19183
nim-lang/Nim#19182
nim-lang/Nim#19187
nim-lang/Nim#19179
nim-lang/Nim#19209
nim-lang/Nim#19210
nim-lang/Nim#19207
nim-lang/Nim#19219
nim-lang/Nim#19195
nim-lang/Nim#19212
nim-lang/Nim#19134
nim-lang/Nim#19235
nim-lang/Nim#19252
nim-lang/Nim#19196
nim-lang/Nim#19295
nim-lang/Nim#19301
nim-lang/Nim#19181
nim-lang/Nim#17223
nim-lang/Nim#19370
nim-lang/Nim#19385
nim-lang/Nim#19307
nim-lang/Nim#19394
nim-lang/Nim#19399
nim-lang/Nim#19390
nim-lang/Nim#19407
nim-lang/Nim#19419
nim-lang/Nim#19421
nim-lang/Nim#19363
nim-lang/Nim#19406
nim-lang/Nim#19431
nim-lang/Nim#19455
nim-lang/Nim#19461
nim-lang/Nim@cb894c7
nim-lang/Nim#19462
nim-lang/Nim#19442
nim-lang/Nim#19437
nim-lang/Nim#19433
nim-lang/Nim#19512
nim-lang/Nim#19487
nim-lang/Nim#19543

Excluded changes include major changes which require more consideration
and changes which don't apply to the current code anymore but could be
worth porting over still.

Excluded changes which only change the identifier casing in tests
or only concern code removed in nimskull aren't listed.

Begin commit listing:

use two underscores for easy demangling [backport:1.6] (#19028)

Add Elbrus 2000 architecture (#19024)

* Add Elbrus 2000 architecture

* Add e2k to niminst

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <[email protected]>

remove exception (#18906)

allow converting static vars to `openArray` (#19035)

When assigning constant output to a seq, and then passing that static
seq to other functions that take `openArray`, the compiler may end up
producing errors, as it does not know how to convert `static[seq[T]]`
to `openArray[T]`. By ignoring the `static` wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to `internal error: inconsistent
environment type`, instead of the relevant `openArrayLoc` error message.

use the correct header for TIOCGWINSZ on Solaris (#19037)

Minor update to terminal docs (#19056)

* Update terminal.nim

- Added some extra docs to cursorUp/Down/Forward/Backward
- I was able to use hideCursor and showCursor without adding stdout, removed the parameter
- Added docs to terminalHeight()* and terminalWidth()*

* Update lib/pure/terminal.nim

Co-authored-by: konsumlamm <[email protected]>

* Update lib/pure/terminal.nim

Co-authored-by: konsumlamm <[email protected]>

* Added back f: file to cursor movement

* Removed unnecessary comments

Co-authored-by: konsumlamm <[email protected]>

fix a tiny formating issue in doc/destructors.rst (#19058)

fix a tiny code snippet formatting issue in `doc/constructors.rst`, again (#19065)

Fix nimIdentNormalize, fixes #19067 (#19068)

* Make nimIdentNormalize return "" when passed ""; fixes #19067

Fixes #19067

* Add tests for nimIdentNormalize

fix #18971 (#19070) [backport:1.6]

since the example code return value from global variable, instead
of first argument, the `n.len` is 1 which causes compiler crashes.

fixes #19000 (#19032)

* fixes #19000

* progress

fix #18410 (Errors initializing an object of RootObj with the C++ backend) [backport] (#18836)

* fix #18410

* one line comment

* typo

* typo

* cover cpp

update numbers of lifetime-tracking hooks in doc/destructors.rst (#19088)

bootstrapping Nim compiler with `cpp --gc:orc` (#19087)

libs/impore/re: Add note about the requirement of `matches` to be pre-allocated (#19081)

Add few runnableExamples for `findBounds` for clarity.

Fixes nim-lang/Nim#18775

Add test for issue 15435 (#19079)

* Add test for issue 15435

Closes nim-lang/Nim#15435.

* Specify bug # in comment

Addresses nim-lang/Nim#19079 (comment)

manual: Document the use of `static` as a proc call (#19084)

* manual: Document the use of `static` as a proc call

Also adds tests.

Fixes nim-lang/Nim#16987 .

* Update doc/manual.rst

Co-authored-by: konsumlamm <[email protected]>

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

* manual: Undocument usage of foo.static

foo.static and foo.static() are not expected to work.

Ref: https://github.com/nim-lang/Nim/pull/19084/files#r741203578

Co-authored-by: konsumlamm <[email protected]>

manual: Document that comma propagates the default values of parameters (#19080)

* manual: Document that comma propagates the default values of parameters

Fixes nim-lang/Nim#15949.

* Use the "bug #NNNN" comment syntax for consistency

Ref:
https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib

> Always refer to a GitHub issue using the following exact syntax: bug
for tooling.

fixes #19011 [backport:1.6] (#19114)

Add deprecation pragmas in lib/deprecated/pure (#19113)

Deprecate `std/sharedlist` and `std/sharedtables` (#19112)

fix nimindexterm in rst2tex/doc2tex [backport] (#19106)

* fix nimindexterm (rst2tex/doc2tex) [backport]

* Add support for indexing in rst

Call {.cursor.} a pragma. (#19116)

* Call {.cursor.} a pragma.

Its hard to find .curser annotation while googling because all other things like it are called pragmas. See https://nim-lang.org/docs/manual.html#pragmas
Also the . in front of the name makes it hard to find and search for.

Can we just call it cursor pragma?

* Small fix for comment.

Remove tlsEmulation enabled from Windows + GCC config (#19119) [backport:1.6]

This flag has a very significant performance impact on programs compiled with --threads:on. It is also apparently not needed anymore for standard circumstances. Can we remove the config? See nim-lang/Nim#18146 (comment) for discussion and perf impact. [backport:1.6]

Add security tip for setCookie (#19117)

* Add security tip for setCookie

* Update lib/pure/cookies.nim

Co-authored-by: Dominik Picheta <[email protected]>

* Update lib/pure/cookies.nim

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: Andreas Rumpf <[email protected]>
Co-authored-by: Dominik Picheta <[email protected]>
Co-authored-by: konsumlamm <[email protected]>

correct cookie docs (#19122)

refactoring: orc can use getThreadId() (#19123)

* refactoring: orc can use getThreadId()

* progress

fixed colorNames sorting mistake (#19125) [backport]

update manual (#19130) [backport]

Merge file size fields correctly on Windows (#19141)

* Merge file size fields correctly on Windows

Merge file size fields correctly on Windows

- Merge the two 32-bit file size fields from `BY_HANDLE_FILE_INFORMATION` correctly in `rawToFormalFileInfo`.
- Fixes #19135

* Update os.nim

Fix punycode.decode function (#19136)

* Refactor: rename proc to func

* Fix punycode.decode function

This function could only properly decode punycodes containing a single
encoded unicode character. As soon as there was more than one punycode
character group to decode it produced invalid output - the number of
characters was correct, but their position was not.

* Update tpunycode.nim

Co-authored-by: Clay Sweetser <[email protected]>

Fix undeclared 'SYS_getrandom' on emscripten (#19144)

wrong spaces (3 => 2) (#19145)

`caseStmtMacros` no longer experimental, experimental manual refactor (#19173)

* `caseStmtMacros` no longer experimental, experimental manual refactor

* Update doc/manual.rst

* apply review suggestions

* apply review

Co-authored-by: Andreas Rumpf <[email protected]>

fix inline syntax highlighting in system.nim (#19184)

swap port to correct port order (#19177)

Co-authored-by: Jaremy Creechley <[email protected]>

feat: TLS-ALPN wrappers for OpenSSL (#19202)

Co-authored-by: Iced Quinn <[email protected]>

misc bugfixes [backport:1.2] (#19203)

treat do with pragmas but no parens as proc (#19191)

fixes #19188

[format minor] remove unnecessary spaces (#19216)

Making TCC work again on Windows --cpu:amd64 - fix #16326 (#19221)

* fix #16326

* removing comments

fixes a converter handling regression that caused private converters to leak into client modules; fixes #19213; [backport:1.6] (#19229)

Add support for LoongArch (#19223)

* Add support for LoongArch

* Update compiler/installer.ini

Co-authored-by: Andreas Rumpf <[email protected]>

remove `std/sharedstrings` (#19228)

* remove std/sharedstrings

it has been broken since 0.18.0

* rephrase the changelog entry

add comments to spawn and pinnedSpawn (#19230)

`spawn` uses `nimSpawn3` internally and `pinnedSpawn` uses `nimSpawn4` internally. I comment it in order to help contributors get the gist of its functionality.

fixes an old ARC bug: the produced copy/sink operations don't copy the hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)

nimRawSetjmp: support Windows (#19197)

* nimRawSetjmp: support Windows

Using `_setjmp()` directly is required to avoid some rare (but very
annoying) exception-related stack corruption leading to segfaults on
Windows, with Mingw-w64 and SEH.
More details: status-im/nimbus-eth2#3121

Also add "nimBuiltinSetjmp" - mostly for benchmarking.

* fix for Apple's Clang++

Revert "swap port to correct port order (#19177)" (#19234)

This reverts commit 0d0c249.

move toDeque to after addLast (#19233) [backport:1.0]

Changes the order of procs definitions in order to avoid calling an undefined proc.

let Nim support Nimble 0.14 with lock-file support [backport:1.6] (#19236)

nimc.rst: fix table markup (#19239)

Various std net improvements (#19132)

* Variant of  that works with raw IpAddresses.

- Add doc tests for new net proc's.
- Aadd recvFrom impl
- Add recvFrom impl -- tweak handling data var

- Update lib/pure/net.nim
	Co-authored-by: Dominik Picheta <[email protected]>

- cleaning up sendTo args
- remove extra connect test
- cleaning up sendTo args
- fix inet_ntop test
- fix test failing - byte len

* fix test failing - byte len

* debugging odd windows build failure

* debugging odd windows build failure

* more experiments to figure out the windows failure

* try manual assigment on InAddr

Co-authored-by: Jaremy Creechley <[email protected]>

fix bug #14468 zero-width split (#19248)

basicopt.txt: Unify the format (#19251)

fix: fixes bug in CVerifyPeerUseEnvVars (#19247)

Previously CVerifyPeerUseEnvVars was not being passed into
scanSslCertificates, which meant that we weren't scanning
additional certificate locations given via the SSL_CERT_FILE and
SSL_CERT_DIR environment variables

suggestion to respect typedarray type (#19257)

* suggestion to respect typedarray

* Update jssys.nim

Co-authored-by: Sven Keller <[email protected]>

fix #19244 - solves the problem of the InAddr object constructor in Windows. (#19259)

* Update winlean.nim

* Update tnet_ll.nim

Fixed typo in manual.rst unsafeAssign->uncheckedAssign. Fixes part 1 of #19266 (#19267)

use uppercase "type" for Proxy-Authorization header (#19273)

Some servers will reject authorization requests with a lowercase "basic" type. Changing to "Basic" seems to solve these issues.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization

Update colors.nim (#19274)

* Update colors.nim

Added `lightgray` alias to `lightgrey` and `...grey`aliases for the rest of the gray colors.
Added color `rebeccapurple`.
Fixed the incorrect values for the `PaleVioletRed` and `MediumPurple` colors.
This module should now be matching the CSS colors.
I used the seq[tuple] syntax for defining the names.

* Document colors changes.

Extract runnables that specify `doccmd` (#19275) [backport:1.6]

Fix build on FreeBSD/powerpc (#19282)

It's currently misdetected as powerpc64.

Fix #19107 (#19286) [backport]

fixes grammar typos [backport] (#19289)

fix 19292 (#19293)

Fix #19297 - fixing broken list after adding empty list (#19299)

* Update lists.nim

* Update tlists.nim

* removed check `if b.tail != nil`

The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.

fixes #16617 [backport] (#19300)

Update JS and nimscript import tests (#19306)

* add new modules, except experimental ones
* remove deprecated modules mersenne and sharedlist
* better describe why some modules fail and some modules don't

add compile time option for POSIX sigwait on Illumos/Solaris (#19296)

* add compile time option for POSIX sigwait on Illumos/Solaris

* fix link to documentation of `sigwait` on Illumos/Solaris

[docs] clarify the raised exception (#19308)

* [docs] clarify the raised exception

Lest developers wanna know what the exception is.

* Apply suggestions from @konsumlamm

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: konsumlamm <[email protected]>

docs: Fix typo in tut1.rst (#19309)

Fix #19314 - fixing broken `DoublyLinkedList` after adding empty `DoublyLinkedList` (#19315) [backport]

* Update lists.nim

* Update tlists.nim

fixed typos (#19316)

devel: style fix (#19318)

this allows "--styleCheck:usages --styleCheck:error"

docs: Fix typo in tut1.rst (#19324)

correct the comments (#19322)

--expandArc

```
var
  a
  b
a = matrix(5, 5, 1.0)
b = matrix(5, 5, 2.0)
`=sink`(b, -
  let blitTmp = b
  wasMoved(b)
  blitTmp +
    a)
`=destroy`(b)
`=destroy`(a)
```

add std/private/win_getsysteminfo; refactor the usage of `GetSystemInfo` (#19310)

* add std/private/win_getsysteminfo

* import at the top level

* wrappers follow nep1 too

* follow review comment

Update net.nim (#19327) [backport]

Fix #19038 - making the Nim compiler work again on Windows XP (#19331)

* Update osenv.nim

* Update win_setenv.nim

* Update lib/pure/includes/osenv.nim

* Update lib/pure/includes/osenv.nim

* fixing cstring

Co-authored-by: Andreas Rumpf <[email protected]>

fix nim-lang#19343 (#19344) [backport]

Ensure HttpClient onProgress is called once per second
Ensure that reported speed is accurate

stylecheck usages part two: stdlib cleanup (#19338)

* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

added filemode docs (#19346)

Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)

fix stylecheck error with asyncdispatch (#19350)

* stylecheck usages part two: stdlib cleanup

typeinfo.nim: importCompilerProc => importcompilerproc

nre.nim: newLineFlags => newlineFlags

system.nim: JSRoot => JsRoot

ref #19319

* prefer importCompilerProc

* fix stylecheck error with asyncdispatch

it is a partial regression since #12842

* add tests

* don't use echo in tests

remove spaces between an identifier and a star (#19355)

It makes search easier by searching `+`* instead of `+` which filter lots of unexported versions.

Follow nim-lang/Nim#18681

bitsets.nim: cleanup (#19361)

make rst thread safe (#19369)

split for the convenience of review

docs: Mention `import foo {.all.}` syntax (#19377)

Mention the `import foo {.all.}` syntax in the manual,
with a caveat about private imports.
Also link to the experimental importutils module.

Co-authored-by: adigitoleo <[email protected]>

update copyright year (#19381)

docs: Fix broken cross references to `rfind` in strutils (#19382) [backport]

Fixes three broken cross references to `rfind` in strutils.
Breakage due to signature changes of the `rfind` methods.

Co-authored-by: adigitoleo <[email protected]>

move type operation section and remove deepcopy document (#19389)

ref #19173; because deepcopy is not fit for ORC/ARC which was used for spawn and spawn will be removed from compiler

deprecate unsafeAddr; extend addr (#19373)

* deprecate unsafeAddr; extend addr

addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr

* follow @Vindaar's advice

* change the signature of addr

* unsafeAddr => addr (stdlib)

* Update changelog.md

* unsafeAddr => addr (tests)

* Revert "unsafeAddr => addr (stdlib)"

This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c.

* doc changes; thanks to @konsumlamm

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: konsumlamm <[email protected]>

improve changelog a bit (#19400)

mangle names in nimbase.h using cppDefine (#19395) [backport]

mangle names in nimbase.h
fix comments

Optimize lent in JS [backport:1.6] (#19393)

* Optimize lent in JS [backport:1.6]

* addr on lent doesn't work anymore, don't use it

* use unsafeAddr  in test again for older versions

update deprecated example (#19415)

`toNimIdent` proc is deprecated, so I replaced it with `ident` proc

Improve Zshell completion (#19354)

fix stricteffects (nimsuggest/sexp) (#19405)

* fix stricteffects (nimsuggest/sexp)

* Update tstrict_effects3.nim

* Update tests/effects/tstrict_effects3.nim

suppress deprecated warnings (#19408)

* suppress deprecated warnings

once bump version to 1.7.3 enable deprecated messages

* deprecate later

add an example to setControlCHook (#19416)

* add an example to setControlCHook

* [skip CI] format example for setControlCHook

Co-authored-by: Nathan Blaxall <[email protected]>

fix term rewriting with sideeffect (#19410)

* fix term rewriting with sideeffect

fix #6217

* add tests

* Update tests/template/template_various.nim

Resolve cross file resolution errors in atomics (#19422) [backport:1.6]

* Resolve call undeclared routine testAndSet

* Fix undeclared field atomicType

Fix #11923 (#19427)

* Apply commit nim-lang/Nim@5da931f that was never merged (was part of a bigger PR). Should fix issue #11932

* add a generic object for custom pragma

os: faster getFileSize (#19438)

Use "stat" rather than "open", "seek", and "close" system calls.
The Windows implementation remains the same.

bugfix: varargs count as open arrays (#19447)

update outdated link (#19465)

Ref nim-lang/Nim#19463

Update jsfetch with latest API and fix missing bindings (#19473)

* Update with latest API and fix missing bindings

remove deprecated `Body`
remove implicit `cstring` convs
add `Headers` to `FetchOptions`
add `Request` init proc which takes `FetchOptions`

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <[email protected]>

* Update lib/std/jsfetch.nim

Co-authored-by: Juan Carlos <[email protected]>

* remove experimental flag

Co-authored-by: Juan Carlos <[email protected]>

No longer segfault when using a typeclass with a self referencing type (#19467)

Clonkk fix2 11923 (#19451)

* fix nnkBracketExpr not compiling for getImpl on customPragmaNode

* fix test import

* fix alias not working with hasCustomPragmas

fix parseEnum cannot parse enum with const fields (#19466)

fix #19463

Add compilers and hints to default nim.cfg (#18424)

don't use a temp for addr [backport: 1.6] (#19503)

* don't use a temp for addr

fix #19497

* Update compiler/ccgcalls.nim

Co-authored-by: konsumlamm <[email protected]>

* add a test

Co-authored-by: konsumlamm <[email protected]>

fixes #19404 by protecting the memory we borrow from. this replaces crashes with minor memory leaks which seems to be acceptable. In the longer run we need a better VM that didn't grow hacks over a decade. (#19515)

Co-authored-by: flywind <[email protected]>

Remove backslash in glob pattern (#19524)

use OrderedTable instead of OrderedTableRef for mimedb (#19522)

* use OrderedTable instead of OrderedTableRef for mimedb

Signed-off-by: David Krause <[email protected]>

* added changelog entry for mimedb change

Signed-off-by: David Krause <[email protected]>

Remove Deprecated oids.oidsToString (#19519)

* Remove deprecated oids.oidToString

* Remove deprecated oids.oidToString

Remove deprecated math.c_frexp (#19518)

* Remove Deprecated math proc

* Remove Deprecated math proc

* Remove Deprecated math proc

[testcase] genSym fails to make unique identifier for ref object types (#19506)

close #15118

Documentation: Fix word usage (#19529)

Update chcks.nim (#19540)

keep casing of noinit and noreturn pragmas consistently documented (#19535)

compile pragma: cache the result sooner (#19554)

extccomp.addExternalFileToCompile() relies on hashes to decide whether
an external C file needs recompilation or not.

Due to short-circuit evaluation of boolean expressions, the procedure
that generates a corresponding hash file is not called the first time an
external file is compiled, so an avoidable recompilation is triggered
the next build.

This patch fixes that by moving the proc call with a desired side
effect from its boolean expression, so it's executed unconditionally.
bors bot added a commit to nim-works/nimskull that referenced this pull request Feb 26, 2022
240: Merge upstream changes r=Clyybber a=Clyybber

Concerns these changes:
nim-lang/Nim@727c637...340b5a1

Excluded changes are:
nim-lang/Nim#18963
nim-lang/Nim#19003
nim-lang/Nim#19043
nim-lang/Nim#19055
nim-lang/Nim#19053
nim-lang/Nim#19064
nim-lang/Nim#18642
nim-lang/Nim#19062
nim-lang/Nim#19082
nim-lang/Nim#19090
nim-lang/Nim#19077
nim-lang/Nim#19021
nim-lang/Nim#19100
nim-lang/Nim#19102
nim-lang/Nim#19111
nim-lang/Nim#19115
nim-lang/Nim#19133
nim-lang/Nim#19142
nim-lang/Nim#19158
nim-lang/Nim#19129
nim-lang/Nim#19137
nim-lang/Nim#19168
nim-lang/Nim#19156
nim-lang/Nim#19147
nim-lang/Nim#19180
nim-lang/Nim#19183
nim-lang/Nim#19182
nim-lang/Nim#19187
nim-lang/Nim#19179
nim-lang/Nim#19209
nim-lang/Nim#19210
nim-lang/Nim#19207
nim-lang/Nim#19219
nim-lang/Nim#19195
nim-lang/Nim#19212
nim-lang/Nim#19134
nim-lang/Nim#19235
nim-lang/Nim#19252
nim-lang/Nim#19196
nim-lang/Nim#19295
nim-lang/Nim#19301
nim-lang/Nim#19181
nim-lang/Nim#17223
nim-lang/Nim#19370
nim-lang/Nim#19385
nim-lang/Nim#19307
nim-lang/Nim#19394
nim-lang/Nim#19399
nim-lang/Nim#19390
nim-lang/Nim#19407
nim-lang/Nim#19419
nim-lang/Nim#19421
nim-lang/Nim#19363
nim-lang/Nim#19406
nim-lang/Nim#19431
nim-lang/Nim#19455
nim-lang/Nim#19461
nim-lang/Nim@cb894c7
nim-lang/Nim#19462
nim-lang/Nim#19442
nim-lang/Nim#19437
nim-lang/Nim#19433
nim-lang/Nim#19512
nim-lang/Nim#19487
nim-lang/Nim#19543

Excluded changes include major changes which require more consideration
and changes which don't apply to the current code anymore but could be
worth porting over still.

Excluded changes which only change the identifier casing in tests
or only concern code removed in nimskull aren't listed.

Commit listing is in the commit message

Co-authored-by: The Nim Contributors <>
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
* initial

* more tests

* Apply suggestions from code review

idiomatize

Co-authored-by: Timothee Cour <[email protected]>

* test iron age dates

* add examples

* fix typo

* consistent param mention

* add since pragrams

* add changelog

* Update lib/pure/times.nim

Co-authored-by: Timothee Cour <[email protected]>

* fix examples

* fix negative years

* add getWeeksInYear tests

* add back fix dropped by rebase

* week-year tuple api

* add changelog

* fix doc tags

* add docstrings

* fix typos

Co-authored-by: konsumlamm <[email protected]>

Co-authored-by: Timothee Cour <[email protected]>
Co-authored-by: konsumlamm <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants