mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 19:51:00 +01:00
This commit is contained in:
parent
588356c30a
commit
c0dceea9f0
12 changed files with 95 additions and 64 deletions
|
|
@ -526,7 +526,15 @@ genericBuild <co xml:id='ex-hello-builder2-co-3' /></programlisting>
|
|||
<filename>bin</filename> subdirectory, it's added to
|
||||
<envar>PATH</envar>; if it has a <filename>include</filename>
|
||||
subdirectory, it's added to GCC's header search path; and so
|
||||
on.</para>
|
||||
on.<footnote><para>How does it work? <filename>setup</filename>
|
||||
tries to source the file
|
||||
<filename><replaceable>pkg</replaceable>/nix-support/setup-hook</filename>
|
||||
of all dependencies. These “setup hooks” can then set up whatever
|
||||
environment variables they want; for instance, the setup hook for
|
||||
Perl sets the <envar>PERL5LIB</envar> environment variable to
|
||||
contain the <filename>lib/site_perl</filename> directories of all
|
||||
inputs.</para></footnote>
|
||||
</para>
|
||||
|
||||
</callout>
|
||||
|
||||
|
|
@ -1217,9 +1225,9 @@ set, the attributes of which specify the inputs of the build.</para>
|
|||
They are simply concatenated, separated by
|
||||
spaces.</para></listitem>
|
||||
|
||||
<listitem><para><emphasis>true</emphasis> is passed as
|
||||
<emphasis>1</emphasis>, <emphasis>false</emphasis>
|
||||
and <emphasis>null</emphasis> are passed as empty string.
|
||||
<listitem><para><literal>true</literal> is passed as the string
|
||||
<literal>1</literal>, <literal>false</literal> and
|
||||
<literal>null</literal> are passed as an empty string.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
|
|
|
|||
16
install_install_d.sh
Executable file
16
install_install_d.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#! /bin/sh -e
|
||||
|
||||
if [ $(whoami) = "root" ]
|
||||
then
|
||||
|
||||
su - wouterdb -c "cd /home/wouterdb/dev/nix-state/; make"
|
||||
make install
|
||||
chown -R wouterdb.wouterdb /nixstate2/nix/
|
||||
|
||||
./restartDaemon.sh
|
||||
|
||||
else
|
||||
echo "You must be ROOT to run this script."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
25
mergeTrunkBackIn.sh
Executable file
25
mergeTrunkBackIn.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
svn merge -r 9476:9506 https://svn.cs.uu.nl:12443/repos/trace/nix/trunk
|
||||
|
||||
#already done:
|
||||
# 8628
|
||||
# 8632
|
||||
# 8634
|
||||
# 8636
|
||||
# 8655
|
||||
# 8691
|
||||
# 8698
|
||||
# 8711
|
||||
# 8864
|
||||
# 9063
|
||||
# 9105
|
||||
# 9207
|
||||
# 9217
|
||||
# 9332
|
||||
# 9429
|
||||
# 9433
|
||||
# 9435
|
||||
# 9437
|
||||
# 9439
|
||||
# 9445
|
||||
# 9476
|
||||
# 9506
|
||||
9
restartDaemon.sh
Executable file
9
restartDaemon.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#! /bin/sh
|
||||
|
||||
initctl stop nix-daemon
|
||||
killproc.sh nix-worker
|
||||
sleep 2
|
||||
|
||||
#/nixstate2/nix/bin/nix-worker --daemon > /dev/null 2>&1 &
|
||||
/nixstate2/nix/bin/nix-worker --daemon
|
||||
#gdb --args /nixstate2/nix/bin/nix-worker --daemon
|
||||
|
|
@ -19,8 +19,6 @@ chdir $tmpDir or die "cannot change to `$tmpDir': $!";
|
|||
my $tmpNar = "$tmpDir/nar";
|
||||
my $tmpNar2 = "$tmpDir/nar2";
|
||||
|
||||
END { unlink $tmpNar; unlink $tmpNar2; rmdir $tmpDir; }
|
||||
|
||||
|
||||
# Load all manifests.
|
||||
my %narFiles;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ $binDir = "@bindir@" unless defined $binDir;
|
|||
|
||||
if (scalar @ARGV < 1) {
|
||||
print STDERR <<EOF
|
||||
Usage: nix-copy-closure [--from | --to] HOSTNAME [--sign] PATHS...
|
||||
Usage: nix-copy-closure [--from | --to] HOSTNAME [--sign] [--gzip] PATHS...
|
||||
EOF
|
||||
;
|
||||
exit 1;
|
||||
|
|
|
|||
|
|
@ -1415,7 +1415,7 @@ DerivationGoal::PrepareBuildReply DerivationGoal::prepareBuild()
|
|||
for (StringSet::iterator j = i->second.begin(); j != i->second.end(); ++j)
|
||||
if (inDrv.outputs.find(*j) != inDrv.outputs.end()){
|
||||
computeFSClosure(inDrv.outputs[*j].path, inputPaths, true, false, 0); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!! WE (MAY) ALSO NEED TO COPY STATE (done?)
|
||||
computeFSClosure(inDrv.outputs[*j].path, inputStatePaths, false, true, 0); //TODO!!!!!!!!!!!!! HOW CAN THESE PATHS ALREADY BE VALID ..... ?????????????????????
|
||||
computeFSClosure(inDrv.outputs[*j].path, inputStatePaths, false, true, 0);
|
||||
}
|
||||
else
|
||||
throw BuildError(
|
||||
|
|
|
|||
|
|
@ -94,13 +94,12 @@ static TableId dbDerivers = 0;
|
|||
*/
|
||||
static TableId dbStateCounters = 0;
|
||||
|
||||
/* dbStateInfo :: Path ->
|
||||
/* dbStateInfo :: StorePath -> [(StatePath, identifier, username)]
|
||||
*
|
||||
* This table lists all the store components, that are state-store components
|
||||
* meaning that this component has a /nix/state/ entry to store its state
|
||||
* and thus this component (should) have a reference to that state path
|
||||
*
|
||||
* TODO the value is now empty but we could store the entire DRV in here in the future
|
||||
*/
|
||||
static TableId dbStateInfo = 0;
|
||||
|
||||
|
|
@ -133,17 +132,8 @@ static TableId dbStateRevisionsComments = 0;
|
|||
*
|
||||
* /nix/state/HASH-A-1.0-test-KEY-1185473750
|
||||
* -->
|
||||
* [ 1185473750, 00118547375 ] // TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PATH-SS
|
||||
* [ (statePath/log, 1185473750), (statePath/output.dat, 1185473751) ]
|
||||
*
|
||||
* The timestamps are ordered based on the path of the subfolder !!
|
||||
*
|
||||
* So if a has:
|
||||
*
|
||||
* /nix/state/....A../log
|
||||
* /nix/state/....A../cache
|
||||
*
|
||||
* then ./cache has TS 1185473750
|
||||
* and ./log has TS 00118547375
|
||||
*
|
||||
*/
|
||||
static TableId dbStateSnapshots = 0;
|
||||
|
|
|
|||
|
|
@ -132,16 +132,10 @@ void revertToRevisionTxn(const Transaction & txn, const Path & statePath, const
|
|||
//Dir: Remove a slash at the end, we create /nix/state/...../cachedir@1234/
|
||||
//File: Or create /nix/state/..../logfile.txt@1234
|
||||
string revertPathOrFile_e;
|
||||
if(revertPathOrFile.substr(revertPathOrFile.length() -1 , revertPathOrFile.length()) == "/"){
|
||||
if(revertPathOrFile.substr(revertPathOrFile.length() -1 , revertPathOrFile.length()) == "/")
|
||||
revertPathOrFile_e = revertPathOrFile.substr(0 , revertPathOrFile.length() -1) + "@" + unsignedInt2String(epoch) + "/";
|
||||
|
||||
//TODO IF IS FILE: REMOVE THE FILE todo MOVE THIS INTO RSYNCPATHS???
|
||||
}
|
||||
else{
|
||||
else
|
||||
revertPathOrFile_e = revertPathOrFile + "@" + unsignedInt2String(epoch);
|
||||
|
||||
//TODO IF IS DIR: REMOVE THE DIR
|
||||
}
|
||||
|
||||
rsyncPaths(revertPathOrFile_e, revertPathOrFile, false);
|
||||
}
|
||||
|
|
@ -235,7 +229,6 @@ Snapshots commitStatePathTxn(const Transaction & txn, const Path & statePath)
|
|||
}
|
||||
|
||||
//TODO include this call in the validate function
|
||||
//TODO ONLY CALL THIS FUNCTION ON A NON-SHARED STATE PATH!!!!!!!!!!!
|
||||
void scanAndUpdateAllReferencesTxn(const Transaction & txn, const Path & statePath
|
||||
, PathSet & newFoundComponentReferences, PathSet & newFoundStateReferences) //only for recursion
|
||||
{
|
||||
|
|
@ -245,10 +238,8 @@ void scanAndUpdateAllReferencesTxn(const Transaction & txn, const Path & statePa
|
|||
|
||||
//printMsg(lvlError, format("scanAndUpdateAllReferencesTxn: '%1%' - %2%") % statePath % revision);
|
||||
|
||||
//TODO check if path is not a shared path !
|
||||
//TODO
|
||||
//TODO Unshare the path:
|
||||
//TODO Path statePath_ns = toNonSharedPathTxn(txn, statePath);
|
||||
//Check if path is not a shared path
|
||||
Path statePath_ns = toNonSharedPathTxn(txn, statePath);
|
||||
|
||||
//get all possible state and component references
|
||||
PathSet allComponentPaths;
|
||||
|
|
@ -266,14 +257,14 @@ void scanAndUpdateAllReferencesTxn(const Transaction & txn, const Path & statePa
|
|||
//TODO maybe only scan in the changeset (patch) for new references? (this will be difficult and depending on the underlying versioning system)
|
||||
|
||||
//Scan in for (new) component and state references
|
||||
PathSet state_references = scanForReferences(statePath, allComponentPaths2);
|
||||
PathSet state_stateReferences = scanForStateReferences(statePath, allStatePaths);
|
||||
PathSet state_references = scanForReferences(statePath_ns, allComponentPaths2);
|
||||
PathSet state_stateReferences = scanForStateReferences(statePath_ns, allStatePaths);
|
||||
|
||||
//Retrieve old references
|
||||
PathSet old_references;
|
||||
PathSet old_state_references;
|
||||
queryXReferencesTxn(txn, statePath, old_references, true, 0); //get the latsest references
|
||||
queryXReferencesTxn(txn, statePath, old_state_references, false, 0);
|
||||
queryXReferencesTxn(txn, statePath_ns, old_references, true, 0); //get the latsest references
|
||||
queryXReferencesTxn(txn, statePath_ns, old_state_references, false, 0);
|
||||
|
||||
//Check for added and removed paths
|
||||
PathSet diff_references_removed;
|
||||
|
|
@ -290,22 +281,22 @@ void scanAndUpdateAllReferencesTxn(const Transaction & txn, const Path & statePa
|
|||
//Print error, but we could also throw an error.
|
||||
if(diff_references_added.size() != 0)
|
||||
for (PathSet::iterator i = diff_references_added.begin(); i != diff_references_added.end(); ++i)
|
||||
printMsg(lvlError, format("Added component reference found!: '%1%' in state path '%2%'") % (*i) % statePath);
|
||||
printMsg(lvlError, format("Added component reference found!: '%1%' in state path '%2%'") % (*i) % statePath_ns);
|
||||
if(diff_references_removed.size() != 0)
|
||||
for (PathSet::iterator i = diff_references_removed.begin(); i != diff_references_removed.end(); ++i)
|
||||
printMsg(lvlError, format("Removed component reference found!: '%1%' in state path '%2%'") % (*i) % statePath);
|
||||
printMsg(lvlError, format("Removed component reference found!: '%1%' in state path '%2%'") % (*i) % statePath_ns);
|
||||
if(diff_state_references_added.size() != 0)
|
||||
for (PathSet::iterator i = diff_state_references_added.begin(); i != diff_state_references_added.end(); ++i)
|
||||
printMsg(lvlError, format("Added state reference found!: '%1%' in state path '%2%'") % (*i) % statePath);
|
||||
printMsg(lvlError, format("Added state reference found!: '%1%' in state path '%2%'") % (*i) % statePath_ns);
|
||||
if(diff_state_references_removed.size() != 0)
|
||||
for (PathSet::iterator i = diff_state_references_removed.begin(); i != diff_state_references_removed.end(); ++i)
|
||||
printMsg(lvlError, format("Removed state reference found!: '%1%' in state path '%2%'") % (*i) % statePath);
|
||||
printMsg(lvlError, format("Removed state reference found!: '%1%' in state path '%2%'") % (*i) % statePath_ns);
|
||||
|
||||
//We always set the referernces so we know they were scanned (maybe the same) at a certain time
|
||||
printMsg(lvlError, format("Updating new references for statepath: '%1%'") % statePath);
|
||||
Path drvPath = queryStatePathDrvTxn(txn, statePath);
|
||||
printMsg(lvlError, format("Updating new references for statepath: '%1%'") % statePath_ns);
|
||||
Path drvPath = queryStatePathDrvTxn(txn, statePath_ns);
|
||||
registerValidPath(txn,
|
||||
statePath,
|
||||
statePath_ns,
|
||||
Hash(), //emtpy hash
|
||||
state_references,
|
||||
state_stateReferences,
|
||||
|
|
@ -350,6 +341,10 @@ void rsyncPaths(const Path & from, const Path & to, const bool addSlashes) //TO
|
|||
if(!DirectoryExist(to))
|
||||
throw Error(format("Path `%1%' doenst exist ...") % to);
|
||||
*/
|
||||
|
||||
//TODO IF IS FILE: REMOVE THE FILE todo MOVE THIS INTO RSYNCPATHS???
|
||||
//TODO IF IS DIR: REMOVE THE DIR
|
||||
|
||||
|
||||
Path from2 = from;
|
||||
Path to2 = to;
|
||||
|
|
@ -684,23 +679,6 @@ bool queryStateRevisions(Database & nixDB, const Transaction & txn, TableId revi
|
|||
unsigned int getTimestamp;
|
||||
splitDBRevKey(*i, getStatePath, getTimestamp);
|
||||
|
||||
//query state versioined directorys/files
|
||||
//TODO REMOVE
|
||||
/*
|
||||
vector<Path> sortedPaths;
|
||||
Derivation drv = derivationFromPathTxn(txn, queryStatePathDrvTxn(txn, getStatePath));
|
||||
DerivationStateOutputs stateOutputs = drv.stateOutputs;
|
||||
DerivationStateOutputDirs stateOutputDirs = drv.stateOutputDirs;
|
||||
for (DerivationStateOutputDirs::const_iterator j = stateOutputDirs.begin(); j != stateOutputDirs.end(); ++j){
|
||||
string thisdir = (j->second).path;
|
||||
string fullstatedir = getStatePath + "/" + thisdir;
|
||||
if(thisdir == "/") //exception for the root dir
|
||||
fullstatedir = statePath + "/";
|
||||
sortedPaths.push_back(fullstatedir);
|
||||
}
|
||||
sort(sortedPaths.begin(), sortedPaths.end()); //sort
|
||||
*/
|
||||
|
||||
Strings snapshots_s;
|
||||
Snapshots snapshots;
|
||||
nixDB.queryStrings(txn, snapshots_table, *i, snapshots_s);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ Query flags:
|
|||
--xml: show output in XML format
|
||||
--status / -s: print installed/present status
|
||||
--no-name: hide derivation names
|
||||
--attr / -A: shows the unambiguous attribute name of the
|
||||
--attr-path / -P: shows the unambiguous attribute name of the
|
||||
derivation which can be used when installing with -A
|
||||
--system: print the platform type of the derivation
|
||||
--compare-versions / -c: compare version to available or installed
|
||||
|
|
|
|||
|
|
@ -333,10 +333,11 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
|||
r_commit = false;
|
||||
}
|
||||
else if(*i == "--statehelp"){
|
||||
printMsg(lvlError, format("%1%") % padd("", '-', 100));
|
||||
//printMsg(lvlError, format("%1%") % padd("", '-', 100));
|
||||
printHelp();
|
||||
r_scanforReferences = false;
|
||||
r_commit = false;
|
||||
return;
|
||||
}
|
||||
|
||||
//printMsg(lvlError, format("ARG %1%") % *i);
|
||||
|
|
@ -357,7 +358,7 @@ static void opRunComponent(Strings opFlags, Strings opArgs)
|
|||
|
||||
//******************* Scan for new references if neccecary
|
||||
if(r_scanforReferences)
|
||||
store->scanAndUpdateAllReferences(root_statePath, true); //TODO make recursive a paramter?
|
||||
store->scanAndUpdateAllReferences(root_statePath, true); //TODO make recursive a paramter? TXN???
|
||||
|
||||
|
||||
//******************* With everything in place, we call the commit script on all statePaths (in)directly referenced **********************
|
||||
|
|
|
|||
6
startNixosDaemon.sh
Executable file
6
startNixosDaemon.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#! /bin/sh
|
||||
|
||||
initctl stop nix-daemon
|
||||
killproc.sh nix-worker
|
||||
sleep 2
|
||||
initctl start nix-daemon
|
||||
Loading…
Add table
Add a link
Reference in a new issue