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

error compiling nimble #1248

Open
dapiam opened this issue Jul 24, 2024 · 15 comments
Open

error compiling nimble #1248

dapiam opened this issue Jul 24, 2024 · 15 comments

Comments

@dapiam
Copy link

dapiam commented Jul 24, 2024

Hello,

I am trying to compile nimble on arm64 and I am getting the following error.

(base) root@2894f0eebfa3:/apps# git clone https://github.com/nim-lang/nimble.git && cd nimble/src
Cloning into 'nimble'...
remote: Enumerating objects: 7221, done.
remote: Counting objects: 100% (1870/1870), done.
remote: Compressing objects: 100% (500/500), done.
remote: Total 7221 (delta 1505), reused 1625 (delta 1344), pack-reused 5351
Receiving objects: 100% (7221/7221), 3.30 MiB | 28.18 MiB/s, done.
Resolving deltas: 100% (4678/4678), done.

(base) root@2894f0eebfa3:/apps/nimble/src# nim compile nimble
Hint: used config file '/apps/nim-1.4.6/config/nim.cfg' [Conf]
Hint: used config file '/apps/nim-1.4.6/config/config.nims' [Conf]
Hint: used config file '/apps/nimble/config.nims' [Conf]
Hint: used config file 'nimble.nim.cfg' [Conf]
....................................
/apps/nimble/src/nimble.nim(14, 13) Error: cannot open file: sat/sat

I am following this post to be able to use mosdepth on arm64
brentp/mosdepth#144 (comment)

thank you

@nealie
Copy link

nealie commented Jul 24, 2024

This is also happening on FreeBSD/amd64. No sign of sat.nim anywhere.

@jmgomez
Copy link
Collaborator

jmgomez commented Jul 24, 2024

You need to compile it with nimNimbleBootstrap
nim c -d:nimNimbleBootstrap -d:release src/nimble.nim but make sure you have the deps in dist/sat/src/sat/sat

See how nim does it https://github.com/nim-lang/Nim/blob/925dc5c1319bce935593cc12380feec1538e2ce5/koch.nim#L157

@nealie
Copy link

nealie commented Jul 24, 2024

Error: cannot open file: /dist/sat/src/sat/sat

I am packaging nimble for FreeBSD ports and so I build it in isolation, not as part of the nim install. This has always worked in the past. Nevertheless, the sat.nim file does not exist in the nim 2.0.8 release.

@dapiam
Copy link
Author

dapiam commented Jul 24, 2024

same error

(base) root@2894f0eebfa3:/apps/nimble# nim c -d:nimNimbleBootstrap -d:release src/nimble.nim
Hint: used config file '/apps/nim-1.4.6/config/nim.cfg' [Conf]
Hint: used config file '/apps/nim-1.4.6/config/config.nims' [Conf]
Hint: used config file '/apps/nimble/config.nims' [Conf]
Hint: used config file '/apps/nimble/src/nimble.nim.cfg' [Conf]
....................................
/apps/nimble/src/nimble.nim(12, 29) Error: cannot open file: ../dist/sat/src/sat/sat

@dapiam
Copy link
Author

dapiam commented Jul 24, 2024

and if I try to compile sat

(base) root@2894f0eebfa3:/apps/sat# nim c src/sat/sat
Hint: used config file '/apps/nim-1.4.6/config/nim.cfg' [Conf]
Hint: used config file '/apps/nim-1.4.6/config/config.nims' [Conf]
......
/apps/sat/src/sat/sat.nim(213, 10) Error: selector must be of an ordinal type, float or string

@jmgomez
Copy link
Collaborator

jmgomez commented Jul 24, 2024

Error: cannot open file: /dist/sat/src/sat/sat

I am packaging nimble for FreeBSD ports and so I build it in isolation, not as part of the nim install. This has always worked in the past. Nevertheless, the sat.nim file does not exist in the nim 2.0.8 release.

Please read my previous reply

@dapiam
I dont think you can compile sat with nim 1.4.6 you need a newer version of nim

@nealie
Copy link

nealie commented Jul 24, 2024

I read your previous reply and tried the nimNimbleBootstrap flag, but there is still no sat.nim file anywhere. Nim 2.0.8 is already installed, but it looks like I'm going to have to drag the nim source in as well to get it, which is a pain.

@jmgomez
Copy link
Collaborator

jmgomez commented Jul 24, 2024

@nealie if you look at the code there you will see how koch downloads the sat repo from there in order to bootstrap nimble. You dont need the nim sources, you just need the sat one. Follow what the code does

@nealie
Copy link

nealie commented Jul 24, 2024

Now you got me worried that I missed yet another one of the git downloads by koch. I've had to strip them all out as they're fundamentally incompatible with the FreeBSD ports system. I'm going to have to go back to the nim port and check that it's not independently downloading stuff. I will then try and add sat into the nimble port, but using the proper ports mechanisms.

Ah well, there goes an easy port update.

@jmgomez
Copy link
Collaborator

jmgomez commented Jul 24, 2024

Cant you just do build_all.sh? It will build nimble for you anyways. Wait for this to be merged https://github.com/nim-lang/Nim/pull/23883 if you want this exact same version

@nealie
Copy link

nealie commented Jul 24, 2024

Nope. It pulls in random bits of git without checksumming the code, so it could be anything. Within the FreeBSD ports system, only the infrastructure is allowed to download anything, as it does all the checking needed to ensure a safe and correct build.

@dapiam
Copy link
Author

dapiam commented Jul 24, 2024

with nim 2.0.8

(base) root@9059dc4438d3:/apps/nim-2.0.8# nim -v
Nim Compiler Version 2.0.8 [Linux: arm64]
Compiled at 2024-07-24
Copyright (c) 2006-2023 by Andreas Rumpf

active boot switches: -d:release
(base) root@9059dc4438d3:/apps/# git clone https://github.com/nim-lang/nimble.git
Cloning into 'nimble'...
remote: Enumerating objects: 7221, done.
remote: Counting objects: 100% (1731/1731), done.
remote: Compressing objects: 100% (495/495), done.
remote: Total 7221 (delta 1369), reused 1492 (delta 1210), pack-reused 5490
Receiving objects: 100% (7221/7221), 3.33 MiB | 30.44 MiB/s, done.
Resolving deltas: 100% (4670/4670), done.

(base) root@9059dc4438d3:/apps# cd nimble/
(base) root@9059dc4438d3:/apps/nimble# nim c -d:nimNimbleBootstrap -d:release src/nimble.nim
Hint: used config file '/apps/nim-2.0.8/config/nim.cfg' [Conf]
Hint: used config file '/apps/nim-2.0.8/config/config.nims' [Conf]
Hint: used config file '/apps/nimble/config.nims' [Conf]
Hint: used config file '/apps/nimble/src/nimble.nim.cfg' [Conf]
.............................................................................................................................................
/apps/nimble/src/nimble.nim(12, 29) Error: cannot open file: ../dist/sat/src/sat/sat

@Araq
Copy link
Member

Araq commented Jul 24, 2024

Nope. It pulls in random bits of git without checksumming the code, so it could be anything.

That's not how "git checkout faf1617f44d7632ee9601ebc13887644925dcc01" works...

@nealie
Copy link

nealie commented Jul 25, 2024

I see that unless nimNimbleBootstrap is defined, nimble.nim tries to import sat/sat. Does this mean that it should have been installed by nim's koch already? It doesn't seem to be documented anywhere in the system library documentation.

I realise that in the general koch build process, it will fetch sat and nimble and build them together after it's build nim, but just humour me that this is not the way it's done with my ports on FreeBSD, so I have to be able to build nimble standalone with just nim pre-installed, along with all of the standard libraries.

@Araq
Copy link
Member

Araq commented Jul 25, 2024

I don't know. Nimble is shipped with Nim and the releases are tied together. You're not supposed to build Nimble yourself. Use koch nimble --latest to get the latest Nimble.

In other words, if your package manager offers "nimble" as a separate entry from "nim", it's broken already, IMO.

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

No branches or pull requests

4 participants