Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
34fcf5fa
Commit
34fcf5fa
authored
21 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
* Started integrating the new evaluation model into Nix.
* Cleaned up command-line syntax.
parent
7a96da36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
configure.ac
+6
-0
6 additions, 0 deletions
configure.ac
src/Makefile.am
+4
-4
4 additions, 4 deletions
src/Makefile.am
src/eval.cc
+3
-3
3 additions, 3 deletions
src/eval.cc
src/nix.cc
+100
-644
100 additions, 644 deletions
src/nix.cc
src/values.cc
+4
-2
4 additions, 2 deletions
src/values.cc
with
117 additions
and
653 deletions
configure.ac
+
6
−
0
View file @
34fcf5fa
...
@@ -10,5 +10,11 @@ AC_CANONICAL_HOST
...
@@ -10,5 +10,11 @@ AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXX
# Unix shell scripting should die a slow and painful death.
AC_DEFINE_UNQUOTED(NIX_VALUES_DIR, "$(eval echo $prefix/values)", Nix values directory.)
AC_DEFINE_UNQUOTED(NIX_STATE_DIR, "$(eval echo $localstatedir/nix)", Nix state directory.)
AC_DEFINE_UNQUOTED(NIX_LOG_DIR, "$(eval echo $localstatedir/log/nix)", Nix log file directory.)
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile])
AC_OUTPUT
AC_OUTPUT
This diff is collapsed.
Click to expand it.
src/Makefile.am
+
4
−
4
View file @
34fcf5fa
bin_PROGRAMS
=
nix fix
bin_PROGRAMS
=
nix
#
fix
noinst_PROGRAMS
=
test
noinst_PROGRAMS
=
test
AM_CXXFLAGS
=
-DSYSTEM
=
\"
@host@
\"
-Wall
AM_CXXFLAGS
=
-DSYSTEM
=
\"
@host@
\"
-Wall
-I
..
nix_SOURCES
=
nix.cc
db.cc
util.cc hash.cc md5.c
nix_SOURCES
=
nix.cc util.cc hash.cc md5.c
eval.cc values.cc globals.cc db.cc
nix_LDADD
=
-ldb_cxx-4
-lATerm
nix_LDADD
=
-ldb_cxx-4
-lATerm
fix_SOURCES
=
fix.cc util.cc hash.cc md5.c
fix_SOURCES
=
fix.cc util.cc hash.cc md5.c
...
@@ -20,4 +20,4 @@ install-data-local:
...
@@ -20,4 +20,4 @@ install-data-local:
# $(INSTALL) -d $(localstatedir)/nix/prebuilts/exports
# $(INSTALL) -d $(localstatedir)/nix/prebuilts/exports
$(INSTALL)
-d
$(localstatedir)/log/nix
$(INSTALL)
-d
$(localstatedir)/log/nix
$(INSTALL)
-d
$(prefix)/values
$(INSTALL)
-d
$(prefix)/values
$(bindir)/nix
init
$(bindir)/nix
--
init
This diff is collapsed.
Click to expand it.
src/eval.cc
+
3
−
3
View file @
34fcf5fa
...
@@ -279,7 +279,7 @@ Expr evalValue(Expr e)
...
@@ -279,7 +279,7 @@ Expr evalValue(Expr e)
string
fn
=
queryValuePath
(
evalHash
(
e2
));
string
fn
=
queryValuePath
(
evalHash
(
e2
));
ATerm
e3
=
ATreadFromNamedFile
(
fn
.
c_str
());
ATerm
e3
=
ATreadFromNamedFile
(
fn
.
c_str
());
if
(
!
e3
)
throw
Error
(
"reading aterm from "
+
fn
);
if
(
!
e3
)
throw
Error
(
"reading aterm from "
+
fn
);
return
e
3
;
return
e
valValue
(
e3
)
;
}
}
/* Execution primitive. */
/* Execution primitive. */
...
@@ -298,8 +298,8 @@ Expr evalValue(Expr e)
...
@@ -298,8 +298,8 @@ Expr evalValue(Expr e)
evalArgs
(
args
,
argsNF
,
env
);
evalArgs
(
args
,
argsNF
,
env
);
Hash
sourceHash
=
hashExpr
(
Hash
sourceHash
=
hashExpr
(
ATmake
(
"Exec(Str(<str>), Hash(<str>),
[]
)"
,
ATmake
(
"Exec(Str(<str>), Hash(<str>),
<term>
)"
,
buildPlatform
.
c_str
(),
((
string
)
prog
).
c_str
()));
buildPlatform
.
c_str
(),
((
string
)
prog
).
c_str
()
,
argsNF
));
/* Do we know a normal form for sourceHash? */
/* Do we know a normal form for sourceHash? */
Hash
targetHash
;
Hash
targetHash
;
...
...
This diff is collapsed.
Click to expand it.
src/nix.cc
+
100
−
644
View file @
34fcf5fa
This diff is collapsed.
Click to expand it.
src/values.cc
+
4
−
2
View file @
34fcf5fa
...
@@ -19,6 +19,8 @@ static string absValuePath(string s)
...
@@ -19,6 +19,8 @@ static string absValuePath(string s)
Hash
addValue
(
string
path
)
Hash
addValue
(
string
path
)
{
{
path
=
absPath
(
path
);
Hash
hash
=
hashPath
(
path
);
Hash
hash
=
hashPath
(
path
);
string
name
;
string
name
;
...
@@ -79,7 +81,7 @@ string queryValuePath(Hash hash)
...
@@ -79,7 +81,7 @@ string queryValuePath(Hash hash)
return
fn
;
return
fn
;
}
}
throw
Error
(
"a file with hash "
+
(
string
)
hash
+
" is requ
est
ed, "
throw
Error
(
"a file with hash "
+
(
string
)
hash
+
" is requ
ir
ed, "
"but it is not known to exist locally or on the network"
);
"but it is not known to exist locally or on the network"
);
#if 0
#if 0
if (checkedNet)
if (checkedNet)
...
@@ -87,7 +89,7 @@ string queryValuePath(Hash hash)
...
@@ -87,7 +89,7 @@ string queryValuePath(Hash hash)
" should have hash " + (string) hash + ", but it doesn't");
" should have hash " + (string) hash + ", but it doesn't");
if (!queryDB(nixDB, dbNetSources, hash, url))
if (!queryDB(nixDB, dbNetSources, hash, url))
throw Error("a file with hash " + (string) hash + " is requ
est
ed, "
throw Error("a file with hash " + (string) hash + " is requ
ir
ed, "
"but it is not known to exist locally or on the network");
"but it is not known to exist locally or on the network");
checkedNet = true;
checkedNet = true;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment