Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit 31ee188

Browse files
committed
[packages,C] Fixes #257. If a shared object symlink is missing, an incremental build will regenerate it.
1 parent 2fd93f2 commit 31ee188

File tree

4 files changed

+85
-1
lines changed

4 files changed

+85
-1
lines changed

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
26-Jul-2016 Fixes #257. If a shared object symlink is missing, an incremental build will regenerate it.
2+
13
12-Jul-2016 ======== Version 1.0.3 beta 3 Release ========
24

35
12-Jul-2016 Fixes #260. C module classes that depend on object files (e.g. object file collections, static libraries, applications/dynamic libraries) now also check whether any of the object files do not exist, as well as are newer. In Native builds, this ensures that the module that already exists, is re-executed, when a new source file is added to it.

packages/C/bam/Scripts/ConsoleApplication.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ protected override void
368368
this.Policy = Bam.Core.ExecutionPolicyUtilities<ILinkingPolicy>.Create(className);
369369
}
370370

371-
public sealed override void
371+
public override void
372372
Evaluate()
373373
{
374374
this.ReasonToExecute = null;

packages/C/bam/Scripts/CxxDynamicLibrary.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,47 @@ protected sealed override void
274274
}
275275
}
276276

277+
#if __MonoCS__
278+
public sealed override void
279+
Evaluate()
280+
{
281+
base.Evaluate();
282+
if (null != this.ReasonToExecute)
283+
{
284+
// a reason has been found already
285+
return;
286+
}
287+
if (this.IsPrebuilt)
288+
{
289+
return;
290+
}
291+
if (!this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Linux))
292+
{
293+
// symlinks only on Linux
294+
return;
295+
}
296+
if (this is Plugin)
297+
{
298+
// plugins don't have symlinks
299+
return;
300+
}
301+
var fullSONamePath = this.CreateTokenizedString("@dir($(0))/$(1)", this.GeneratedPaths[Key], this.Macros["SOName"]);
302+
var soName = new Mono.Unix.UnixSymbolicLinkInfo(fullSONamePath.Parse());
303+
if (!soName.Exists)
304+
{
305+
this.ReasonToExecute = Bam.Core.ExecuteReasoning.FileDoesNotExist(fullSONamePath);
306+
return;
307+
}
308+
var fullLinkerNamePath = this.CreateTokenizedString("@dir($(0))/$(1)", this.GeneratedPaths[Key], this.Macros["LinkerName"]);
309+
var linkerName = new Mono.Unix.UnixSymbolicLinkInfo(fullLinkerNamePath.Parse());
310+
if (!linkerName.Exists)
311+
{
312+
this.ReasonToExecute = Bam.Core.ExecuteReasoning.FileDoesNotExist(fullLinkerNamePath);
313+
return;
314+
}
315+
}
316+
#endif
317+
277318
System.Collections.ObjectModel.ReadOnlyCollection<Bam.Core.Module> IForwardedLibraries.ForwardedLibraries
278319
{
279320
get

packages/C/bam/Scripts/DynamicLibrary.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,47 @@ protected sealed override void
251251
}
252252
}
253253

254+
#if __MonoCS__
255+
public sealed override void
256+
Evaluate()
257+
{
258+
base.Evaluate();
259+
if (null != this.ReasonToExecute)
260+
{
261+
// a reason has been found already
262+
return;
263+
}
264+
if (this.IsPrebuilt)
265+
{
266+
return;
267+
}
268+
if (!this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Linux))
269+
{
270+
// symlinks only on Linux
271+
return;
272+
}
273+
if (this is Plugin)
274+
{
275+
// plugins don't have symlinks
276+
return;
277+
}
278+
var fullSONamePath = this.CreateTokenizedString("@dir($(0))/$(1)", this.GeneratedPaths[Key], this.Macros["SOName"]);
279+
var soName = new Mono.Unix.UnixSymbolicLinkInfo(fullSONamePath.Parse());
280+
if (!soName.Exists)
281+
{
282+
this.ReasonToExecute = Bam.Core.ExecuteReasoning.FileDoesNotExist(fullSONamePath);
283+
return;
284+
}
285+
var fullLinkerNamePath = this.CreateTokenizedString("@dir($(0))/$(1)", this.GeneratedPaths[Key], this.Macros["LinkerName"]);
286+
var linkerName = new Mono.Unix.UnixSymbolicLinkInfo(fullLinkerNamePath.Parse());
287+
if (!linkerName.Exists)
288+
{
289+
this.ReasonToExecute = Bam.Core.ExecuteReasoning.FileDoesNotExist(fullLinkerNamePath);
290+
return;
291+
}
292+
}
293+
#endif
294+
254295
System.Collections.ObjectModel.ReadOnlyCollection<Bam.Core.Module> IForwardedLibraries.ForwardedLibraries
255296
{
256297
get

0 commit comments

Comments
 (0)