Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
boytacean
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
Container 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
João Magalhães
boytacean
Commits
710445dd
Verified
Commit
710445dd
authored
2 years ago
by
João Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
feat: more env variable obtained
parent
bebd1b15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#2172
failed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.rs
+31
-1
31 additions, 1 deletion
build.rs
src/gen/mock.rs
+5
-0
5 additions, 0 deletions
src/gen/mock.rs
with
36 additions
and
1 deletion
build.rs
+
31
−
1
View file @
710445dd
...
...
@@ -29,7 +29,7 @@ use std::fs::{File, OpenOptions};
use
std
::
io
::
Write
;
use
std
::
path
::
Path
;
use
std
::
process
::
Command
;
use
std
::
str
;
use
std
::
{
env
,
str
}
;
const
BUILD_OUT_FILE
:
&
str
=
"build.rs"
;
const
SOURCE_DIR
:
&
str
=
"./src/gen"
;
...
...
@@ -70,6 +70,12 @@ fn main() {
&
format!
(
"{}"
,
now_utc
.format
(
"%H:%M:%S"
)),
);
write_str_constant
(
&
mut
file
,
"NAME"
,
option_env!
(
"CARGO_PKG_NAME"
)
.unwrap_or
(
"UNKNOWN"
),
);
write_str_constant
(
&
mut
file
,
"VERSION"
,
...
...
@@ -93,6 +99,30 @@ fn main() {
.as_str
();
write_str_constant
(
&
mut
file
,
"COMPILER_VERSION"
,
compiler_version
);
write_str_constant
(
&
mut
file
,
"HOST"
,
&
env
::
var
(
"HOST"
)
.unwrap_or
(
String
::
from
(
"UNKNOWN"
)),
);
write_str_constant
(
&
mut
file
,
"TARGET"
,
&
env
::
var
(
"TARGET"
)
.unwrap_or
(
String
::
from
(
"UNKNOWN"
)),
);
write_str_constant
(
&
mut
file
,
"PROFILE"
,
&
env
::
var
(
"PROFILE"
)
.unwrap_or
(
String
::
from
(
"UNKNOWN"
)),
);
write_str_constant
(
&
mut
file
,
"MAKEFLAGS"
,
option_env!
(
"CARGO_MAKEFLAGS"
)
.unwrap_or
(
"UNKNOWN"
),
);
let
mut
features
=
vec!
[
"cpu"
];
if
cfg!
(
feature
=
"wasm-extension"
)
{
...
...
This diff is collapsed.
Click to expand it.
src/gen/mock.rs
+
5
−
0
View file @
710445dd
...
...
@@ -2,9 +2,14 @@
pub
const
COMPILATION_DATE
:
&
str
=
"-"
;
pub
const
COMPILATION_TIME
:
&
str
=
"-"
;
pub
const
NAME
:
&
str
=
"-"
;
pub
const
VERSION
:
&
str
=
"x.x.x"
;
pub
const
COMPILER
:
&
str
=
"rustc"
;
pub
const
COMPILER_VERSION
:
&
str
=
"x.x.x"
;
pub
const
HOST
:
&
str
=
"-"
;
pub
const
TARGET
:
&
str
=
"-"
;
pub
const
PROFILE
:
&
str
=
"-"
;
pub
const
MAKEFLAGS
:
&
str
=
"-"
;
pub
const
FEATURES
:
[
&
str
;
1
]
=
[
"cpu"
];
pub
const
PLATFORM_CPU_BITS
:
&
str
=
"64"
;
pub
const
DEFAULT_THREAD_POOL_SIZE
:
usize
=
1
;
...
...
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