Comments (6)
I just updated the description to point out to the tutorial page I was referring to. It should be https://nix.dev/tutorials/nixos/building-and-running-docker-images.
I'm on mac, and the tutorial suggests to cross compile to linux:
Here is a screenshot of the error when executing the code from the tutorial
Full error is:
these 6 derivations will be built:
/nix/store/26bcr8wfcx4lv09rjb9ivl1y420cfqm8-jshon-20170302.drv
/nix/store/8nr28caac7chz1c31grj7czn59cw90z3-hello-x86_64-unknown-linux-musl-2.12.1.drv
/nix/store/cfarcfgic55nf1g2ahaf0x2fmvys371a-hello-docker-config.json.drv
/nix/store/86yi7zkjpcxp2syr17c64r6w6r9cczfb-docker-layer-hello-docker.drv
/nix/store/x6mhgpvqgj8kp97la682yjx0b46p3rd1-runtime-deps.drv
/nix/store/nlvyp9f3gbhavi0qqdnby8h9carxifsf-docker-image-hello-docker.tar.gz.drv
these 2 paths will be fetched (0.02 MiB download, 0.11 MiB unpacked):
/nix/store/5pnq935mmp8b13sbnq99yvqvvv54j4gr-stdenv-darwin
/nix/store/j5hdavfzx22avjg2d9zjk1c6ydscxcsa-x86_64-unknown-linux-musl-gcc-wrapper-12.3.0
warning: Ignoring setting 'auto-allocate-uids' because experimental feature 'auto-allocate-uids' is not enabled
warning: Ignoring setting 'impure-env' because experimental feature 'configurable-impure-env' is not enabled
building '/nix/store/26bcr8wfcx4lv09rjb9ivl1y420cfqm8-jshon-20170302.drv'...
copying path '/nix/store/j5hdavfzx22avjg2d9zjk1c6ydscxcsa-x86_64-unknown-linux-musl-gcc-wrapper-12.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/5pnq935mmp8b13sbnq99yvqvvv54j4gr-stdenv-darwin' from 'https://cache.nixos.org'...
unpacking sources
unpacking source archive /nix/store/6qrdq6xjpycpwjj39xxww6gzg9biqifl-source
source root is source
patching sources
applying patch /nix/store/65ychbjyrl6md08s2zskzfn7cgwl4bnn-96b4e9dbf578be7b31f29740b608aa7b34df3318.patch
patching file jshon.c
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/0ly5lpwanagc5qpmnqrw8aqxb4ivw7kf-bash-5.2-p15/bin/bash
clang -std=c99 -Wall -pedantic -Wextra -Werror -c -o jshon.o jshon.c
jshon.c:189:25: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
json_t** stack_safe_peek()
^
void
jshon.c:222:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
mapping* map_safe_peek()
^
void
jshon.c:229:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void MAPPUSH()
^
void
jshon.c:251:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void MAPNEXT()
^
void
jshon.c:276:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void MAPPOP()
^
void
jshon.c:846:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void debug_map()
^
void
6 errors generated.
make: *** [<builtin>: jshon.o] Error 1
error: builder for '/nix/store/26bcr8wfcx4lv09rjb9ivl1y420cfqm8-jshon-20170302.drv' failed with exit code 2;
last 10 log lines:
> jshon.c:276:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> void MAPPOP()
> ^
> void
> jshon.c:846:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> void debug_map()
> ^
> void
> 6 errors generated.
> make: *** [<builtin>: jshon.o] Error 1
For full logs, run 'nix-store -l /nix/store/26bcr8wfcx4lv09rjb9ivl1y420cfqm8-jshon-20170302.drv'.
error: 1 dependencies of derivation '/nix/store/nlvyp9f3gbhavi0qqdnby8h9carxifsf-docker-image-hello-docker.tar.gz.drv' failed to build
from nix.dev.
Thanks for reporting. There is a highlight box saying
macOS/Darwin is a special case, as not the whole OS is open-source. It’s only possible to cross compile between aarch64-darwin and x86_64-darwin. aarch64-darwin support was recently added, so cross compilation is barely tested.
We should probably point that out more clearly.
The whole point of cross compilation (and much of Nix) is exactly that one doesn't need virtual machines, but that recent macOS work in fact allows using VMs transparently. @olafklingt I can imagine we could provide simple VM instructions for macOS, most of that is already in place, right?
from nix.dev.
@fricklerhandwerk sorry I can't even find that part in the tutorial. Can you please screenshot it / point it out with a link?
from nix.dev.
@salamehsameera which architecture are you on? you can find the mentioned comment here Can you describe in detail what is not working? I am not on mac-os so i don't know the pitfalls yet.
from nix.dev.
@salamehsameera oh sorry, I made a mistake and looked at the linked article, as @olafklingt noted: https://nix.dev/tutorials/cross-compilation What I wanted to say is that the instruction to do cross compilation may not actually work, as the note on that other page suggests. Both pages were not actively maintained until you asked.
Please show what exactly you did (post the expressions you used and the commands you ran), otherwise we can't help figuring it out.
from nix.dev.
I tried something similar, except with my own cross-compiled binary, and got exactly the same error. MacOS Sonoma 14.5 on Apple M2 Pro.
from nix.dev.
Related Issues (20)
- Navigation doesn't keep track of your position in the hierarchy HOT 1
- Trying to fix reproducible paths section and it's not working out HOT 1
- Package versions do not match across tutorials HOT 1
- Git shell hook breaks if not a Git repo
- Overview of pinning techniques
- Guides and Recipes overview HOT 3
- Concepts overview
- Guide for writing guides
- Overview of common expression patterns HOT 2
- Sidebar Navigation Leads to Incorrect URL and Generic Anchor IDs in 'Working with Local Files'
- Linkcheck failing for raspberrypi domain
- Add a section to for a NixOS graphical configuration in the VM tutorial HOT 1
- CI stuck HOT 2
- Link does not go where expected HOT 2
- use an open service on /tutorials/module-system/module-system.html HOT 6
- Expand and Improve Module Article HOT 5
- Missing `rec-expression` anchor redirect and inquiry into redirect logic
- Issue on page /tutorials/first-steps/declarative-shell.html | Setting environment variables HOT 1
- Issue on page /tutorials/packaging-existing-software.html
- Documentation for nix.conf HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix.dev.