Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

How to compile "mos" ?

I try to compile "mos" on my Ubuntu 16.04, but i get the following go errors:

dobin@minime:~/exploiting/mongoose-os/mos$ make
can't load package: package cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata: cannot find package "cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata" in any of:
    /usr/lib/go-1.6/src/cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata (from $GOROOT)
    /home/dobin/Development/go/src/cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata (from $GOPATH)
    /home/dobin/exploiting/mongoose-os/mos/src/cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata
    /home/dobin/exploiting/mongoose-os/src/cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata
Makefile:6: recipe for target 'generate' failed
make: *** [generate] Error 1
dobin@minime:~/exploiting/mongoose-os/mos$ go get
package cesanta.com/common/go/lptr: unrecognized import path "cesanta.com/common/go/lptr" (parse https://cesanta.com/common/go/lptr?go-get=1: no go-import meta tags)
package cesanta.com/common/go/mgrpc/frame: unrecognized import path "cesanta.com/common/go/mgrpc/frame" (parse https://cesanta.com/common/go/mgrpc/frame?go-get=1: no go-import meta tags)
package cesanta.com/common/go/multierror: unrecognized import path "cesanta.com/common/go/multierror" (parse https://cesanta.com/common/go/multierror?go-get=1: no go-import meta tags)
package cesanta.com/common/go/ourjson: unrecognized import path "cesanta.com/common/go/ourjson" (parse https://cesanta.com/common/go/ourjson?go-get=1: no go-import meta tags)
package cesanta.com/common/go/pflagenv: unrecognized import path "cesanta.com/common/go/pflagenv" (parse https://cesanta.com/common/go/pflagenv?go-get=1: no go-import meta tags)
package cesanta.com/fw/defs/atca: unrecognized import path "cesanta.com/fw/defs/atca" (parse https://cesanta.com/fw/defs/atca?go-get=1: no go-import meta tags)
package cesanta.com/fw/defs/config: unrecognized import path "cesanta.com/fw/defs/config" (parse https://cesanta.com/fw/defs/config?go-get=1: no go-import meta tags)
package cesanta.com/fw/defs/fs: unrecognized import path "cesanta.com/fw/defs/fs" (parse https://cesanta.com/fw/defs/fs?go-get=1: no go-import meta tags)
package cesanta.com/fw/defs/sys: unrecognized import path "cesanta.com/fw/defs/sys" (parse https://cesanta.com/fw/defs/sys?go-get=1: no go-import meta tags)
package cesanta.com/mos/atca: unrecognized import path "cesanta.com/mos/atca" (parse https://cesanta.com/mos/atca?go-get=1: no go-import meta tags)
package cesanta.com/mos/build: unrecognized import path "cesanta.com/mos/build" (parse https://cesanta.com/mos/build?go-get=1: no go-import meta tags)
package cesanta.com/mos/build/archive: unrecognized import path "cesanta.com/mos/build/archive" (parse https://cesanta.com/mos/build/archive?go-get=1: no go-import meta tags)
package cesanta.com/mos/dev: unrecognized import path "cesanta.com/mos/dev" (parse https://cesanta.com/mos/dev?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/cc3200: unrecognized import path "cesanta.com/mos/flash/cc3200" (parse https://cesanta.com/mos/flash/cc3200?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/common: unrecognized import path "cesanta.com/mos/flash/common" (parse https://cesanta.com/mos/flash/common?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/esp: unrecognized import path "cesanta.com/mos/flash/esp" (parse https://cesanta.com/mos/flash/esp?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/esp/flasher: unrecognized import path "cesanta.com/mos/flash/esp/flasher" (parse https://cesanta.com/mos/flash/esp/flasher?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/esp/rom_client: unrecognized import path "cesanta.com/mos/flash/esp/rom_client" (parse https://cesanta.com/mos/flash/esp/rom_client?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/esp32: unrecognized import path "cesanta.com/mos/flash/esp32" (parse https://cesanta.com/mos/flash/esp32?go-get=1: no go-import meta tags)
package cesanta.com/mos/flash/stm32: unrecognized import path "cesanta.com/mos/flash/stm32" (parse https://cesanta.com/mos/flash/stm32?go-get=1: no go-import meta tags)
package cesanta.com/mos/timestamp: unrecognized import path "cesanta.com/mos/timestamp" (parse https://cesanta.com/mos/timestamp?go-get=1: no go-import meta tags)
package context: unrecognized import path "context" (import path does not begin with hostname)

The URLs are 404'ing. How to I get the required packages, and get it to compile?

Comments

  • rojerrojer Dublin, Ireland

    you need to name the directory in a specific way - mos repository should be under your GOPATH/src/cesanta.com so that the root of the repository resolves to cesanta.com import path.

  • rojerrojer Dublin, Ireland

    package context: unrecognized import path "context" (import path does not begin with hostname)
    you will also need a more recent version of Go (context became part of the standard library in 1.7)

  • edited March 2017

    Thanks for the quick reply. I installed go 1.8, and moved the following directories to $GOPATH/src/cesanta.com:
    - common
    - fw
    - mos

    I also installed the ubuntu "libftdi-dev" package to get rid of the "flash/cc3200/ftdi_linux.go:8:18: fatal error: ftdi.h: No such file or directory" error.

    Now i get the error "Undefined Version":

    dobin@minime:~/Development/go/src/cesanta.com/mos$ make
    can't load package: package cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata: cannot find package "cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata" in any of:
        /usr/local/go/src/cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata (from $GOROOT)
        /home/dobin/Development/go/src/cesanta.com/vendor/github.com/jteeuwen/go-bindata/go-bindata (from $GOPATH)
    Makefile:6: recipe for target 'generate' failed
    make: *** [generate] Error 1
    
    
    dobin@minime:~/Development/go/src/cesanta.com/mos$ go get
    # cesanta.com/mos
    ./main.go:184: undefined: Version
    ./main.go:184: undefined: BuildId
    ./ui.go:273: undefined: BuildId
    
    
    dobin@minime:~/Development/go/src/cesanta.com/mos$ go version
    go version go1.8 linux/amd64
    
    
    dobin@minime:~/Development/go/src/cesanta.com/mos$ go build
    # cesanta.com/mos
    ./main.go:184: undefined: Version
    ./main.go:184: undefined: BuildId
    ./ui.go:273: undefined: BuildId
    

    (sorry, i lost format in this post)

  • rojerrojer Dublin, Ireland

    version and build id are defined in version.go, which is generated. run go generate in the mos directory.

  • rojerrojer Dublin, Ireland
    edited March 2017

    in case the python script doesn't work for you, it should look something like this:

    [rojer@nba ~/go/src/cesanta.com/mos master]$ cat version.go 
    /* Auto-generated, do not edit. */
    package main
    
    const (
            Version = "2017032807"
            BuildId = "20170328-075242/master@e24f1137"
            BuildTimestamp = "2017-03-28T07:52:42Z"
    )
    
  • Thanks a lot, i'm able to compile mos now. Consider my issue closed.

    Maybe it would be nice to create a README.md in mos/ directory, explaining the requirements and the setup process for the compilation.

  • rojerrojer Dublin, Ireland

    cool, glad it worked!

  • unixbigotunixbigot Brisbane, Australia

    As a fellow mos noob, I would like to say that I don't think this issue is resolved.

    There's absolutely no info in the repo on how to build the mos tool (eg for a non-x86 arch), or begin contributing.

    I have successfully built and used mos on ARM, by puzzling out the tools needed (I've been coding in go for about half a year, but haven't assimilated the full toolset yet).

    I'm prepared to submit doco, and would like someone to fact-check my build-from-scratch process.
    I suspect there must be an easier way to do it.

    I puzzled this out on a desktop system, and then formulated it as a dockerfile to ensure I captured every dependency.

    Does this look correct?

    FROM golang
    RUN apt update && apt install -y apt-utils && apt install -y libftdi-dev python-git && apt-get clean && rm -rf /var/lib/apt/lists/*
    RUN go get -v github.com/kardianos/govendor
    RUN git clone https://github.com/cesanta/mongoose-os.git /go/src/cesanta.com
    WORKDIR /go/src/cesanta.com/mos
    RUN go get -d -v
    RUN govendor fetch github.com/jteeuwen/go-bindata/go-bindata
    RUN govendor fetch github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs
    RUN make install
    EXPOSE 1992
    CMD ["/go/bin/mos"]
    

    Thanks in advance for any corrections. --Chris

  • rojerrojer Dublin, Ireland

    mos build process is a bit rough around the edges and is lacking in the proper open-source process around it.
    thanks for contributing the Dockerfile, i was also thinking about setting up a docker-based build process. however, there's perennial shortage of time around things like this. current build process works well enough for us to release and push binaries, there's just constant ENOTIME to apply the necessary polish.
    bear with us, we'll get there :)

  • unixbigotunixbigot Brisbane, Australia

    Cheers @rojer, I've done a bit more work on the dockerfile, and submitted PR #222.

    @rojer said:
    mos build process is a bit rough around the edges and is lacking in the proper open-source process around it.
    thanks for contributing the Dockerfile, i was also thinking about setting up a docker-based build process. however, there's perennial shortage of time around things like this. current build process works well enough for us to release and push binaries, there's just constant ENOTIME to apply the necessary polish.
    bear with us, we'll get there :)

  • keivankeivan Germany

    Hi,

    I want to compile mos-tool in linux kali, but I get the following error:

    make: Entering directory '/home/pi/go/src/cesanta.com/mos'
    main.go:1: running "go-bindata-assetfs": exec: "go-bindata-assetfs": executable file not found in $PATH
    flash/cc3220/flasher.go:6: running "go-bindata": exec: "go-bindata": executable file not found in $PATH
    Makefile:8: recipe for target 'generate' failed
    make: *** [generate] Error 1
    make: Leaving directory '/home/pi/go/src/cesanta.com/mos'

    I don't know what is the problem actually. I've done every thing mentioned in: https://github.com/cesanta/mos-tool.
    Thanks in advance.
    Keivan

  • SergeySergey Dublin, Ireland
  • When you run setup.sh with --compile-dpdk argument, the script first compiles Intel DPDK library, and then builds the mOS networking stack.

    $ cd mos_release_0.3/
    $ ./setup.sh --compile-dpdk
    Once DPDK toolkit is successfully compiled, the script prints out the following message and prompts the user to comple the core stack.

    Build complete [x86_64-native-linuxapp-gcc]
    ================== Installing ./
    Installation in ./ complete

    Done with DPDK setup. Press enter to start MOS setup ...
    https://besanttechnologies.com/training-courses/data-warehousing-training/hadoop-training-institute-in-chennai

Sign In or Register to comment.