@@ -44,7 +44,6 @@ import (
44
44
"github.com/mongoose-os/mos/cli/build"
45
45
moscommon "github.com/mongoose-os/mos/cli/common"
46
46
"github.com/mongoose-os/mos/cli/interpreter"
47
- "github.com/mongoose-os/mos/cli/mosgit"
48
47
"github.com/mongoose-os/mos/cli/ourutil"
49
48
"github.com/mongoose-os/mos/version"
50
49
)
@@ -96,8 +95,6 @@ type ComponentProvider interface {
96
95
GetModuleLocalPath (
97
96
m * build.SWModule , rootAppDir , modulesDefVersion , platform string ,
98
97
) (string , error )
99
-
100
- GetMongooseOSLocalPath (rootAppDir , mongooseOSVersion string ) (string , error )
101
98
}
102
99
103
100
type ReadManifestCallbacks struct {
@@ -177,6 +174,12 @@ func ReadManifestFinal(
177
174
return nil , nil , errors .Annotatef (err , "while expanding description" )
178
175
}
179
176
177
+ manifest .Modules = append (manifest .Modules , build.SWModule {
178
+ Name : build .MosModuleName ,
179
+ Location : build .MosDefaultRepo ,
180
+ Version : manifest .MongooseOsVersion ,
181
+ })
182
+
180
183
// Prepare local copies of all sw modules {{{
181
184
// Modules are collected from the bottom of the dependency chain,
182
185
// we go backwards to ensure overrides are handled first.
@@ -194,28 +197,16 @@ func ReadManifestFinal(
194
197
195
198
moduleDir , err := cbs .ComponentProvider .GetModuleLocalPath (m , dir , manifest .ModulesVersion , manifest .Platform )
196
199
if err != nil {
197
- return nil , nil , errors .Trace (err )
200
+ return nil , nil , errors .Annotatef (err , "failed to prepare module %q" , name )
198
201
}
199
202
200
203
interpreter .SetModuleVars (interp .MVars , name , moduleDir )
201
204
modulesHandled [name ] = true
202
- }
203
- // }}}
204
205
205
- // Determine mongoose-os dir (fp.MosDirEffective) {{{
206
- fp .MosDirEffective , err = cbs .ComponentProvider .GetMongooseOSLocalPath (
207
- dir , manifest .MongooseOsVersion ,
208
- )
209
- if err != nil {
210
- return nil , nil , errors .Trace (err )
211
- }
212
-
213
- fp .MosDirEffective , err = filepath .Abs (fp .MosDirEffective )
214
- if err != nil {
215
- return nil , nil , errors .Annotatef (err , "getting absolute path of %q" , fp .MosDirEffective )
206
+ if name == build .MosModuleName {
207
+ fp .MosDirEffective = moduleDir
208
+ }
216
209
}
217
-
218
- interpreter .SetModuleVars (interp .MVars , "mongoose-os" , fp .MosDirEffective )
219
210
// }}}
220
211
221
212
// Get sources and filesystem files from the manifest, expanding expressions {{{
@@ -280,9 +271,6 @@ func ReadManifestFinal(
280
271
}
281
272
// }}}
282
273
283
- gitinst := mosgit .NewOurGit (nil )
284
- mosHash , _ := gitinst .GetCurrentHash (fp .MosDirEffective )
285
-
286
274
// Convert manifest.Sources into paths to concrete existing source files.
287
275
manifest .Sources , fp .AppSourceDirs , err = resolvePaths (manifest .Sources , * sourceGlobs )
288
276
if err != nil {
@@ -416,7 +404,7 @@ func ReadManifestFinal(
416
404
417
405
// Generate deps_init C code, and if it's not empty, write it to the temp
418
406
// file and add to sources
419
- depsCCode , err := getDepsInitCCode (manifest , mosHash )
407
+ depsCCode , err := getDepsInitCCode (manifest )
420
408
if err != nil {
421
409
return nil , nil , errors .Trace (err )
422
410
}
@@ -1677,7 +1665,7 @@ func quoteOrNULL(s string) string {
1677
1665
return fmt .Sprintf ("%q" , s )
1678
1666
}
1679
1667
1680
- func getDepsInitCCode (manifest * build.FWAppManifest , mosHash string ) ([]byte , error ) {
1668
+ func getDepsInitCCode (manifest * build.FWAppManifest ) ([]byte , error ) {
1681
1669
if len (manifest .LibsHandled ) == 0 {
1682
1670
return nil , nil
1683
1671
}
@@ -1715,12 +1703,6 @@ func getDepsInitCCode(manifest *build.FWAppManifest, mosHash string) ([]byte, er
1715
1703
})
1716
1704
}
1717
1705
1718
- tplData .Modules = []moduleInfo {
1719
- moduleInfo {
1720
- Name : quoteOrNULL ("mongoose-os" ),
1721
- RepoVersion : quoteOrNULL (mosHash ),
1722
- },
1723
- }
1724
1706
for _ , m := range manifest .Modules {
1725
1707
mv := ""
1726
1708
if lmv , err := m .GetLocalVersion (); err == nil {
0 commit comments