Skip to content

Commit

Permalink
CIs: attempt to use csources_v1 (nim-lang#16282)
Browse files Browse the repository at this point in the history
* CIs: attempt to use csources_v1
* also updated the BSDs
* also updated azure pipelines
* std modules should not itself use the 'std/' import dir...
* compiler has to be careful with std/ for v1 booting
  • Loading branch information
Araq authored and PMunch committed Mar 28, 2022
1 parent 923d9ad commit e89b6a0
Show file tree
Hide file tree
Showing 57 changed files with 141 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .builds/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ environment:
tasks:
- setup: |
cd Nim
git clone --depth 1 -q https://github.com/nim-lang/csources.git
git clone --depth 1 -q https://github.com/nim-lang/csources_v1.git csources
gmake -C csources -j $(sysctl -n hw.ncpu)
bin/nim c --skipUserCfg --skipParentCfg koch
echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv
Expand Down
2 changes: 1 addition & 1 deletion .builds/openbsd_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ environment:
tasks:
- setup: |
cd Nim
git clone --depth 1 -q https://github.com/nim-lang/csources.git
git clone --depth 1 -q https://github.com/nim-lang/csources_v1.git csources
gmake -C csources -j $(sysctl -n hw.ncpuonline)
bin/nim c koch
echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv
Expand Down
2 changes: 1 addition & 1 deletion .builds/openbsd_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ environment:
tasks:
- setup: |
cd Nim
git clone --depth 1 -q https://github.com/nim-lang/csources.git
git clone --depth 1 -q https://github.com/nim-lang/csources_v1.git csources
gmake -C csources -j $(sysctl -n hw.ncpuonline)
bin/nim c koch
echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
id: csources-version
shell: bash
run: |
sha=$(git ls-remote https://github.com/nim-lang/csources master | cut -f 1)
sha=$(git ls-remote https://github.com/nim-lang/csources_v1 master | cut -f 1)
echo "::set-output name=sha::$sha"
- name: 'Get prebuilt csources from cache'
Expand All @@ -99,7 +99,7 @@ jobs:
if: steps.csources-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
repository: nim-lang/csources
repository: nim-lang/csources_v1
path: csources

- name: 'Build 1-stage compiler from csources'
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
echo $commitMsg | grep -v '\[skip ci\]' # fails if [skip ci] not in commit msg
displayName: 'Check whether to skip CI'
- bash: git clone --depth 1 https://github.com/nim-lang/csources
- bash: git clone --depth 1 https://github.com/nim-lang/csources_v1 csources
displayName: 'Checkout Nim csources'

- task: NodeTool@0
Expand Down
2 changes: 1 addition & 1 deletion ci/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ REM Some debug info
echo "Running on %CI_RUNNER_ID% (%CI_RUNNER_DESCRIPTION%) with tags %CI_RUNNER_TAGS%."
gcc -v

git clone --depth 1 https://github.com/nim-lang/csources.git
git clone --depth 1 https://github.com/nim-lang/csources_v1.git csources
cd csources
call build64.bat
cd ..
Expand Down
2 changes: 1 addition & 1 deletion ci/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sh ci/deps.sh

# Build from C sources.
git clone --depth 1 https://github.com/nim-lang/csources.git
git clone --depth 1 https://github.com/nim-lang/csources_v1.git csources
cd csources
sh build.sh
cd ..
Expand Down
2 changes: 1 addition & 1 deletion ci/nsis_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Rem Build csources
koch csources -d:release || exit /b

rem Grab C sources and nimsuggest
git clone --depth 1 https://github.com/nim-lang/csources.git
git clone --depth 1 https://github.com/nim-lang/csources_v1.git csources

set PATH=%CD%\bin;%PATH%

Expand Down
2 changes: 1 addition & 1 deletion compiler/extccomp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import ropes, platform, condsyms, options, msgs, lineinfos, pathutils

import std/[os, strutils, osproc, sha1, streams, sequtils, times, strtabs, json]
import os, strutils, osproc, std/sha1, streams, sequtils, times, strtabs, json

type
TInfoCCProp* = enum # properties of the C compiler:
Expand Down
6 changes: 3 additions & 3 deletions compiler/ic/cbackend.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
## also doing cross-module dependency tracking and DCE that we don't need
## anymore. DCE is now done as prepass over the entire packed module graph.

import std/[packedsets, algorithm, tables]
# std/intsets would give `UnusedImport`, pending https://github.com/nim-lang/Nim/issues/14246
import std/packedsets, algorithm, tables

import ".."/[ast, options, lineinfos, modulegraphs, cgendata, cgen,
pathutils, extccomp, msgs]

Expand Down Expand Up @@ -70,7 +70,7 @@ proc addFileToLink(config: ConfigRef; m: PSym) =
addFileToCompile(config, cf)

when defined(debugDce):
import std / [os, packedsets]
import os, std/packedsets

proc storeAliveSymsImpl(asymFile: AbsoluteFile; s: seq[int32]) =
var f = rodfiles.create(asymFile.string)
Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/dce.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Dead code elimination (=DCE) for IC.

import std / [intsets, tables]
import intsets, tables
import ".." / [ast, options, lineinfos, types]

import packed_ast, ic, bitabs
Expand Down
6 changes: 3 additions & 3 deletions compiler/ic/ic.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# distribution, for details about the copyright.
#

import std / [hashes, tables, intsets, sha1]
import hashes, tables, intsets, std/sha1
import packed_ast, bitabs, rodfiles
import ".." / [ast, idents, lineinfos, msgs, ropes, options,
pathutils, condsyms]
#import ".." / [renderer, astalgo]
from std / os import removeFile, isAbsolute
from os import removeFile, isAbsolute

type
PackedConfig* = object
Expand Down Expand Up @@ -143,7 +143,7 @@ const
debugConfigDiff = defined(debugConfigDiff)

when debugConfigDiff:
import std / [hashes, tables, intsets, sha1, strutils, sets]
import hashes, tables, intsets, sha1, strutils, sets

proc configIdentical(m: PackedModule; config: ConfigRef): bool =
result = m.definedSymbols == definedSymbolsAsString(config)
Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/integrity.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Integrity checking for a set of .rod files.
## The set must cover a complete Nim project.

import std / sets
import sets
import ".." / [ast, modulegraphs]
import packed_ast, bitabs, ic

Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/navigator.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## IDE-like features. It uses the set of .rod files to accomplish
## its task. The set must cover a complete Nim project.

import std / sets
import sets

from os import nil
from std/private/miscdollars import toLocation
Expand Down
2 changes: 1 addition & 1 deletion compiler/ic/packed_ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## use this representation directly in all the transformations,
## it is superior.

import std / [hashes, tables, strtabs]
import hashes, tables, strtabs
import bitabs
import ".." / [ast, options]

Expand Down
4 changes: 2 additions & 2 deletions compiler/int128.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## hold all from `low(BiggestInt)` to `high(BiggestUInt)`, This
## type is for that purpose.

from std/math import trunc
from math import trunc

type
Int128* = object
Expand Down Expand Up @@ -378,7 +378,7 @@ proc `*`*(lhs, rhs: Int128): Int128 =
proc `*=`*(a: var Int128, b: Int128) =
a = a * b

import std/bitops
import bitops

proc fastLog2*(a: Int128): int =
if a.udata[3] != 0:
Expand Down
2 changes: 1 addition & 1 deletion compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import
cgmeth, lowerings, sighashes, modulegraphs, lineinfos, rodutils,
transf, injectdestructors, sourcemap

import std/[json, sets, math, tables, intsets, strutils]
import json, sets, math, tables, intsets, strutils

from modulegraphs import ModuleGraph, PPassContext

Expand Down
2 changes: 1 addition & 1 deletion compiler/lookups.nim
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ when false:
of 'a'..'z': result = getIdent(c.cache, toLowerAscii(x.s[0]) & x.s.substr(1))
else: result = x

import std/[editdistance, heapqueue]
import std/editdistance, heapqueue

type SpellCandidate = object
dist: int
Expand Down
2 changes: 1 addition & 1 deletion compiler/modulegraphs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## represents a complete Nim project. Single modules can either be kept in RAM
## or stored in a rod-file.

import std / [intsets, tables, hashes, md5]
import intsets, tables, hashes, md5
import ast, astalgo, options, lineinfos,idents, btrees, ropes, msgs, pathutils
import ic / [packed_ast, ic]

Expand Down
2 changes: 1 addition & 1 deletion compiler/nilcheck.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#

import ast, renderer, intsets, tables, msgs, options, lineinfos, strformat, idents, treetab, hashes
import sequtils, strutils, std / sets
import sequtils, strutils, sets

# IMPORTANT: notes not up to date, i'll update this comment again
#
Expand Down
2 changes: 1 addition & 1 deletion compiler/nim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import
idents, lineinfos, cmdlinehelper,
pathutils, modulegraphs

from std/browsers import openDefaultBrowser
from browsers import openDefaultBrowser
from nodejs import findNodeJs

when hasTinyCBackend:
Expand Down
2 changes: 1 addition & 1 deletion compiler/nimpaths.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interpolation variables:
Unstable API
]##

import std/[os,strutils]
import os, strutils

const
docCss* = "$nimr/doc/nimdoc.css"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rodutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#

## Serialization utilities for the compiler.
import std/[strutils, math]
import strutils, math

# bcc on windows doesn't have C99 functions
when defined(windows) and defined(bcc):
Expand Down
2 changes: 1 addition & 1 deletion compiler/semdata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## This module contains the data structures for the semantic checking phase.

import std / tables
import tables

import
intsets, options, ast, astalgo, msgs, idents, renderer,
Expand Down
2 changes: 1 addition & 1 deletion compiler/semtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# this module does the semantic checking of type declarations
# included from sem.nim

import std/math
import math

const
errStringOrIdentNodeExpected = "string or ident node expected"
Expand Down
2 changes: 1 addition & 1 deletion compiler/vmdef.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## This module contains the type definitions for the new evaluation engine.
## An instruction is 1-3 int32s in memory, it is a register based VM.

import std / tables
import tables

import ast, idents, options, modulegraphs, lineinfos

Expand Down
2 changes: 1 addition & 1 deletion compiler/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# solves the opcLdConst vs opcAsgnConst issue. Of course whether we need
# this copy depends on the involved types.

import std / tables
import tables

import
strutils, ast, types, msgs, renderer, vmdef,
Expand Down
16 changes: 8 additions & 8 deletions compiler/vmops.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@

# Unfortunately this cannot be a module yet:
#import vmdeps, vm
from std/math import sqrt, ln, log10, log2, exp, round, arccos, arcsin,
from math import sqrt, ln, log10, log2, exp, round, arccos, arcsin,
arctan, arctan2, cos, cosh, hypot, sinh, sin, tan, tanh, pow, trunc,
floor, ceil, `mod`, cbrt, arcsinh, arccosh, arctanh, erf, erfc, gamma,
lgamma

when declared(math.copySign):
from std/math import copySign
from math import copySign

when declared(math.signbit):
from std/math import signbit
from math import signbit

from std/os import getEnv, existsEnv, dirExists, fileExists, putEnv, walkDir,
from os import getEnv, existsEnv, dirExists, fileExists, putEnv, walkDir,
getAppFilename, raiseOSError, osLastError

from std/md5 import getMD5
from std/times import cpuTime
from std/hashes import hash
from std/osproc import nil
from md5 import getMD5
from times import cpuTime
from hashes import hash
from osproc import nil

from sighashes import symBodyDigest

Expand Down
Loading

0 comments on commit e89b6a0

Please sign in to comment.