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

properly fixes #13758 so that import std/macros stays legal #14291

Merged
merged 3 commits into from
May 12, 2020

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented May 10, 2020

underlying issue remained (eg in #14285 I couldn't import std/browsers). The root cause is getAppFilename bugs on openBSD that are fixed in devel but not in csources; so it keeps bugging during bootstrap unless some precautions are taken (this PR):

* build nim from csources
* nim c koch
=> it loads config/nim.cfg
=> it processes `path="$lib/pure"`
=> calls loadConfigs => setDefaultLibpath => setDefaultLibpath => getAppDir => getAppFilename => getApplHeuristic
=> `getApplHeuristic` is buggy in v020 so returns returned wrong results (lib = "")
=> $lib/pure" is resolved to pure instead of /pathto/Nim/lib/pure
=> import std/macros gives: Error: cannot open file: std/macros

note that #12390 (thanks @euantorano) fixed getAppFilename for openbsd (although it still has bugs even for openbsd), but the exact same problem will affect any new platform we add since getApplHeuristic still has all the bugs that were fixed for openbsd.

CI failures unrelated

(a lot of these are because gitlab is giving 503: We are upgrading our database! see https://gitlab.com/define-private-public/HTML5-Canvas-Nim and https://status.gitlab.com/) timotheecour#113 (comment) timotheecour#113 (comment) timotheecour#113 (comment)

note

the bugs get compounded by several factors:

D20200327T021847

@timotheecour timotheecour force-pushed the exp_D20200327T021847 branch 3 times, most recently from cebc0ee to e1e7dfc Compare May 10, 2020 09:31
@timotheecour timotheecour changed the title [WIP] prep for https://github.com/timotheecour/Nim/issues/166 properly fixes #13758 so that import std/macros stays legal May 10, 2020
@timotheecour timotheecour marked this pull request as ready for review May 10, 2020 10:44
@timotheecour timotheecour reopened this May 10, 2020
@euantorano
Copy link
Contributor

euantorano commented May 10, 2020 via email

@timotheecour
Copy link
Member Author

timotheecour commented May 10, 2020

Doesn’t the FreeBSD CI script want the same change, just to make things equal?

no need, it wasn't broken for freebsd in v0.20.0 (nor were other platforms tested in CI). if/when csources2 becomes a thing, passing --lib:lib won't be needed anymore for bootstrap purposes. If needed I could instead add a bash function in ci/buildutils.sh that would build koch + do other things (that all CI can use) instead, but that can be done in separate PR (in fact that's what https://github.com/nim-lang/Nim/pull/13854/files#diff-4a42809a0e4d80710fa84a9f7ea26bcf was doing)

@euantorano
Copy link
Contributor

Ok, I just saw the change to build_all.sh which made me wonder.

@timotheecour
Copy link
Member Author

timotheecour commented May 10, 2020

Ok, I just saw the change to build_all.sh which made me wonder.

that's because build_all.sh is meant to be usable by all posix (including openbsd), whereas .builds/freebsd.yml is... just for freebsd and doesn't need it. But IMO the clean way to do this is code reuse (even if in bash) by doing it for example like I was doing it in https://github.com/nim-lang/Nim/pull/13854/files#diff-4a42809a0e4d80710fa84a9f7ea26bcf so that each CI can just call a shell function instead of inlining the code; it's not just about "nim c koch" it's about all the rest of the logic duplicated in all the CI's instead of being handled in just 1 place. That would avoid your concern too.

@Araq
Copy link
Member

Araq commented May 11, 2020

It's not just our CIs that have to be patched. Others cannot bootstrap from csources either with these changes.

@timotheecour
Copy link
Member Author

It's not just our CIs that have to be patched. Others cannot bootstrap from csources either with these changes.

PTAL, fixed differently

@Araq Araq added merge_when_passes_CI mergeable once green and removed merge_when_passes_CI mergeable once green labels May 11, 2020
@Araq
Copy link
Member

Araq commented May 11, 2020

Seems relevant:

d:\a\1\s\lib\core\macros.nim(568, 31) Error: 'untyped' is only allowed in templates and macros

@timotheecour timotheecour force-pushed the exp_D20200327T021847 branch 2 times, most recently from 30f24c9 to 542d116 Compare May 11, 2020 22:51
@timotheecour
Copy link
Member Author

timotheecour commented May 12, 2020

@Araq green now, finally (it almost turned into an argument in favor of bumping up csources2, but "unfortunately" didn't)

EchoPouet pushed a commit to EchoPouet/Nim that referenced this pull request Jun 13, 2020
…nim-lang#14291)

* properly fix nim-lang#12389
* use --lib:lib in koch.nim.cfg instead
* third time is the charm
timotheecour added a commit that referenced this pull request Apr 30, 2021
timotheecour added a commit that referenced this pull request Apr 30, 2021
Araq pushed a commit that referenced this pull request Apr 30, 2021
…ap + bsd (#17902)

* [WIP] bring back std/ prefix within compiler and ensure it works in bootstrap + bsd

* refs #16282 (comment)
* sounds very similar to #14291
* more: vmops
* update tools/ci_generate.nim
* auto-generate freebsd.yml as well, to avoid duplication with openbsd.yml
* cleanup
* undo temporary CI removal
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
…ap + bsd (nim-lang#17902)

* [WIP] bring back std/ prefix within compiler and ensure it works in bootstrap + bsd

* refs nim-lang#16282 (comment)
* sounds very similar to nim-lang#14291
* more: vmops
* update tools/ci_generate.nim
* auto-generate freebsd.yml as well, to avoid duplication with openbsd.yml
* cleanup
* undo temporary CI removal
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.

Building koch on OpenBSD fails unless the Nim directory is in $PATH
3 participants